EmbeddedRelated.com
Forums

External watchdog and flash loader

Started by lhaddix October 17, 2005
Hi,
I'm working on an LPC2138 design and just moved
into ESD testing. After some ESD hits there was
no damage, but the processor would be left not
running.

Implementing the internal watchdog didn't fix this.

Apparently there are ways to nail a 2138 with ESD
that must stop the processor clock and thus also
prevent the internal watchdog from working.

My solution is an external supervisor chip with a
watchdog function that I would keep strobed with
some line from the micro.

I know this will work because when an ESD hit 'stuns'
the LPC2138 I can restart it by toggling reset.

The problem is I want to use the internal flash loader
to do the factory program load for my board.

The flash loader will not keep my external watchdog strobed
and will not be able to avoid a reset as a result. So the
external watchdog will keep it from working.

Question: Does the phillips flash loader toggle and pin
regularly that I could use for this strobe?

Can I hook it somehow to make it pet the dog?

Any ideas?

Landrum



An Engineer's Guide to the LPC2100 Series

Hello,

bad foul!!! I think there is no software solution (except hacking the
philips bootloader). You could insert a single gate (NAND) into the
/reset signal that disables /reset (=1) while P0.14 (for entering
bootloader programming mode) is low during programming.

Sten

--- In lpc2000@lpc2..., "lhaddix" <lhaddix@i...> wrote:
>
> Hi,
> I'm working on an LPC2138 design and just moved
> into ESD testing. After some ESD hits there was
> no damage, but the processor would be left not
> running.
>
> Implementing the internal watchdog didn't fix this.
>
> Apparently there are ways to nail a 2138 with ESD
> that must stop the processor clock and thus also
> prevent the internal watchdog from working.
>
> My solution is an external supervisor chip with a
> watchdog function that I would keep strobed with
> some line from the micro.
>
> I know this will work because when an ESD hit 'stuns'
> the LPC2138 I can restart it by toggling reset.
>
> The problem is I want to use the internal flash loader
> to do the factory program load for my board.
>
> The flash loader will not keep my external watchdog strobed
> and will not be able to avoid a reset as a result. So the
> external watchdog will keep it from working.
>
> Question: Does the phillips flash loader toggle and pin
> regularly that I could use for this strobe?
>
> Can I hook it somehow to make it pet the dog?
>
> Any ideas?
>
> Landrum
>




IIRC some external watchdog timer chips force a reset on timeout only
if their input pin is held high or low for too long a period. If the
pin is left floating, the watchdog function is disabled. See the TI
TPS382x family info (SLVA039 section 10). The boot loader most likely
leaves unused GPIO pins unconfigured so they should be in their
default mode as inputs. If that case the floating connection to the
watchdog chip should disable the timed reset function.

Good luck
-Bill Knight
R O SoftWare &
http://www.theARMPatch.com On Mon, 17 Oct 2005 12:17:58 -0000, bdmlpc wrote:

>Hello,

>bad foul!!! I think there is no software solution (except hacking the
>philips bootloader). You could insert a single gate (NAND) into the
>/reset signal that disables /reset (=1) while P0.14 (for entering
>bootloader programming mode) is low during programming.

> Sten

>--- In lpc2000@lpc2..., "lhaddix" <lhaddix@i...> wrote:
>>
>> Hi,
>> I'm working on an LPC2138 design and just moved
>> into ESD testing. After some ESD hits there was
>> no damage, but the processor would be left not
>> running.
>>
>> Implementing the internal watchdog didn't fix this.
>>
>> Apparently there are ways to nail a 2138 with ESD
>> that must stop the processor clock and thus also
>> prevent the internal watchdog from working.
>>
>> My solution is an external supervisor chip with a
>> watchdog function that I would keep strobed with
>> some line from the micro.
>>
>> I know this will work because when an ESD hit 'stuns'
>> the LPC2138 I can restart it by toggling reset.
>>
>> The problem is I want to use the internal flash loader
>> to do the factory program load for my board.
>>
>> The flash loader will not keep my external watchdog strobed
>> and will not be able to avoid a reset as a result. So the
>> external watchdog will keep it from working.
>>
>> Question: Does the phillips flash loader toggle and pin
>> regularly that I could use for this strobe?
>>
>> Can I hook it somehow to make it pet the dog?
>>
>> Any ideas?
>>
>> Landrum
>>

