From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24098 invoked by alias); 26 Oct 2009 20:40:57 -0000 Received: (qmail 24090 invoked by uid 22791); 26 Oct 2009 20:40:56 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,FAKE_REPLY_C,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-bw0-f211.google.com (HELO mail-bw0-f211.google.com) (209.85.218.211) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Oct 2009 20:40:49 +0000 Received: by bwz3 with SMTP id 3so2854352bwz.36 for ; Mon, 26 Oct 2009 13:40:46 -0700 (PDT) Received: by 10.204.141.18 with SMTP id k18mr3836121bku.139.1256589646444; Mon, 26 Oct 2009 13:40:46 -0700 (PDT) Received: from localhost ([93.85.201.1]) by mx.google.com with ESMTPS id 16sm861037bwz.3.2009.10.26.13.40.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Oct 2009 13:40:43 -0700 (PDT) Date: Mon, 26 Oct 2009 20:40:00 -0000 From: Sergei Gavrikov To: Laurie Gellatly Cc: 'eCos discuss-list' Message-ID: <20091026203636.GA10662@sg-laptop> Mail-Followup-To: Laurie Gellatly , 'eCos discuss-list' MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes 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] LPC2XXX watchdog feeds and interrupts X-SW-Source: 2009-10/txt/msg00161.txt.bz2 On Mon, Oct 26, 2009 at 08:58:19PM +1100, Laurie Gellatly wrote: > Hi All, I using an ARM 7 (LPC2212) based on an eCosCentric build. It > appears that watchdog feeds are done with interrupts enabled yet the > NXP manual warns against leaving interrupts enabled during a feed > sequence (and I'm pretty sure I've seen the consequences). Firstly, > have I missed something? Are interrupts disabled and I just don't > see where when I call watchdog_reset() OR should I be adding > cyg_interrupt_disable() and cyg_interrupt_enable() calls around the > feed sequence in watchdog_lpc2xxx.cxx > > Thanks ...Laurie:{) Hello Laurie, I found no any global interrupt disabling/enabling workaround for eCos io/watchdog *::reset. More that the most targets as I could see have a peace with CPU's watchdog with a single atomic write, but NXP and some other targets claim two writes (!atomic operation): devs/watchdog/* Well, NXP points on such a claim, for example, in this application note http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/an10414.pdf and in their other data sheets. Well, may be that is rare condition: to break two sequenced writes, but safety is safety :-) Could you provide a patch for the issue, please`? IMO, you would add some CDL in devs/watchdog/arm/lpc2xxx/*/*, e.g. CYGOPT_DEVICES_WATCHDOG_ARM_LPC2XXX_RESET_SAFE to wrap that reset, well, to add something likes the below int old; HAL_DISABLE_INTERRUPTS( old ); /* Feed magic values to reset the watchdog. */ /* ... */ HAL_RESTORE_INTERRUPTS( old ); But, as I could understand, you pointed on eCosCentric build. HTH Sergei -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss