Skip to content

Commit 43ac874

Browse files
committed
tests: boards: nrf: hwinfo: Add latest reset causes
Reset cause API was expanded with two more reset causes. These are RESET_BOOTLOADER and RESET_FLASH. Add handling of RESET_BOOTLOADER and RESET_FLASH to reset_cause test. Signed-off-by: Sebastian Głąb <[email protected]>
1 parent 9c5325d commit 43ac874

File tree

1 file changed

+16
-0
lines changed
  • tests/boards/nrf/hwinfo/reset_cause/src

1 file changed

+16
-0
lines changed

tests/boards/nrf/hwinfo/reset_cause/src/main.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ static void print_supported_reset_cause(void)
134134
} else {
135135
LOG_INF("14: no support for RESET_TEMPERATURE");
136136
}
137+
if (supported & RESET_BOOTLOADER) {
138+
LOG_INF("15: RESET_BOOTLOADER is supported");
139+
} else {
140+
LOG_INF("15: no support for RESET_BOOTLOADER");
141+
}
142+
if (supported & RESET_FLASH) {
143+
LOG_INF("16: RESET_FLASH is supported");
144+
} else {
145+
LOG_INF("16: no support for RESET_FLASH");
146+
}
137147
} else if (ret == -ENOSYS) {
138148
LOG_INF("hwinfo_get_supported_reset_cause() is NOT supported");
139149
supported = 0;
@@ -197,6 +207,12 @@ static void print_current_reset_cause(uint32_t *cause)
197207
if (*cause & RESET_TEMPERATURE) {
198208
LOG_INF("14: reset due to RESET_TEMPERATURE");
199209
}
210+
if (*cause & RESET_BOOTLOADER) {
211+
LOG_INF("15: reset due to RESET_BOOTLOADER");
212+
}
213+
if (*cause & RESET_FLASH) {
214+
LOG_INF("16: reset due to RESET_FLASH");
215+
}
200216
} else if (ret == -ENOSYS) {
201217
LOG_INF("hwinfo_get_reset_cause() is NOT supported");
202218
*cause = 0;

0 commit comments

Comments
 (0)