EmbeddedRelated.com
Forums

ISP access after watchdog timeout

Started by afolly_mil2 June 13, 2010
Hello,

I have wondered whether it is :

* a bug,

* a feature, or

* incompetence in my reading of the manual

that is the cause of my odd observations....

The picture:

I have a custom LPC1765 board which runs lots of stuff successfully. (A cr_startup_lpc17.c file from Code Red Tech is used). I have a jumper on pin 2.10 so that I can program it using its ISP feature. It works.

Even when the user program is executing, if I ground pin 2.10 and apply a low to the reset pin, I go into ISP mode.

Occasionally I need to reset the processor from within the program, and I use the watchdog timout to do this. It works, and the user program starts up again as expected.

Now, from THIS running state (with a history of a watchdog reset), I cannot get into ISP mode without a power-down cycle. Keeping pin 2.10 low while I apply a low to the reset input pin produces a restart into user code (via the built-in bootloader?), but not into ISP mode.

It isn't of crucial importance to me to get an answer to this, but I do lose a little sleep wondering, just wondering, whether...

Any hints/comments/opinions/brickbats?

:-)

Ahmad

An Engineer's Guide to the LPC2100 Series

I had the same issue on the LPC2138. For that chip, clearing the WDTOF flag would allow ISP mode to work again. Perhaps that "feature" is still present... For what it's worth, I never found that in the documentation. I believe the solution was posted on this group a long time ago.
Marshall

Hi:

From the LPC17XX User Manual Rev 01.00 January 4, 2010, Chapters 32, Section 3 (page 612):

"If P2.10 is sampled low and the watchdog overflow flag is set, the external hardware request to start the ISP command handler is ignored."

Regards,

Alex

--- In l..., "afolly_mil2" wrote:
>
> Hello,
>
> I have wondered whether it is :
>
> * a bug,
>
> * a feature, or
>
> * incompetence in my reading of the manual
>
> that is the cause of my odd observations....
>
> The picture:
>
> I have a custom LPC1765 board which runs lots of stuff successfully. (A cr_startup_lpc17.c file from Code Red Tech is used). I have a jumper on pin 2.10 so that I can program it using its ISP feature. It works.
>
> Even when the user program is executing, if I ground pin 2.10 and apply a low to the reset pin, I go into ISP mode.
>
> Occasionally I need to reset the processor from within the program, and I use the watchdog timout to do this. It works, and the user program starts up again as expected.
>
> Now, from THIS running state (with a history of a watchdog reset), I cannot get into ISP mode without a power-down cycle. Keeping pin 2.10 low while I apply a low to the reset input pin produces a restart into user code (via the built-in bootloader?), but not into ISP mode.
>
> It isn't of crucial importance to me to get an answer to this, but I do lose a little sleep wondering, just wondering, whether...
>
> Any hints/comments/opinions/brickbats?
>
> :-)
>
> Ahmad
>

Hi,

The Boot process flowchart (Chapter 32: LPC17xx Flash memory interface and programming)also shows the WDTOF check and the resulting action...

Ken

--- In l..., "alexander_ribero" wrote:
>
> Hi:
>
> From the LPC17XX User Manual Rev 01.00 January 4, 2010, Chapters 32, Section 3 (page 612):
>
> "If P2.10 is sampled low and the watchdog overflow flag is set, the external hardware request to start the ISP command handler is ignored."
>
> Regards,
>
> Alex
>
> --- In l..., "afolly_mil2" wrote:
> >
> > Hello,
> >
> > I have wondered whether it is :
> >
> > * a bug,
> >
> > * a feature, or
> >
> > * incompetence in my reading of the manual
> >
> > that is the cause of my odd observations....
> >
> > The picture:
> >
> > I have a custom LPC1765 board which runs lots of stuff successfully. (A cr_startup_lpc17.c file from Code Red Tech is used). I have a jumper on pin 2.10 so that I can program it using its ISP feature. It works.
> >
> > Even when the user program is executing, if I ground pin 2.10 and apply a low to the reset pin, I go into ISP mode.
> >
> > Occasionally I need to reset the processor from within the program, and I use the watchdog timout to do this. It works, and the user program starts up again as expected.
> >
> > Now, from THIS running state (with a history of a watchdog reset), I cannot get into ISP mode without a power-down cycle. Keeping pin 2.10 low while I apply a low to the reset input pin produces a restart into user code (via the built-in bootloader?), but not into ISP mode.
> >
> > It isn't of crucial importance to me to get an answer to this, but I do lose a little sleep wondering, just wondering, whether...
> >
> > Any hints/comments/opinions/brickbats?
> >
> > :-)
> >
> > Ahmad
>

Hi Marshall, Alex, Ken,

Absolutely right on! This has been valuable input, and clearing the WDTOF
"fixed" it right away. Thanks very much!

So it did turn out that my parsing of the documents had been at fault. I
knew my hair was going gray, but not quite how deep the malaise had
penetrated.

Hmmm... maybe I should retire soon...

Till then, Cheers!

Ahmad

On Mon, Jun 14, 2010 at 8:34 PM, Kenneth wrote:

> Hi,
>
> The Boot process flowchart (Chapter 32: LPC17xx Flash memory interface and
> programming)also shows the WDTOF check and the resulting action...
>
> Ken
> --- In l... ,
> "alexander_ribero" wrote:
> >
> > Hi:
> >
> > From the LPC17XX User Manual Rev 01.00 January 4, 2010, Chapters 32,
> Section 3 (page 612):
> >
> > "If P2.10 is sampled low and the watchdog overflow flag is set, the
> external hardware request to start the ISP command handler is ignored."
> >
> > Regards,
> >
> > Alex
> >
> >
> >
> > --- In l... ,
> "afolly_mil2" wrote:
> > >
> > > Hello,
> > >
> > > I have wondered whether it is :
> > >
> > > * a bug,
> > >
> > > * a feature, or
> > >
> > > * incompetence in my reading of the manual
> > >
> > > that is the cause of my odd observations....
> > >
> > > The picture:
> > >
> > > I have a custom LPC1765 board which runs lots of stuff successfully. (A
> cr_startup_lpc17.c file from Code Red Tech is used). I have a jumper on pin
> 2.10 so that I can program it using its ISP feature. It works.
> > >
> > > Even when the user program is executing, if I ground pin 2.10 and apply
> a low to the reset pin, I go into ISP mode.
> > >
> > > Occasionally I need to reset the processor from within the program, and
> I use the watchdog timout to do this. It works, and the user program starts
> up again as expected.
> > >
> > > Now, from THIS running state (with a history of a watchdog reset), I
> cannot get into ISP mode without a power-down cycle. Keeping pin 2.10 low
> while I apply a low to the reset input pin produces a restart into user code
> (via the built-in bootloader?), but not into ISP mode.
> > >
> > > It isn't of crucial importance to me to get an answer to this, but I do
> lose a little sleep wondering, just wondering, whether...
> > >
> > > Any hints/comments/opinions/brickbats?
> > >
> > > :-)
> > >
> > > Ahmad
> > >
> >
>