From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26129 invoked by alias); 8 Jul 2005 12:15:04 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 25999 invoked by uid 22791); 8 Jul 2005 12:14:50 -0000 Received: from carallon.force9.co.uk (HELO carallon.f9.co.uk) (80.229.37.120) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 08 Jul 2005 12:14:50 +0000 Received: from [192.168.42.8] by carallon.com (MDaemon.PRO.v8.0.2.R) with ESMTP id md50000011913.msg for ; Fri, 08 Jul 2005 13:17:48 +0100 Message-ID: <42CE6EEB.1070309@carallon.com> Date: Fri, 08 Jul 2005 12:15:00 -0000 From: Will Wagner User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: eCos Discussion Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-Sender: willw@carallon.com X-Spam-Processed: carallon.f9.co.uk, Fri, 08 Jul 2005 13:17:48 +0100 (not processed: message from valid local sender) X-MDRemoteIP: 192.168.42.8 X-Return-Path: will_wagner@carallon.com X-MDaemon-Deliver-To: ecos-discuss@ecos.sourceware.org X-MDAV-Processed: carallon.f9.co.uk, Fri, 08 Jul 2005 13:17:50 +0100 Subject: [ECOS] Mutex & Asserts during initialisation X-SW-Source: 2005-07/txt/msg00083.txt.bz2 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