stuck in ResetHandler when activating Independant Watchdog

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

stuck in ResetHandler when activating Independant Watchdog

Post by alex31 »

Hi,

When i enable Independant Watchdog via IWDG_Enable(),
if there is watchdog reset because of watchdog timer reaching 0,
reset occurs fine.

but if for some reasons, i fall in _unhandled_exception, the mcu remains stuck in
ResetHandler () at ../../ChibiOS/os/ports/GCC/ARMCMx/crt0.c:267

NRST pin has no more action, and only way to restart mcu is to unplug/plug it.

that does not occurs if IWDG is not activated, in this case, when in _unhandled_exception
if i use NRST pin, ResetHandler is called and it call main and mcu restart without the need
to unplug/plug it.

Is there a way to use Independant Watchdog without this behaviour ?

Alexandre
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: stuck in ResetHandler when activating Independant Watchd

Post by Giovanni »

It is the normal behavior, if the CPU goes in unhandled exceptions the watchdog triggers a reset after a while, the system restarts and then it goes in exception again and again.

You must remove the cause of the exception. If the exception is "normal" for you then you may redefine _unhandled_exception in your code (it is a weak symbol) and reset the WDG inside there.

Giovanni
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

Re: stuck in ResetHandler when activating Independant Watchd

Post by alex31 »

Solved

It was entirely my fault, there was fault condition in the branch of the code executed only when
recovering from watchdog reset.

sorry for disturbing.

Alexandre
Post Reply