>
>Yahoo! Groups Links
>




Ok, there is a software solution... ;-)

Sten

--- In lpc2000@lpc2..., "Bill Knight" <BillK@t...> wrote:
>
> IIRC some external watchdog timer chips force a reset on timeout only
> if their input pin is held high or low for too long a period. If the
> pin is left floating, the watchdog function is disabled. See the TI
> TPS382x family info (SLVA039 section 10). The boot loader most likely
> leaves unused GPIO pins unconfigured so they should be in their
> default mode as inputs. If that case the floating connection to the
> watchdog chip should disable the timed reset function.
>
> Good luck
> -Bill Knight
> R O SoftWare &
> http://www.theARMPatch.com > On Mon, 17 Oct 2005 12:17:58 -0000, bdmlpc wrote:
>
> >Hello,
>
> >bad foul!!! I think there is no software solution (except hacking the
> >philips bootloader). You could insert a single gate (NAND) into the
> >/reset signal that disables /reset (=1) while P0.14 (for entering
> >bootloader programming mode) is low during programming.
>
> > Sten
>
> >--- In lpc2000@lpc2..., "lhaddix" <lhaddix@i...> wrote:
> >>
> >> Hi,
> >> I'm working on an LPC2138 design and just moved
> >> into ESD testing. After some ESD hits there was
> >> no damage, but the processor would be left not
> >> running.
> >>
> >> Implementing the internal watchdog didn't fix this.
> >>
> >> Apparently there are ways to nail a 2138 with ESD
> >> that must stop the processor clock and thus also
> >> prevent the internal watchdog from working.
> >>
> >> My solution is an external supervisor chip with a
> >> watchdog function that I would keep strobed with
> >> some line from the micro.
> >>
> >> I know this will work because when an ESD hit 'stuns'
> >> the LPC2138 I can restart it by toggling reset.
> >>
> >> The problem is I want to use the internal flash loader
> >> to do the factory program load for my board.
> >>
> >> The flash loader will not keep my external watchdog strobed
> >> and will not be able to avoid a reset as a result. So the
> >> external watchdog will keep it from working.
> >>
> >> Question: Does the phillips flash loader toggle and pin
> >> regularly that I could use for this strobe?
> >>
> >> Can I hook it somehow to make it pet the dog?
> >>
> >> Any ideas?
> >>
> >> Landrum
> > >
>
> >
> >Yahoo! Groups Links >
> >
>




Did anyone else experience the same problem (the LPC2138 stops running and
the wachdog doesnt restart it) ? ----- Original Message -----
From: "lhaddix" <lhaddix@lhad...>
To: <lpc2000@lpc2...>
Sent: Monday, October 17, 2005 8:27 AM
Subject: [lpc2000] External watchdog and flash loader > Hi,
> I'm working on an LPC2138 design and just moved
> into ESD testing. After some ESD hits there was
> no damage, but the processor would be left not
> running.
>
> Implementing the internal watchdog didn't fix this.
>
> Apparently there are ways to nail a 2138 with ESD
> that must stop the processor clock and thus also
> prevent the internal watchdog from working.
>
> My solution is an external supervisor chip with a
> watchdog function that I would keep strobed with
> some line from the micro.
>
> I know this will work because when an ESD hit 'stuns'
> the LPC2138 I can restart it by toggling reset.
>
> The problem is I want to use the internal flash loader
> to do the factory program load for my board.
>
> The flash loader will not keep my external watchdog strobed
> and will not be able to avoid a reset as a result. So the
> external watchdog will keep it from working.
>
> Question: Does the phillips flash loader toggle and pin
> regularly that I could use for this strobe?
>
> Can I hook it somehow to make it pet the dog?
>
> Any ideas?
>
> Landrum >
>
> Yahoo! Groups Links > Esta mensagem foi verificada pelo E-mail Protegido Terra.
> Scan engine: McAfee VirusScan / Atualizado em 14/10/2005 / Vers:
> 4.4.00/4605
> Proteja o seu e-mail Terra: http://mail.terra.com.br/
>




Yes, with a LPC2124 we had some similar problems in a design.

