-
Notifications
You must be signed in to change notification settings - Fork 8k
drivers: hwinfo: native: report reset cause #95603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: hwinfo: native: report reset cause #95603
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question out of curiosity, are you doing this change because you have a need for it? or just because you thought it may be nice for somebody to have it?
Requested changes:
-
Let's also add a test for this (I just added one here, you are more than welcome to take it):
aescolar@688ca66 -
Note a few requests for changes below.
And a general comment which does not need any action, but just a remark:
Right now, this HW_info peripheral can be built for any posix arch based target, but the reboot logic is optional and only for the native_sim target.
This means this hw_info reset cause code will only do what is expected in the native_sim case when CONFIG_NATIVE_SIM_REBOOT is enabled.
Note, in tree, we only have the native_sim and nrfbsim targets. And the nrfbsim targets are likely to have the real nrf hw info driver enabled at some point.
This is not a problem beyond being potentially confusing for users.
scripts/native_simulator/common/src/include/nsi_host_trampolines.h
Outdated
Show resolved
Hide resolved
CC @koalatux |
Align with native_simulator's upstream main 4eab13716376e63236d77013f996a897d24dd780 Which includes: 4eab137 Host trampolines: Add getenv/setenv Signed-off-by: Tim Pambor <[email protected]>
Support reporting the reset cause for native_sim. The default is to report POR (Power-On Reset). If CONFIG_NATIVE_SIM_REBOOT was enabled and the system is rebooted using sys_reboot(), the reset cause is set to SOFTWARE. Signed-off-by: Tim Pambor <[email protected]>
25ddcc9
to
0bbab08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to have hwinfo in native_sim!
Thanks!
Add a test of the CONFIG_NATIVE_SIM_REBOOT functionality together with the hw_info get_reset_cause() logic. Signed-off-by: Alberto Escolar Piedras <[email protected]>
0bbab08
to
ce03563
Compare
|
@aescolar Thanks for the review and the test case. I included it in this PR. I also incorporated your requested changes and rebased on main. |
This PR adds support for reporting the reset cause to native_sim.
The default is to report POR (Power-On Reset).
If the system is rebooted using
sys_reboot()
, the reset cause is set to SOFTWARE.