Recover from Hardware Fault without soft reset

My hardware runs for months and then takes a hardware fault. Externally resetting the hardware and everything runs fine. I don’t believe there was a true Hardware Fault but the exception was called. Since the hardware is located remotely I need a way to restart or re-enter the OS without issuing a soft reset as that clears the external state of some devices that need to be left in their states. I am running a SAM4E and FreeRTOS version 9.0.0

Is it not possible to write a handler for that fault and do a software reset when it happens?

The SAME4 also has a watchdog timer

Are you saying that within the handler I can’t call rstc_start_software_reset(RSTC); What I want is a way to reenter the OS without resetting all of the outputs of the micro.

As Cobus mentioned you could write your own (hard fault) exception handler which might be a redirection the Reset_Handler to restart just the application without MCU/HW reset. Usually you can simply override the ‘weak’ exception handlers with the Reset_Handler symbol.

1 Like