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: assertion error in stdio


>>>>> "James" == James Kahkoska <jkahkoska@wire-less-inc.com> writes:

    James> I am having a problem with eCos when I turn on asserts in
    James> eCos. I thought everything I/O related was working ok but
    James> when I turn on assertions, I get the following assertion
    James> error:

    <snip>

I am not an expert on this part of the system, but I can give a couple
of pointers.

All C library streams, including stdout, need to be mapped to an
underlying stream device such as "/dev/ttydiag". stdout is unusual in
that it needs to exist and be usable by the time the application gets
started, so it is necessary to select the target device at eCos
compile-time. This is achieved by the C library configuration option
CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE.

If at initialization time the device specified by this configuration
option is absent then you should get an assertion failure. Ideally it
would be possible to check at configure-time that the selected device
is going to be present, but that would require some CDL extensions. In
addition it would be necessary to cope with the possibility that the
default stdout device is provided by application code rather than by
an eCos package. 

So either CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE has been changed so that
it no longer corresponds to a valid device name, or you have disabled
the device driver corresponding to the default value. This default
value is "/dev/ttydiag", which should be provided by the common serial
package CYGPKG_IO_SERIAL. If you remove this common serial package
from the configuration then you are responsible for providing an
alternative stdout device. Note that it should always be possible for
the common serial package to provide at least one device which uses
the low-level HAL diagnostics routines to send output to the user
(whether by flashing morse code on an LED, or by other means).
Alternatively you may have manipulated a configuration option such as
CYGPKG_IO_SERIAL_TTY, CYGDAT_IO_SERIAL_TTY_CONSOLE or
CYGPKG_IO_SERIAL_TTY_TTYDIAG, and thus disabled or renamed
"/dev/ttydiag".

Anyway, the C library has been configured to use a particular device
for stdout and that device is not present at the time that stdout gets
initialized. Hopefully that will help you to figure out what is going
on in your specific case.

Bart Veer // eCos net maintainer

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