Newlib, syscall.c and printf

Hard Maker
Tue Feb 8 13:40:00 GMT 2011

I'm working with newlib-1.18 and codesourcery in a ARM cortex-m3 
platform. I want use printf to print data (text, decimal numbers, etc.) 
in a text lcd to debug the software. Surfing on the net I read a lot of 
page about _sbrk linking problem, syscalls implementations, etc. related 
to redirect printf to specific port (UART'sessentially).
After 15 days, I have a working implementation of syscalls.c to link my 
application and override the default syscalls. I was develop a lcd code 
to print data. All work fine, but not the printf function, printf never 
call write. If I call the write function, work fine:

int main()
     char data[20];
     float fVal = 3.141596;

     snprintf(data, 20, "Real : %.4f", fVal);
     _write(0, data, strlen(data)); // Work fine

     printf("Real: %.4f", fVal);  // this line do nothing, no error... 
nothing and the program stop here


I'm using 1 KB of system stack and have 60KB free of heap. Anyone has 
this problem?

Thank's a lot


More information about the Newlib mailing list