This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: [ecos]hanger in printf
- From: Robert Brusa <bob dot brusa at gmail dot com>
- To: MailingList:ecos-discuss <ecos-discuss at ecos dot sourceware dot org>;
- Date: Fri, 13 Mar 2009 10:50:07 +0100
- Subject: [ECOS] Re: [ecos]hanger in printf
- References: <op.up0be0ndkeg3uf@localhost>
- Reply-to: Bob dot Brusa at gmail dot com
On Fri, 27 Feb 2009 11:58:05 +0100, Robert Brusa <Bob.Brusa@gmail.com>
wrote:
Hi
Following a recent update (Jan 09) of ecos from V2.0 to the "unstable"
version and migration to the new gnutools arm-eabi of codesourcery, I
run into a hanger of a printf statement:
void IsInitMode(void)
{
static bool first = true;
static unsigned long int t1, t0 = 0; // time in units of 10 ms
t1 = cyg_current_time();
if ( ( t1 - t0 > 600 * SEC2TICS ) || first) { // msg repeats every
minute
first = false;
printf("\nstatus is INIT - manual help required");
t0 = t1;
}
} //end IsInitMode
No output appears on ser0 or ser1 and a breakpoint at t0 = is never
reached.
When using diag_printf instead of printf, the message is output on ser1.
My system is configured to use ser1 for diagnostics. In the earlier
version, printf-output also appeared on ser1. I have digged somewhat
into the problem, but no conclusion so far. I can see that the output
(should?) go to stdiostream. Sometimes later it calls cyg_io_write, but
the device-handle is zero. A configuration error? - but which? Thanks
and regards
Robert
Hi
well the problem persists. Meanwhile I have found (no, its not the stack!)
that the thread calling printf crashes somewhere shortly after a call to
flush_output_unlocked() on line 660 of stream.cxx. ???? Experts - please
help, this printf involves quite a lot of stuff. I got the impression,
that something (the stream?) is locked, although its not clear why. Could
it be that it never succeeds unlocking and hence the thread gets blocked?
Robert
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss