Skip to content

system/nxinit: map the power-off soft reset reason - #3966

Open
JianyuWang0623 wants to merge 1 commit into
apache:masterfrom
JianyuWang0623:nxinit-boot-reason-poweroff
Open

JianyuWang0623 wants to merge 1 commit into
apache:masterfrom
JianyuWang0623:nxinit-boot-reason-poweroff

Conversation

@JianyuWang0623

@JianyuWang0623 JianyuWang0623 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adapt resetflag[] in init_boot_reason() to the BOARDIOC_SOFTRESETCAUSE_POWEROFF and _MAX subreasons added by apache/nuttx#21386, mapping POWEROFF to "shutdown" and MAX to "unknown".

Impact

Builds with CONFIG_SYSTEM_NXINIT and CONFIG_BOARDCTL_RESET_CAUSE now report sys.boot.reason=shutdown for a power-off soft reset and unknown for an out-of-range subreason; all other builds are unaffected.

Testing

  • Build Host: Ubuntu 22.04.5 LTS, Linux 6.8.0-138-generic x86_64, host cc 13.4.0 (CROSSDEV empty);

Adapt resetflag[] to the BOARDIOC_SOFTRESETCAUSE_POWEROFF and _MAX
subreasons added by apache/nuttx#21386: map POWEROFF to "shutdown",
and MAX to "unknown" for out-of-range subreasons.

Assisted-by: OpenCode:claude-opus-4.8 OpenCode:mimo-v2.6-pro
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
@JianyuWang0623
JianyuWang0623 marked this pull request as ready for review November 4, 2026 07:39
Comment thread system/nxinit/init.c
[BOARDIOC_SOFTRESETCAUSE_RESTORE_FACTORY_INQUIRY] =
"factory_reset_inquiry",
[BOARDIOC_SOFTRESETCAUSE_THERMAL] = "thermal",
[BOARDIOC_SOFTRESETCAUSE_POWEROFF] = "shutdown",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation/applications/system/nxinit/index.rst:168 in nuttx lists the soft-reset strings for sys.boot.reason and does not have shutdown or unknown.

Fix: add both to that list in a nuttx PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@casaroli Thanks, the doc update is in apache/nuttx#21483

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants