* Re: [ECOS] LPC2XXX watchdog feeds and interrupts
@ 2009-10-26 20:40 Sergei Gavrikov
2009-10-26 21:05 ` Laurie Gellatly
0 siblings, 1 reply; 4+ messages in thread
From: Sergei Gavrikov @ 2009-10-26 20:40 UTC (permalink / raw)
To: Laurie Gellatly; +Cc: 'eCos discuss-list'
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ECOS] LPC2XXX watchdog feeds and interrupts
2009-10-26 20:40 [ECOS] LPC2XXX watchdog feeds and interrupts Sergei Gavrikov
@ 2009-10-26 21:05 ` Laurie Gellatly
2009-10-26 21:34 ` Sergei Gavrikov
0 siblings, 1 reply; 4+ messages in thread
From: Laurie Gellatly @ 2009-10-26 21:05 UTC (permalink / raw)
To: Sergei Gavrikov; +Cc: eCos discuss-list
Hi Sergei,
Two things. It should not be an option as when the feed sequence is
eventually interrupted and the processor is reset it can be VERY time
consuming to track down. I know from bitter experience.
The other is I was not sure about which interrupt disable/enable
function pairs to use. Is HAL_DISABLE_INTERRUPTS preferred over
cyg_disable_interrupts?
We need ALL interrupts off during the feed.
...Laurie:{)
+61 416 114419
On 27/10/2009, at 7:40 AM, Sergei Gavrikov <sergei.gavrikov@gmail.com>
wrote:
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [ECOS] LPC2XXX watchdog feeds and interrupts
2009-10-26 21:05 ` Laurie Gellatly
@ 2009-10-26 21:34 ` Sergei Gavrikov
0 siblings, 0 replies; 4+ messages in thread
From: Sergei Gavrikov @ 2009-10-26 21:34 UTC (permalink / raw)
To: Laurie Gellatly; +Cc: eCos discuss-list
On Tue, Oct 27, 2009 at 08:03:55AM +1100, Laurie Gellatly wrote:
> Hi Sergei,
> Two things. It should not be an option as when the feed sequence is
> eventually interrupted and the processor is reset it can be VERY
> time consuming to track down. I know from bitter experience. The
> other is I was not sure about which interrupt disable/enable
> function pairs to use. Is HAL_DISABLE_INTERRUPTS preferred over
> cyg_disable_interrupts? We need ALL interrupts off during the feed.
Or cyg_scheduler_{,un}lock() then, but, that is kernel depended.
Perhaps, you are right, IMO, eCos kernel hackers can say the last
words :-) I just wanted to have an optional fix via CDL.
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [ECOS] LPC2XXX watchdog feeds and interrupts
2009-10-25 13:20 ` Sergei Gavrikov
@ 2009-10-26 9:58 ` Laurie Gellatly
0 siblings, 0 replies; 4+ messages in thread
From: Laurie Gellatly @ 2009-10-26 9:58 UTC (permalink / raw)
To: 'eCos discuss-list'
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:{)
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-10-26 21:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-26 20:40 [ECOS] LPC2XXX watchdog feeds and interrupts Sergei Gavrikov
2009-10-26 21:05 ` Laurie Gellatly
2009-10-26 21:34 ` Sergei Gavrikov
-- strict thread matches above, loose matches on Subject: below --
2009-10-19 9:32 [ECOS] RedBoot image for Olimex LPC-E2294 peter_lanius
2009-10-19 10:42 ` Sergei Gavrikov
2009-10-19 11:42 ` peter_lanius
2009-10-19 13:47 ` Sergei Gavrikov
2009-10-24 9:37 ` [ECOS] RedBoot loading eCOS examples causes PC reboot peter_lanius
2009-10-24 12:38 ` Sergei Gavrikov
[not found] ` <738229.12555.qm@web51906.mail.re2.yahoo.com>
2009-10-25 13:20 ` Sergei Gavrikov
2009-10-26 9:58 ` [ECOS] LPC2XXX watchdog feeds and interrupts Laurie Gellatly
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).