Hi,
I am using the stack guard and need to implement a custom exception handler. Could you please push me in the right direction.
Thanks,
J
Hi,
I am using the stack guard and need to implement a custom exception handler. Could you please push me in the right direction.
Thanks,
J
Couple of useful links I noted a while back here:
Thanks, I am familiar with those links. I believe they do not cover custom handlers. HardFault_Handler() is triggered by default, which is a catch all for a variety of issues.
JZone said:HardFault_Handler() is triggered by default, which is a catch all for a variety of issues.
We have a HardFault handling library in the SDK.
To use it, add these to your projects:
$(SDK_ROOT)/components/libraries/hardfault/hardfault_implementation.c
$(SDK_ROOT)/components/libraries/hardfault/nrf52/handler/hardfault_handler_gcc.c //use the correct file depending on your toolchain
And set HARDFAULT_HANDLER_ENABLED to 1 in sdk_config.h, and optionally add DEBUG_NRF in your preprocessor definitions(adds breakpoint right before the call to HardFault_process())
The HardFault_process function is weak, and you can implement your own custom HardFault_process function in your application.
Thanks :)
Thanks :)
Hardfault only occurs after the exception you seek is not handled correctly, methinks, for example if access blocked by SD. Perhaps look at these exception modules, which might give yo whatever functionality is required:
MemoryManagement_Handler()
MWU_IRQHandler()