[ECOS] idle thread stack alignment problem

Uwe Kindler uwe_kindler@web.de
Sun Dec 21 11:30:00 GMT 2003


in order to debug the serial driver for the EDOSK platform, I created a
simple application with one single thread. As soon, as the common serial
eCos driver calls cyg_drv_cond_wait my application crashs. (At least it does
not respond to GDB anymore).  If only one thread is present,
cyg_drv_cond_wait causes a thread switch to the idle thread. When I create a
second thread with an empty while loop my application runs well. So there
must be a problem with the idle thread. After hours of debugging I found
that the idle thread stack starts at an odd address. But for the H8S
architecture its is required that the SP is always even (word or longword
size operands when using SP). When I changed the declaration of the idle
thread stack in this way:

static short

everything works fine without a crash.

Is there a way to change the alignment of the thread stack without changing
the thread.cxx sourcecode? I did not found any other way then the one
described above.

Thank you very much for your help

Regards, Uwe

eCos port for Renesas EDOSK-2674

Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

More information about the Ecos-discuss mailing list