Marcio Zaquela wrote:
> Did anyone else experience the same problem (the LPC2138 stops running and
> the wachdog doesnt restart it) ? > ----- Original Message -----
> From: "lhaddix" <lhaddix@lhad...>
> To: <lpc2000@lpc2...>
> Sent: Monday, October 17, 2005 8:27 AM
> Subject: [lpc2000] External watchdog and flash loader >
>>Hi,
>>I'm working on an LPC2138 design and just moved
>>into ESD testing. After some ESD hits there was
>>no damage, but the processor would be left not
>>running.
>>
>>Implementing the internal watchdog didn't fix this.
>>
>>Apparently there are ways to nail a 2138 with ESD
>>that must stop the processor clock and thus also
>>prevent the internal watchdog from working.
>>
>>My solution is an external supervisor chip with a
>>watchdog function that I would keep strobed with
>>some line from the micro.
>>
>>I know this will work because when an ESD hit 'stuns'
>>the LPC2138 I can restart it by toggling reset.
>>
>>The problem is I want to use the internal flash loader
>>to do the factory program load for my board.
>>
>>The flash loader will not keep my external watchdog strobed
>>and will not be able to avoid a reset as a result. So the
>>external watchdog will keep it from working.
>>
>>Question: Does the phillips flash loader toggle and pin
>>regularly that I could use for this strobe?
>>
>>Can I hook it somehow to make it pet the dog?
>>
>>Any ideas?
>>
>>Landrum
>>


--
/************************************************
Do you need a tiny and efficient real time
operating system (RTOS) with a preemtive
multitasking for LPC2000 or AT91SAM7?

http://nanortos.net-attack.de/

Or some open-source tools and code for LPC2000?

http://www.net-attack.de/

************************************************/



Sten,
What do you mean 'bad foul!!!' my design or this situation?

I think I will add circuitry to inhibit the external watchdog
when P0.14 is low. I also want to inhibit the external watchdog
when my 20pin JTAG is in use.

What can I sense to tell if the JTAG port is connected to an
emulator?

I thought about counting on one of it's many grounds
pulling a pin low, but would rather use something that didn't
depend on certain grounds being connected inside the emulator
pod.

I guess as Marcio points out the larger issue is why are there
situations where the internal watchdog can't reset the micro.
Unfortunately this is probably a feature of the LPC design.

Microchip uses an internal RC for thier watchdog which is not
dependant of the system clock for instance.

I think what happens is it's possible for an ESD hit to stop
the crystal osc on the LPC such that reset is needed to restart
the oscillator, but there can be no watchdog reset without a system
clock.

I've considered using an external osc to feed the ARM, but don't
wish to do this. I can't be sure it would fix the problem without
mocking it up and then blasting with the static gun, but I know that
toggling reset from outside will restart the clock.

Landrum --- In lpc2000@lpc2..., Sten <list@n...> wrote:
>
> Yes, with a LPC2124 we had some similar problems in a design.
>
> Marcio Zaquela wrote:
> > Did anyone else experience the same problem (the LPC2138 stops
running and
> > the wachdog doesnt restart it) ?
> >
> >
> > ----- Original Message -----
> > From: "lhaddix" <lhaddix@i...>
> > To: <lpc2000@lpc2...>
> > Sent: Monday, October 17, 2005 8:27 AM
> > Subject: [lpc2000] External watchdog and flash loader
> >
> >
> >
> >>Hi,
> >>I'm working on an LPC2138 design and just moved
> >>into ESD testing. After some ESD hits there was
> >>no damage, but the processor would be left not
> >>running.
> >>
> >>Implementing the internal watchdog didn't fix this.
> >>
> >>Apparently there are ways to nail a 2138 with ESD
> >>that must stop the processor clock and thus also
> >>prevent the internal watchdog from working.
> >>
> >>My solution is an external supervisor chip with a
> >>watchdog function that I would keep strobed with
> >>some line from the micro.
> >>
> >>I know this will work because when an ESD hit 'stuns'
> >>the LPC2138 I can restart it by toggling reset.
> >>
> >>The problem is I want to use the internal flash loader
> >>to do the factory program load for my board.
> >>
> >>The flash loader will not keep my external watchdog strobed
> >>and will not be able to avoid a reset as a result. So the
> >>external watchdog will keep it from working.
> >>
> >>Question: Does the phillips flash loader toggle and pin
> >>regularly that I could use for this strobe?
> >>
> >>Can I hook it somehow to make it pet the dog?
> >>
> >>Any ideas?
> >>
> >>Landrum
> > > --
> /************************************************
> Do you need a tiny and efficient real time
> operating system (RTOS) with a preemtive
> multitasking for LPC2000 or AT91SAM7?
>
> http://nanortos.net-attack.de/
>
> Or some open-source tools and code for LPC2000?
>
> http://www.net-attack.de/
>
> ************************************************/
>




