File tree Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -52,16 +52,53 @@ 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
5862namespace {
5963
6064BootReasonType DetermineBootReason ()
6165{
62- #ifdef CONFIG_HWINFO
66+ #if defined(CONFIG_SOC_SERIES_NRF54HX) || defined( CONFIG_HWINFO)
6367 uint32_t reason;
68+ #endif
69+
70+ #ifdef CONFIG_SOC_SERIES_NRF54HX
71+ reason = nrf_resetinfo_resetreas_global_get (NRF_RESETINFO);
72+
73+ if (reason == RESETINFO_RESETREAS_GLOBAL_ResetValue)
74+ {
75+ return BootReasonType::kSoftwareReset ;
76+ }
77+
78+ if (reason & RESETINFO_RESETREAS_GLOBAL_RESETPORONLY_Msk)
79+ {
80+ return BootReasonType::kBrownOutReset ;
81+ }
6482
83+ if (reason & RESETINFO_RESETREAS_GLOBAL_DOG_Msk)
84+ {
85+ return BootReasonType::kHardwareWatchdogReset ;
86+ }
87+
88+ if ((reason & (RESETINFO_RESETREAS_GLOBAL_RESETPIN_Msk | RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk)) ==
89+ (RESETINFO_RESETREAS_GLOBAL_RESETPIN_Msk | RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk))
90+ {
91+ return BootReasonType::kPowerOnReboot ;
92+ }
93+
94+ if ((reason & (RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk | RESETINFO_RESETREAS_GLOBAL_SECSREQ_Msk)) ==
95+ (RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk | RESETINFO_RESETREAS_GLOBAL_SECSREQ_Msk))
96+ {
97+ return BootReasonType::kSoftwareUpdateCompleted ;
98+ }
99+ #endif
100+
101+ #ifdef CONFIG_HWINFO
65102 if (hwinfo_get_reset_cause (&reason) != 0 )
66103 {
67104 return BootReasonType::kUnspecified ;
You can’t perform that action at this time.
0 commit comments