Repository navigation
system/nxinit: map the power-off soft reset reason - #3966
Open
JianyuWang0623 wants to merge 1 commit into
Open
JianyuWang0623 wants to merge 1 commit into
JianyuWang0623 wants to merge 1 commit into
Conversation
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
marked this pull request as ready for review
November 4, 2026 07:39
xiaoxiang781216
approved these changes
Nov 4, 2026
xiaoxiang781216
approved these changes
Nov 4, 2026
casaroli
reviewed
Nov 4, 2026
| [BOARDIOC_SOFTRESETCAUSE_RESTORE_FACTORY_INQUIRY] = | ||
| "factory_reset_inquiry", | ||
| [BOARDIOC_SOFTRESETCAUSE_THERMAL] = "thermal", | ||
| [BOARDIOC_SOFTRESETCAUSE_POWEROFF] = "shutdown", |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
@casaroli Thanks, the doc update is in apache/nuttx#21483
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adapt
resetflag[]ininit_boot_reason()to theBOARDIOC_SOFTRESETCAUSE_POWEROFFand_MAXsubreasons added by apache/nuttx#21386, mappingPOWEROFFto"shutdown"andMAXto"unknown".Impact
Builds with
CONFIG_SYSTEM_NXINITandCONFIG_BOARDCTL_RESET_CAUSEnow reportsys.boot.reason=shutdownfor a power-off soft reset andunknownfor an out-of-range subreason; all other builds are unaffected.Testing
cc13.4.0 (CROSSDEVempty);