This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPM with custom k_sys_fatal_error_handler

In our NRF9160 application, we do not have a UART available and have to implement other means of logging crashes.

We have written our own k_sys_fatal_error_handler but it seems that it is not called upon a null pointer dereference. Instead the implementation from fatal_error.c in the NRF SDK was called.

After adding

CONFIG_RESET_ON_FATAL_ERROR=n

to spm.conf, the weakly referenced standard implementation of k_sys_fatal_error_handler in fatal.c was used.

How can we make sure that our error handler is called upon a secure fault exception?

Best Regards

Martin

Parents Reply
  • Since we don't have a UART in the field, we need another method of tracking crashes. So we want to write debug information in a noinit section of RAM, check this information after reset and upload the crash log using the LTE modem.

    The linked PR is no help since it only modifies the SPM error handler. What we need to do is to replace or at least extend the error handler in a way that integrates well with your framework. We need some kind of hook in SPM's error handler. Like Zephyr's k_sys_fatal_error_handler is supposed to be.

Children
Related