This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: i386 RedBoot serial
- From: Jonathan Larmour <jlarmour at redhat dot com>
- To: "Ecer, Jiri" <jecer at rational dot com>,eCos discussion <ecos-discuss at sources dot redhat dot com>
- Date: Sun, 10 Feb 2002 21:30:22 +0000
- Subject: Re: [ECOS] i386 RedBoot serial
- References: <1E0ABA7B578BCC40AA5EED022EFE32E6019622E5@sca-can1it01.rational.com>
[ Don't mail me direct off-list please. One to one support costs money! ]
"Ecer, Jiri" wrote:
>
> Jifl,
>
> the segmentation fault happens in Cyg_StdioStream::flush_output_unlocked()
> on line 546 of file
> $ECOS_REPOSITORY/language/c/libc/stdio/current/src/common/stream.cxx:
>
> Cyg_ErrNo
> Cyg_StdioStream::flush_output_unlocked( void )
> {
> #ifdef CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO
> Cyg_ErrNo write_err=ENOERR;
> cyg_uint8 *buffer;
> cyg_uint32 len;
>
> CYG_ASSERTCLASS( this, "Stream object is not a valid stream!" );
>
> if ( flags.last_buffer_op_was_read )
> return ENOERR;
>
> // first just check that we _can_ write to the device!
> if ( !flags.opened_for_write )
> return EINVAL;
>
> // shortcut if nothing to do
> if (io_buf.get_buffer_space_used() == 0)
> return ENOERR;
>
> len = io_buf.get_buffer_addr_to_read( (cyg_uint8 **)&buffer );
>
> CYG_ASSERT( len > 0,
> "There should be data to read but there isn't!");
>
> write_err = cyg_stdio_write(my_device, buffer, &len);
> <-------- HERE
>
> Is this due to misconfiguration? The problem does go away when
> CYGPKG_IO_SERIAL_DEVICES is enabled in ecos.ecc.
Ah well that's why then! You have to enable that option. Earlier on the
device open will have failed, but unless you have eCos assertion support
enabled, this will not have been caught (as is a principle of true embedded
systems - don't do excessive error checking for stuff that should be caught
at development time).
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
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss