File tree Expand file tree Collapse file tree 2 files changed +32
-13
lines changed Expand file tree Collapse file tree 2 files changed +32
-13
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,10 @@ const size_t kMaxHeapSize = CONFIG_SRAM_BASE_ADDRESS + KB(CONFIG_SRAM_SIZE) - PO
5252
5353#endif
5454
55+ #ifdef CONFIG_SOC_SERIES_NRF54HX
56+ #include < hal/nrf_resetinfo.h>
57+ #endif
58+
5559namespace chip {
5660namespace DeviceLayer {
5761
@@ -60,6 +64,32 @@ namespace {
6064BootReasonType DetermineBootReason ()
6165{
6266#ifdef CONFIG_HWINFO
67+
68+ #ifdef CONFIG_SOC_SERIES_NRF54HX
69+ uint32_t reason = nrf_resetinfo_resetreas_global_get (NRF_RESETINFO);
70+
71+ if (reason & RESETINFO_RESETREAS_GLOBAL_RESETPORONLY_Msk)
72+ {
73+ return BootReasonType::kBrownOutReset ;
74+ }
75+
76+ if (reason & RESETINFO_RESETREAS_GLOBAL_DOG_Msk)
77+ {
78+ return BootReasonType::kHardwareWatchdogReset ;
79+ }
80+
81+ if ((reason & (RESETINFO_RESETREAS_GLOBAL_RESETPIN_Msk | RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk)) ==
82+ (RESETINFO_RESETREAS_GLOBAL_RESETPIN_Msk | RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk))
83+ {
84+ return BootReasonType::kPowerOnReboot ;
85+ }
86+
87+ if ((reason & (RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk | RESETINFO_RESETREAS_GLOBAL_SECSREQ_Msk)) ==
88+ (RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk | RESETINFO_RESETREAS_GLOBAL_SECSREQ_Msk))
89+ {
90+ return BootReasonType::kSoftwareUpdateCompleted ;
91+ }
92+ #else
6393 uint32_t reason;
6494
6595 if (hwinfo_get_reset_cause (&reason) != 0 )
@@ -103,6 +133,7 @@ BootReasonType DetermineBootReason()
103133#endif
104134 return BootReasonType::kSoftwareReset ;
105135 }
136+ #endif
106137#endif
107138
108139 return BootReasonType::kUnspecified ;
Original file line number Diff line number Diff line change 2828namespace chip {
2929namespace DeviceLayer {
3030
31- #if defined(CONFIG_ARCH_POSIX) || defined(CONFIG_SOC_SERIES_NRF54HX)
32-
33- void Reboot (SoftwareRebootReason reason)
34- {
35- sys_reboot (SYS_REBOOT_WARM);
36- }
37-
38- SoftwareRebootReason GetSoftwareRebootReason ()
39- {
40- return SoftwareRebootReason::kOther ;
41- }
42-
43- #else
31+ #if !(defined(CONFIG_ARCH_POSIX) || defined(CONFIG_SOC_SERIES_NRF54HX))
4432
4533using RetainedReason = decltype (nrf_power_gpregret_get(NRF_POWER, 0 ));
4634
You can’t perform that action at this time.
0 commit comments