This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Newlib, syscall.c and printf
- From: Hard Maker <hardmaker at gmail dot com>
- To: newlib at sourceware dot org, arm-gnu at codesourcery dot com
- Date: Tue, 08 Feb 2011 10:23:18 -0300
- Subject: Newlib, syscall.c and printf
Hi!
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
Sergio