This is the mail archive of the 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]
Other format: [Raw text]

Re: i386 RedBoot serial

[ 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 )
> {
>     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).

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:
and search the list archive:

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