EmbDev.net

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


Author: Kamil Bahadir (kamil51)
Posted on:
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 
"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

Author: na sowas (Guest)
Posted on:

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?

Author: Kamil Bahadir (kamil51)
Posted on:

Rate this post
0 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

Reply

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.