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.
value 'n'. Check these unsatisfied dependencies: (!TRUSTED_EXECUTION_NONSECURE).
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.
Hello,
I believe you can read out the value of the RESETREAS register to get the reset reason.
Hi,
I've read that as well, but was hoping for a more Zephyr-ish approach.
MaLu said:I've read that as well, but was hoping for a more Zephyr-ish approach.
I'm not sure what you mean by this, but if you don't want to read the register directly you can use the nrf power library function
nrf_power_resetreas_get(NRF_POWER_NS);
MaLu said:I've read that as well, but was hoping for a more Zephyr-ish approach.
I'm not sure what you mean by this, but if you don't want to read the register directly you can use the nrf power library function
nrf_power_resetreas_get(NRF_POWER_NS);
Thank you.
This is already much better, than just reading out the register.
I am sorry, that I'm not explaining myself very well.
When I say Zephyr-ish approach, I mean, that I want to be as Hardware-agnostic in my code as possible. With nrf_power_resetreas_get(NRF_POWER_NS) and espeacially with just reading from the register, I am dependent on the Hardware. So far I have managed to only use very high level functions with my code and was hoping to also be able to do this for the reset cause. That's why I was hoping to make hwinfo_get_reset_cause() work, since it is not nrf specific and would only use the underlying nrf driver.
I have noticed, that there is hwinfo_nrf stuff (hwinfo_nrf.c), but I cannot figure out, how to get the hwinfo wrapper to use that driver in my constellation.
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.
Thank you very much for researching this, it is much appreciated!