This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: [ecos]hanger in printf
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Robert Brusa <bob dot brusa at gmail dot com>
- Cc: MailingList: ecos-discuss <ecos-discuss at ecos dot sourceware dot org>;
- Date: Fri, 27 Feb 2009 12:19:25 +0100
- Subject: Re: [ECOS] [ecos]hanger in printf
- References: <op.up0be0ndkeg3uf@localhost>
On Fri, Feb 27, 2009 at 11:58:05AM +0100, Robert Brusa 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");
Not likely to be your problem, but i would put a trailing \n. printf is buffered, so it won't get
flushed until the buffer is full or \n output. I don't think diag_printf is buffered.
printf() needs a lot of stack space, more than diag_printf. Maybe your
stack is too small?
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss