EmbeddedRelated.com
Forums

lpc 2214 data ram corruption when return from watchdog

Started by Alberto Ferrari November 16, 2009
Hi everyboby,
I'm working with lpc2214 and I've got a problem coming back from watchdog: the ram location 0x40000128 is corrupted (ie its value is changed).
Does someone have the same problem?
Do you know some fix or workaround?
Thanks

Alberto

An Engineer's Guide to the LPC2100 Series

Hi Alberto,

--- In l..., "Alberto Ferrari" wrote:
>
> Hi everyboby,
> I'm working with lpc2214 and I've got a problem coming back from watchdog: the ram location 0x40000128 is corrupted (ie its value is changed).
> Does someone have the same problem?
> Do you know some fix or workaround?
> Thanks
>
> Alberto
>

The boot code is doing this. It copies the word at address 0x1FC (CRP) from flash into this RAM location. I don't know the reason for it, but I do know that you cannot avoid it.
Make sure not to use the word at 0x40000128 for static data.

Regards,
Rolf

--- In l..., "rolf_meeser" wrote:
>
> Hi Alberto,
>
> --- In l..., "Alberto Ferrari" wrote:
> >
> > Hi everyboby,
> > I'm working with lpc2214 and I've got a problem coming back from watchdog: the ram location 0x40000128 is corrupted (ie its value is changed).
> > Does someone have the same problem?
> > Do you know some fix or workaround?
> > Thanks
> >
> > Alberto
>
Seems like a pretty neat way to know that the watchdog reset the CPU. The user code should probably zero out 0x40000128 and look for a matching value after the next reset. Just looking for non-zero wouldn't be adequate. Random contents would very likely be non-zero.

Assuming, of course, that the startup code looks before it clears memory.

Richard

> The boot code is doing this. It copies the word at address 0x1FC (CRP) from flash into this RAM location. I don't know the reason for it, but I do know that you cannot avoid it.
> Make sure not to use the word at 0x40000128 for static data.
>
> Regards,
> Rolf
>

Hi everyboby,
>I'm working with lpc2214 and I've got a problem coming back from watchdog: the ram location 0x40000128 is corrupted (ie its value is changed).
>Does someone have the same problem?
>Do you know some fix or workaround?
>Thanks
>
>Alberto
>
Rolf,
thanks very much for your help! It has been very useful for me. Thanks.

Richard,
in order to check if the cpu is coming from watchdog, you have to check the register 0xE0000000 (WDMOD), bit 2 (WDTOF).

Alberto