EmbDev.net

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


von Kamil B. (kamil51)


Attached files:

Rate this post
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 
"printf".
(if it is deleted no any problem..)
used form in function like that;

printf("something?????..?\n);

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
//lcd_write_nibbles('A');
#if 0
  int index;

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

    uart0Putch(ptr[index]);
  }
#endif

  return len;
}

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

why?




regards

kamil

von na sowas (Guest)


Rate this post
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
useful
not useful
Hello,

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') {   //
       i=0;
       for (i=0;i<16;i++) ascii7bit[i]=((Read_eeprom(i+20)));
       i=0;
           }
//..........................................
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.

Regards

kamil

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.