printf hangs problem

OP #1693639
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
Attached files:
OP #1694134
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

Reply

A question of your own? This thread is over 16 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.