Forum: ARM programming with GCC/GNU tools printf hangs problem

von Kamil B. (kamil51)

Attached files:

Rate this post
0 useful
not useful
Hello all,

I am using YAGARTO ver. Newlib-1.18.0  GCC-4.4.2
 if i use printf,iprintf.. function in my code the program halts after 
(if it is deleted no any problem..)
used form in function like that;


the syscalls.c downloaded from the YAGARTO 
page(http://www.yagarto.de/download/yagarto/syscalls.c ..)

to check the  "_write_r" routine is works or not, i insert the folloeing 
code linebelow;

IOSET0 =0x00003C00;// LEDs are connected to the p0.10,p0.11,p0.12, p0.13

int _write_r (struct _reent *r, int file, char * ptr, int len)
  r = r;
  file = file;
  ptr = ptr;
IOSET0 =0x00003C00;// LEDs are connected to the p0.10,p0.11,p0.12, p0.13
#if 0
  int index;

  /* For example, output string by UART */
  for(index=0; index<len; index++)
    if (ptr[index] == '\n')


  return len;

The LEDs never light on!this mean that this routine doesnt work.




von na sowas (Guest)

Rate this post
0 useful
not useful
I can not find any printf in the code...  :-/
Perhaps you could post your code.

And: what happens when you use puts()?
BTW: whats your target processor?

von Kamil B. (kamil51)

Rate this post
0 useful
not useful

Target processor LPC2138. I dont want to use "puts" because i will use 
float values in my code. a part of code like this;

if (msg_tip =='A') {   //
       for (i=0;i<16;i++) ascii7bit[i]=((Read_eeprom(i+20)));
else if(msg_tip =='B') {  //store data
       DATA_OUT=2;  //write to RAM
       printf("V=%0.3f Volt",(temperature )*0.00488281);

i need to operate analog values in code.




Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.