This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Mutex & Asserts during initialisation
- From: Will Wagner <will_wagner at carallon dot com>
- To: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Fri, 08 Jul 2005 13:17:47 +0100
- Subject: [ECOS] Mutex & Asserts during initialisation
Hi All,
I am trying to run with asserts on to test a couple of things. However
there seems to be a problem with the mutex check_this function has been
implemented.
If anything tries to lock a mutex before the scheduler has been started
then an assert goes off. This is because when locking the mutex
Cyg_Thread::self() returns NULL. So in the check this function locked is
true but owner is NULL so it fails.
This means that you can't use SPI or i2c before the scheduler starts. If
you have any driver that is initialised via static constructor that uses
either of those then the system asserts. An example of this would be the
DS1307 wallclock.
How has anyone worked around this in the past?
Thanks,
Will
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss