How do I get the reset cause with nRF Connect SDK?

Hi,

I am using an nRF9160/nRFConnect SDK 1.8.0/VSCode and my application uses MCUBoot and SPM. It is a "non secure" application.

I am trying to get a reset cause. 

hwinfo_get_reset_cause() just leads to a weak function that always returns -ENOSYS (= -1).
In my prj.conf I have enabled CONFIG_HWINFO=y, for this purpose. 
CONFIG_HWINFO_NRF=y outputs this warning: HWINFO_NRF (defined at drivers/hwinfo/Kconfig:31) was assigned the value 'y' but got the
value 'n'. Check these unsatisfied dependencies: (!TRUSTED_EXECUTION_NONSECURE).
 
I am kind of new to this whole secure/non-secure thing, so I am probably missing something fundamentally in this regard, so help to get the reset cause would be appreciated.
Thanks!
Parents Reply
  • The hwinfo driver you are referring to is most likely outdated, as it is reading the register from the secure domain. The driver does not have a non-secure implementation as far as I can tell.

    It calls nrf_power_resetreas_get() with the argument NRF_POWER instead of NRF_POWER_NS;

    nrf_power_resetreas_get(NRF_POWER);

    If you want something "hardware-agnostic", my suggestion is you register a feature request in the Zephyr project.

Children
Related