Skip to content

Commit

Permalink
[nrf fromlist] tests: drivers: hwinfo: Add test for reset cause on nr…
Browse files Browse the repository at this point in the history
…f54*

Add test that checks reset cause reported by HWINFO.

Check that hwinfo_get_supported_reset_cause() returns
expected value.

Check that hwinfo_get_reset_cause() correctly detects:
- RESET_PIN,
- RESET_SOFTWARE,
- RESET_WATCHDOG.

Check that reset cause can be cleared
with hwinfo_clear_reset_cause().

Upstream PR #: 83126

Signed-off-by: Sebastian Głąb <[email protected]>
  • Loading branch information
nordic-segl committed Jan 8, 2025
1 parent 9761d26 commit 4e34cbd
Show file tree
Hide file tree
Showing 10 changed files with 456 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/drivers/hwinfo/reset_cause/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(reset_reason)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Disable dcache
CONFIG_DCACHE=n
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright 2024 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
watchdog0 = &wdt010;
};
};

&wdt010 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Disable dcache
CONFIG_DCACHE=n
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright 2024 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
watchdog0 = &wdt010;
};
};

&wdt010 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

&wdt31 {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

&wdt31 {
status = "okay";
};
7 changes: 7 additions & 0 deletions tests/drivers/hwinfo/reset_cause/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONFIG_HWINFO=y

CONFIG_WATCHDOG=y
CONFIG_REBOOT=y

CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
Loading

0 comments on commit 4e34cbd

Please sign in to comment.