From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26393 invoked by alias); 25 Aug 2011 13:46:40 -0000 Received: (qmail 26235 invoked by uid 22791); 25 Aug 2011 13:46:38 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from lon1-post-3.mail.demon.net (HELO lon1-post-3.mail.demon.net) (195.173.77.150) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 25 Aug 2011 13:46:23 +0000 Received: from calivar.demon.co.uk ([83.104.54.243] helo=calivar.com) by lon1-post-3.mail.demon.net with esmtp (Exim 4.69) id 1QwaGE-0004lm-dx for ecos-discuss@ecos.sourceware.org; Thu, 25 Aug 2011 13:46:22 +0000 Received: from [10.0.1.1] (daikon.calivar.com [10.0.1.1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by calivar.com (Postfix) with ESMTPS id 2003D19F78A for ; Thu, 25 Aug 2011 14:46:21 +0100 (BST) Message-ID: <4E56522D.2080807@calivar.com> Date: Thu, 25 Aug 2011 13:46:00 -0000 From: Nick Garnett User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.2.18) Gecko/20110616 SUSE/3.1.11 Thunderbird/3.1.11 MIME-Version: 1.0 To: ecos-discuss@ecos.sourceware.org References: <20110824103404.51600@gmx.net> <20110824141051.115980@gmx.net> <20110824145744.116000@gmx.net> <20110825084845.184240@gmx.net> <4E5625FC.2030803@calivar.com> <4E563C4E.2030204@gmx.ch> <4E56409E.8080605@calivar.com> <4E564562.2010209@gmx.ch> In-Reply-To: <4E564562.2010209@gmx.ch> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] ecos-3.0 current stm32 bug? X-SW-Source: 2011-08/txt/msg00060.txt.bz2 On 25/08/11 13:51, Philipp Meier wrote: > Thank's a lot. This is exactly the case! > > There has been a bug in HAL_DISABLE_INTERRUPTS (hal_intr.h) - corrected > with "changeset: 3009:9ba76199bff2" (Mercurial): Bugzilla 1001154 > > This bug "helped" as so that our bootloader was working until now. > > I validated this by "re-implementing" the disable interrupt bug on my > Linux box (just have to change the hal_intr.h file in the ecos library) > - and with this faulty version my application starts up as with the > cygwin built bootloader. > > On my Windows/Cygwin box I manually corrected this bug in the ecos > source code (at that moment I could not change to ecos-current) - but > for my bootloader I did not re-build the ecos library. And therefore my > Windows/Cygwin built bootloader still has the HAL_DISABLE_INTERRUPTS bug > which makes our code to run. > > Thank you all for your good ideas - I now know where I have to change my > implementation. Glad to hear it. While the "correct" approach is to introduce the extra startup type I mentioned earlier, you could probably make things work by enabling interrupts in your bootloader before transferring control to the application. You would need to ensure that no interrupts actually get delivered by masking any that are enabled, including the SysTick timer. Enabling interrupts sets BASEPRI to zero, which should allow the SWI to avoid the condition that caused the HardFault. [I've not thought this through in any detail, and it might not work for other reasons, but it is worth a try.] -- Nick Garnett eCos Kernel Architect eCosCentric Limited http://www.eCosCentric.com The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No: 4422071 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss