File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -52,16 +52,48 @@ 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_RESETPORONLY_Msk)
74+ {
75+ return BootReasonType::kBrownOutReset ;
76+ }
77+
78+ if (reason & RESETINFO_RESETREAS_GLOBAL_DOG_Msk)
79+ {
80+ return BootReasonType::kHardwareWatchdogReset ;
81+ }
82+
83+ if ((reason & (RESETINFO_RESETREAS_GLOBAL_RESETPIN_Msk | RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk)) ==
84+ (RESETINFO_RESETREAS_GLOBAL_RESETPIN_Msk | RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk))
85+ {
86+ return BootReasonType::kPowerOnReboot ;
87+ }
6488
89+ if ((reason & (RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk | RESETINFO_RESETREAS_GLOBAL_SECSREQ_Msk)) ==
90+ (RESETINFO_RESETREAS_GLOBAL_RESETPOR_Msk | RESETINFO_RESETREAS_GLOBAL_SECSREQ_Msk))
91+ {
92+ return BootReasonType::kSoftwareUpdateCompleted ;
93+ }
94+ #endif
95+
96+ #ifdef CONFIG_HWINFO
6597 if (hwinfo_get_reset_cause (&reason) != 0 )
6698 {
6799 return BootReasonType::kUnspecified ;
You can’t perform that action at this time.
0 commit comments