This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: sscanf() vs. fgetc()


Peter Graf wrote:
> 
> Hi Jonathan,
> 
> thank you very much for trying the example. Indeeed very kind of you!
> 
> >Hmm....
> >
> >cyg_thread_create()...
> >cyg_thread_resume...
> >fgetc()...
> >fgetc() done.
> 
> Why doesn't fgetc() block in your case?
> Were there characters in the serial buffer?

Shouldn't have been... but it may have been a glitch.

> For me, fgetc() does block due to empty buffer.
> 
> >fgetc()...

It does block here though.

> >loop...
> >sprintf...
> >sscanf...
> >sscanf done.
> >loop...
> >main() finished
> >
> >This was on a PC target FWIW.
> 
> Which priority value did you have for the sscanf() thread?
> I had the default of "10", which means lower priority than
> the "9" in the fgetc() thread.

I used exactly your code, the only change being the serial port name
(because it has to be for the PC).
> >Perhaps you should step into sscanf() and see where it stops.
> 
> I tried, of course. Singlestepping has the tendency of being a bit
> problematic on my target.
> (probably due to optimized code, and the way singlestepping works without
> hardware support).

Try recompiling eCos without optimization, i.e. editting
CYGBLD_GLOBAL_CFLAGS and doing a "make clean" and then a rebuild.

> I experience sigtraps when trying to singlestep my way down. Ignoring them,
> I end up
> in the scheduler, but don't understand too much of what is going on there.

Once you've compiled without optimization hopefully that will avoid the
SIGTRAPs. Can you then at least give a summary of what functions you enter
as you single step? Or cut and paste a step session?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]