06-16-2009 07:46 AM
06-16-2009 09:05 AM
06-16-2009 10:11 AM
I tried to use expressions like *(arr1+i) and arr1[i] both interchangeably and consistently. But, the output was the same as before.
You miss vsiva's point.
When you declare the variable as
you are not reserving any space for anything. All you've declared is a pointer to an unsigned integer. But that pointer isn't pointing to anything.
So when you do your for loop, and you access arr1[i], you are accessing garbage because you never initialized arr1.
The suggestion to declare that array variable as arr1 is one you should heed.
06-16-2009 10:21 AM
exactly do as suggested in the previous post...else check that uart settings match with the hyperterminal connection settings, dat also sometimes causes the problem of no output.
06-16-2009 10:23 AM
else check that uart settings match with the hyperterminal connection settings, dat also sometimes causes the problem of no output.
That may be true but that's not his problem.
06-16-2009 08:32 PM
Yes, I missed vsiva's point. So, I'll try to use malloc for initialization so that the pointer doesn't point to garbage.
Thanks! I'll get back to you all asap.
06-17-2009 10:17 AM
Or I'll use arr1 (as an array) throughout.. Then I think I would't have to initialize it.
This is the better solution. In general, in an embedded system with limited memory, you really want to avoid dynamic allocation (malloc and its friends). If you use static allocations (arr1), the toolchain knows how much memory is required and after compiling and linking, they will tell you if your program will fit in your memory!
10-16-2011 04:49 AM
How can i send a float to UART if I mapped the xil_printf function to RS 232 IP?(Note:sprintf has a too large memory footprint ).