At 06:29 PM 10/17/05 +0000, lhaddix wrote:
>I think I will add circuitry to inhibit the external watchdog
>when P0.14 is low. I also want to inhibit the external watchdog
>when my 20pin JTAG is in use.
>
>What can I sense to tell if the JTAG port is connected to an
>emulator?
>
>I thought about counting on one of it's many grounds
>pulling a pin low, but would rather use something that didn't
>depend on certain grounds being connected inside the emulator
>pod.

What about using the pin that enables JTAG in the same manner as you are
planning on using P0.14? That doesn't detect the cable presence but it
does detect JTAG on (so to speak) It would fail if the cable was present
and JTAG not enabled but then JTAG won't work in that case anyway ....

Robert

" 'Freedom' has no meaning of itself. There are always restrictions, be
they legal, genetic, or physical. If you don't believe me, try to chew a
radio signal. " -- Kelvin Throop, III
http://www.aeolusdevelopment.com/


One thing which will kill your internal Watchdog is writing a large
value to the WDTC register. While the WDMOD register is write-
protected, this register is not.

Also, even though WDMOD is protected from writes by the core, could
static possibly change the setting of one of its bits?

Also, is it possible that static could cause a Reset, and then crash
the processor before the code has a chance to set the WDEN bit?
--- In lpc2000@lpc2..., "lhaddix" <lhaddix@i...> wrote:
>
> I guess as Marcio points out the larger issue is why are there
> situations where the internal watchdog can't reset the micro.
> Unfortunately this is probably a feature of the LPC design.
>
> Microchip uses an internal RC for thier watchdog which is not
> dependant of the system clock for instance.
>
> I think what happens is it's possible for an ESD hit to stop
> the crystal osc on the LPC such that reset is needed to restart
> the oscillator, but there can be no watchdog reset without a system
> clock.
>
> I've considered using an external osc to feed the ARM, but don't
> wish to do this. I can't be sure it would fix the problem without
> mocking it up and then blasting with the static gun, but I know that
> toggling reset from outside will restart the clock.
>
> Landrum
>




lhaddix wrote:
> Sten,
> What do you mean 'bad foul!!!' my design or this situation?
The situation of course! This is like building a house without a door. ;-)

>
> I think I will add circuitry to inhibit the external watchdog
> when P0.14 is low. I also want to inhibit the external watchdog
> when my 20pin JTAG is in use.
>
> What can I sense to tell if the JTAG port is connected to an
> emulator?

Roberts idea with the JTAG-Enable pin (RTCK) is quite good. If you
pull-up this pin (e.g. LPC2138) JTAG is enabled. If this pin is
unconnected (or pulled-low) JTAG will be disabled.

>
> I thought about counting on one of it's many grounds
> pulling a pin low, but would rather use something that didn't
> depend on certain grounds being connected inside the emulator
> pod.
Mmmmh...

>
> I guess as Marcio points out the larger issue is why are there
> situations where the internal watchdog can't reset the micro.
> Unfortunately this is probably a feature of the LPC design.
>
> Microchip uses an internal RC for thier watchdog which is not
> dependant of the system clock for instance.
>
> I think what happens is it's possible for an ESD hit to stop
> the crystal osc on the LPC such that reset is needed to restart
> the oscillator, but there can be no watchdog reset without a system
> clock.
>
> I've considered using an external osc to feed the ARM, but don't
> wish to do this. I can't be sure it would fix the problem without
> mocking it up and then blasting with the static gun, but I know that
> toggling reset from outside will restart the clock.
>
> Landrum
>

I had some similar problems with a LPC2124 last year. During ESD test
the LPC stops with and without internal watchdog. But we had another
(bigger) MCU on our board which was able to turn off/turn on the LPC if
it didn't response to hello-request packet in such a case.

Sten
--
/************************************************
Do you need a tiny and efficient real time
operating system (RTOS) with a preemtive
multitasking for LPC2000 or AT91SAM7?

http://nanortos.net-attack.de/

Or some open-source tools and code for LPC2000?

http://www.net-attack.de/

************************************************/