Skip to content

Commit 2ca7c35

Browse files
committed
samples: zephyr: boards: nordic: add system_off sample for l09
Based on zephyr one. Signed-off-by: Piotr Kosycarz <[email protected]>
1 parent f1abae1 commit 2ca7c35

File tree

9 files changed

+138
-0
lines changed

9 files changed

+138
-0
lines changed

.github/test-spec.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,7 @@
623623
- "subsys/event_manager_proxy/**/*"
624624
- "samples/zephyr/drivers/audio/**/*"
625625
- "samples/zephyr/drivers/i2c/**/*"
626+
- "samples/zephyr/boards/nordic/**/*"
626627
- "samples/ipc/**/*"
627628
- "samples/event_manager_proxy/**/*"
628629
- "samples/peripheral/lpuart/**/*"

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@
665665
/samples/wifi/provisioning/softap/*.rst @nrfconnect/ncs-cia-doc
666666
/samples/zigbee/**/*.rst @nrfconnect/ncs-terahertz-doc
667667
/samples/zephyr/basic/blinky/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus
668+
/samples/zephyr/boards/nordic/system_off/ @nrfconnect/ncs-low-level-test
668669
/samples/zephyr/drivers/audio/dmic/ @nrfconnect/ncs-low-level-test
669670
/samples/zephyr/drivers/i2c/rtio_loopback/ @nrfconnect/ncs-low-level-test
670671
/samples/zephyr/sensor/accel_polling/ @nrfconnect/ncs-low-level-test
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
9+
project(nrf_system_off)
10+
11+
target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/boards/nordic/system_off/src/main.c)
12+
if(CONFIG_APP_USE_RETAINED_MEM)
13+
target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/boards/nordic/system_off/src/retained.c)
14+
endif()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source "samples/boards/nordic/system_off/Kconfig"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This sample extends the same-named Zephyr sample to verify it
2+
with Nordic development kits.
3+
4+
Source code and basic configuration files can be found in the corresponding folder structure in zephyr/samples/boards/nordic/system_off.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/ {
2+
cpuapp_sram@20023000 {
3+
compatible = "zephyr,memory-region", "mmio-sram";
4+
reg = <20023000 DT_SIZE_K(4)>;
5+
zephyr,memory-region = "RetainedMem";
6+
status = "okay";
7+
8+
retainedmem0: retainedmem {
9+
compatible = "zephyr,retained-ram";
10+
status = "okay";
11+
};
12+
};
13+
14+
aliases {
15+
retainedmemdevice = &retainedmem0;
16+
};
17+
};
18+
19+
&cpuapp_sram {
20+
/* Shrink SRAM size to avoid overlap with retained memory region:
21+
* 144 - 4 = 140 = 0x23000
22+
*/
23+
reg = <0x20000000 DT_SIZE_K(140)>;
24+
ranges = <0x0 0x20000000 0x23000>;
25+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CONFIG_PM_DEVICE=y
2+
CONFIG_GPIO=y
3+
CONFIG_CRC=y
4+
CONFIG_POWEROFF=y
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
sample:
2+
name: Low Power State Sample for nRF5x
3+
common:
4+
tags:
5+
- power
6+
- ci_samples_zephyr_boards_nordic_system_off
7+
timeout: 20
8+
tests:
9+
nrf.extended.sample.boards.nrf.system_off:
10+
integration_platforms:
11+
- nrf54l09pdk/nrf54l09/cpuapp
12+
platform_allow:
13+
- nrf54l09pdk/nrf54l09/cpuapp
14+
harness: console
15+
harness_config:
16+
type: multi_line
17+
ordered: true
18+
regex:
19+
- "system off demo"
20+
- "Retained data not supported"
21+
- "Entering system off; press sw0 to restart"
22+
nrf.extended.sample.boards.nrf.system_off.retained_mem:
23+
integration_platforms:
24+
- nrf54l09pdk/nrf54l09/cpuapp
25+
platform_allow:
26+
- nrf54l09pdk/nrf54l09/cpuapp
27+
extra_configs:
28+
- CONFIG_APP_USE_RETAINED_MEM=y
29+
harness: console
30+
harness_config:
31+
type: multi_line
32+
ordered: true
33+
regex:
34+
- "system off demo"
35+
- "Retained data: INVALID"
36+
- "Boot count: 1"
37+
- "Off count: 0"
38+
- "Active Ticks:"
39+
- "Entering system off; press sw0 to restart"
40+
nrf.extended.sample.boards.nrf.system_off.grtc_wakeup:
41+
platform_allow:
42+
- nrf54l09pdk/nrf54l09/cpuapp
43+
extra_configs:
44+
- CONFIG_GRTC_WAKEUP_ENABLE=y
45+
- CONFIG_GPIO_WAKEUP_ENABLE=n
46+
harness: console
47+
harness_config:
48+
type: multi_line
49+
ordered: true
50+
regex:
51+
- "system off demo"
52+
- "Retained data not supported"
53+
- "Entering system off; wait 2 seconds to restart"
54+
- "system off demo"
55+
- "Retained data not supported"
56+
- "Entering system off; wait 2 seconds to restart"
57+
- "system off demo"
58+
- "Retained data not supported"
59+
- "Entering system off; wait 2 seconds to restart"
60+
nrf.extended.sample.boards.nrf.system_off.retained_mem.grtc_wakeup:
61+
platform_allow:
62+
- nrf54l09pdk/nrf54l09/cpuapp
63+
extra_configs:
64+
- CONFIG_APP_USE_RETAINED_MEM=y
65+
- CONFIG_GRTC_WAKEUP_ENABLE=y
66+
- CONFIG_GPIO_WAKEUP_ENABLE=n
67+
harness: console
68+
harness_config:
69+
type: multi_line
70+
ordered: true
71+
regex:
72+
- "system off demo"
73+
- "Retained data: INVALID"
74+
- "Boot count: 1"
75+
- "Off count: 0"
76+
- "Active Ticks:"
77+
- "Entering system off; wait 2 seconds to restart"
78+
- "system off demo"
79+
- "Retained data: valid"
80+
- "Boot count: 2"
81+
- "Off count: 1"
82+
- "Active Ticks:"
83+
- "Entering system off; wait 2 seconds to restart"

scripts/ci/tags.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,3 +1562,8 @@ ci_samples_zephyr_drivers_i2c:
15621562
files:
15631563
- nrf/samples/zephyr/drivers/i2c/
15641564
- zephyr/samples/drivers/i2c/
1565+
1566+
ci_samples_zephyr_boards_nordic_system_off:
1567+
files:
1568+
- nrf/samples/zephyr/boards/nordic/system_off/
1569+
- zephyr/samples/boards/nordic/system_off/

0 commit comments

Comments
 (0)