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
…f54h20

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 Dec 18, 2024
1 parent 9edbdaf commit d65eae9
Show file tree
Hide file tree
Showing 9 changed files with 451 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";
};
6 changes: 6 additions & 0 deletions tests/drivers/hwinfo/reset_cause/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CONFIG_HWINFO=y

CONFIG_WATCHDOG=y

CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
Loading

0 comments on commit d65eae9

Please sign in to comment.