printf returning EOF

Keith Robertson kjrobert at
Thu Feb 2 01:15:17 UTC 2006

Ian Caddy wrote:
> This sounds like the sort of problem where the initialised data area is 
> not being initialised.
> printf and friends rely on chunks of inited data, being set and not 
> being zero, so with the new BSP, you will need to ensure that your data 
> is being copied into the correct running area by your startup code and 
> while you are doing that also ensure that the BSS area is being 
> initialised to zero.
> Hope this helps.

Hi Ian and Joel.

Thanks very much for your ideas.  They definitely got me on the right 
track.  Although the linkcmds and boot process etc ended up being 
correct, I've subsequently figured out that the timings for the 
synthesised sdram controller were slightly dodgy.  It just happened that 
one of the areas of ram not always responding correctly was were bss and 
data lived!

Anyways, just to follow this up for future archive searches, if printf 
and friends are returning -1/EOF, definitely check that your bss and 
data sections are being setup appropriately.



More information about the users mailing list