EmbDev.net

Forum: ARM programming with GCC/GNU tools newlib behaviour no printf!


von Bangla B. (Company: Bangla) (bangla)


Rate this post
useful
not useful
Hi All,
I am trying to use the printf (and all the IO functions of the stdlib) 
unsuccessfully. My set-up is gcc 4.6.0 (patched), binutils 2.21 
(patched) and newlib 1.19.0. I have a kernel, so the tools are created 
to be reentrant. I have noticed that when I use printf, putc, etc. the 
libc.a didn't call my routines (i.e _write_r, etc.). In the link I have 
eliminated the reference to my syscall to verify that they were demanded 
by the libc.a; It is the case. I have also noticed that libc.a call only 
once one of my routine, the "void __malloc_lock(reent_t *reent)". Any 
suggestion to fix this printf problem? Here is more information:
- cpu STM32
- stack lenght 8k
- Flags I used for building the newlib:

./configure --target=${TARGET} --prefix=${prefix} --enable-multilib \
  --enable-target-optspace --disable-nls   --enable-interwork \
  --enable-thumb --enable-newlib-multithread \
  --enable-newlib-io-long-long \
  --disable-libssp \
  --disable-libgloss \
  --disable-newlib-supplied-syscalls \
  --disable-newlib-atexit-alloc"

make -j 4 "CFLAGS=-Wno-error" \
          "CFLAGS_FOR_TARGET=-DREENTRANT_SYSCALLS_PROVIDED"
make install
make clean

I have also tried the Yagarto build with the same behavior.
Thank you for your help.
 Regards, Bangla

von Oliver (Guest)


Rate this post
useful
not useful
Well, I don't know how to help you. The only thing I can say that I 
successfully got it to work without big issues using Yagarto and newlib 
1.19.0, although in the non-reentrant version.

Maybe you step through the code, to figure out where something goes 
wrong, using either your Programmer or gdb in arm simulation mode.

Oliver

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.