avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Problems with scanf_P()


From: Larry Barello
Subject: [avr-gcc-list] Problems with scanf_P()
Date: Mon, 12 Jul 2004 06:36:32 -0700

This is a libc problem, so if someone could please re-direct this
question...

I am using scanf_P (I doubt this is a _P problem) and it periodically
wedges.  Since I am just using the lib and debugging with Avr Studio, I get
clueless pretty fast as I dig into the code.  I.e. no symbolic information
whatsoever.

Anyway, the problem is that after a while scanf() simply returns and parses
nothing.  I have not characterized it more (i.e. is it parsing but failing
to poke out the variables, is it always failing to get input, etc).  The
other menu/printf/get_char() stuff works, but the scanf_P doesn't.  The
application is a cascade PID controller with a little menu system and a
command processor for the machine interface (@0sp0x1234 - set channel 0
position to 0x1234).  I use scanf to parse the machine interface.

I use an interrupt driven buffered i/o, and I do fdefopen() with a blocking
write and a non-blocking read which returns -1 when the buffer is empty.
Most of the time it works.  After Scanf wedges the rest of the menu system
works, just the command interface doesn't (the part using scanf())

Any ideas?

I am using only a couple hundred bytes of a mega16 SRAM, the standard lib
and no malloc.  There shouldn't be any stack issue.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]