Watchdog (Reset) on M5223X / M5213

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Watchdog (Reset) on M5223X / M5213

3,255 Views
mjbcswitzerland
Specialist V

Hi All

 

I would like to know a little more about the software watchdog in the above processors - this is taking on from the previous (but now quite old) posting http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&message.id=776&query.id=13063#M7...

 

The present understanding is that it is not possible to program the core software watchdog in these devices to cause a reset in order to recover from a problem (software runaway). It is necessary to activate the corresponding interrupt routine and to command a soft reset from it.

 

I have just programmed this and also set the priority of this interrupt as the highest in the system.

 

There remains one question. What happens when a problem exists in a section of code which disables all interrupts? Wouldn't it mean that the core sw watchdog timer will timeout but its interrupt never handled? Is this not quite a risk??

 

Any ideas?

 

Regards

 

Mark Butcher
www.mjbc.ch / www.uTasker.com

Labels (1)
0 Kudos
4 Replies

442 Views
Nouchi
Senior Contributor II
Hi,

Unfortunatly, you can only do a soft Reset (MCF_CIM_RCR_SOFTRST), and I if you program is blocked in a critical section, the cpu core will never be reinitialized and the program is definitely deadlocked, so you have to avoid loops in critical regions.


Emmanuel,

0 Kudos

441 Views
jvantol
Contributor I
If you have the option, an external watchdog, or watchdog/voltage regulator IC can be a great solution to this problem. Depending on your requirements for the power supply, this can be close to cost neutral.
0 Kudos

442 Views
Petter_fupp
Contributor I
Why not use level 7 for the watchdog interrupt? It should be non-maskable.
0 Kudos

441 Views
mjbcswitzerland
Specialist V
Hi Petter

You are correct, the Interrupt level 7 assigned to an interrupt gives it NMI qualities and so this is a solution which has been adopted in the meantime.

There is still a small risk involved since if the interrupt vector is in SRAM and this gets corrupted by a runaway program the NMI interrupt will fire but fail itself - so there is still no 100% secure method of recovering from a fatal program error through a reset. i.e. if the runaway program writes something to the watchdog interrupt vector it will result in the board hanging forever with no automatic reset recovery (apart from when an external supervisor is utilised...)

Regards

Mark

www.uTasker.com

0 Kudos