Skip to content

Commit b680017

Browse files
nordic-pikrnordic-piks
authored andcommitted
NRFX-7142: Add current measurement on spis wakeup sample
Add alt-config to spis wakeup sample which enable current measurement test Signed-off-by: Piotr Krzyzanowski <[email protected]>
1 parent 66cc61d commit b680017

File tree

11 files changed

+252
-0
lines changed

11 files changed

+252
-0
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@
671671
/samples/wifi/**/*.rst @nrfconnect/ncs-wifi-doc
672672
/samples/wifi/provisioning/softap/*.rst @nrfconnect/ncs-cia-doc
673673
/samples/zephyr/basic/blinky/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus
674+
/samples/zephyr/boards/nordic/spis_wakeup/ @nrfconnect/ncs-low-level-test
674675
/samples/zephyr/boards/nordic/system_off/ @nrfconnect/ncs-low-level-test
675676
/samples/zephyr/drivers/adc/ @nrfconnect/ncs-low-level-test
676677
/samples/zephyr/drivers/counter/ @nrfconnect/ncs-low-level-test
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
#
5+
6+
cmake_minimum_required(VERSION 3.20.0)
7+
8+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
9+
10+
if(NOT SYSBUILD)
11+
message(FATAL_ERROR
12+
" This is a multi-image application that should be built using sysbuild.\n"
13+
" Add --sysbuild argument to west build command to prepare all the images.")
14+
endif()
15+
16+
project(spis_wakeup)
17+
18+
FILE(GLOB app_sources ${ZEPHYR_BASE}/samples/boards/nordic/spis_wakeup/src/*.c)
19+
target_sources(app PRIVATE ${app_sources})
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/spis_wakeup.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
aliases {
9+
led = &led0;
10+
spis = &spi130;
11+
/delete-property/ led1;
12+
/delete-property/ sw0;
13+
/delete-property/ sw1;
14+
/delete-property/ sw2;
15+
/delete-property/ sw3;
16+
};
17+
/delete-node/ buttons;
18+
};
19+
20+
/delete-node/ &led1;
21+
22+
&exmif {
23+
status = "disabled";
24+
};
25+
26+
&gpiote130 {
27+
status = "okay";
28+
owned-channels = <0>;
29+
};
30+
31+
&pinctrl {
32+
spi130_default_alt: spi130_default_alt {
33+
group1 {
34+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
35+
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
36+
<NRF_PSEL(SPIS_MISO, 0, 8)>,
37+
<NRF_PSEL(SPIS_CSN, 0, 10)>;
38+
};
39+
};
40+
41+
spi130_sleep_alt: spi130_sleep_alt {
42+
group1 {
43+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
44+
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
45+
<NRF_PSEL(SPIS_MISO, 0, 8)>,
46+
<NRF_PSEL(SPIS_CSN, 0, 10)>;
47+
low-power-enable;
48+
};
49+
};
50+
};
51+
52+
&spi130 {
53+
compatible = "nordic,nrf-spis";
54+
status = "okay";
55+
def-char = <0x00>;
56+
pinctrl-0 = <&spi130_default_alt>;
57+
pinctrl-1 = <&spi130_sleep_alt>;
58+
pinctrl-names = "default", "sleep";
59+
wake-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
60+
memory-regions = <&cpuapp_dma_region>;
61+
/delete-property/rx-delay-supported;
62+
/delete-property/rx-delay;
63+
};
64+
65+
&uart136 {
66+
zephyr,pm-device-runtime-auto;
67+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CONFIG_SPI=y
2+
CONFIG_SPI_SLAVE=y
3+
CONFIG_GPIO=y
4+
5+
CONFIG_PM=y
6+
CONFIG_PM_S2RAM=y
7+
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
8+
CONFIG_PM_DEVICE=y
9+
CONFIG_PM_DEVICE_RUNTIME=y
10+
11+
CONFIG_ASSERT=y
12+
13+
CONFIG_PRINTK=n
14+
CONFIG_LOG=n
15+
CONFIG_CONSOLE=n
16+
CONFIG_UART_CONSOLE=n
17+
CONFIG_SERIAL=n
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
common:
2+
sysbuild: true
3+
depends_on: spi
4+
5+
sample:
6+
name: SPI wakeup sample
7+
tests:
8+
nrf.extended.sample.drivers.spis.wakeup:
9+
tags:
10+
- ci_samples_zephyr_boards_nordic_spis_wakeup
11+
- spi
12+
- ppk_power_measure
13+
platform_allow:
14+
- nrf54h20dk/nrf54h20/cpuapp
15+
integration_platforms:
16+
- nrf54h20dk/nrf54h20/cpuapp
17+
harness: pytest
18+
harness_config:
19+
fixture: spi_loopback
20+
pytest_root:
21+
- "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_spis_wakeup"
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+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
#
5+
6+
if(SB_CONFIG_SOC_NRF54H20)
7+
# Add remote project
8+
ExternalZephyrProject_Add(
9+
APPLICATION wakeup_trigger
10+
SOURCE_DIR ${APP_DIR}/wakeup_trigger
11+
BOARD ${SB_CONFIG_BOARD}/${SB_CONFIG_SOC}/cpurad
12+
BOARD_REVISION ${BOARD_REVISION}
13+
)
14+
endif()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
#
5+
6+
cmake_minimum_required(VERSION 3.20.0)
7+
8+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
9+
10+
project(wakeup_trigger)
11+
12+
FILE(GLOB app_sources ${ZEPHYR_BASE}/samples/boards/nordic/spis_wakeup/wakeup_trigger/src/*.c)
13+
target_sources(app PRIVATE ${app_sources})
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
aliases {
9+
led = &led1;
10+
};
11+
12+
leds {
13+
compatible = "gpio-leds";
14+
led1: led_1 {
15+
gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>;
16+
label = "Green LED 1";
17+
};
18+
};
19+
};
20+
21+
&gpiote130 {
22+
status = "okay";
23+
owned-channels = <1>;
24+
};
25+
26+
&gpio0 {
27+
status = "okay";
28+
};
29+
30+
&gpio9 {
31+
status = "okay";
32+
};
33+
34+
&pinctrl {
35+
spi131_default_alt: spi131_default_alt {
36+
group1 {
37+
psels = <NRF_PSEL(SPIM_SCK, 0, 1)>,
38+
<NRF_PSEL(SPIM_MOSI, 0, 7)>,
39+
<NRF_PSEL(SPIM_MISO, 0, 9)>;
40+
};
41+
};
42+
43+
spi131_sleep_alt: spi131_sleep_alt {
44+
group1 {
45+
psels = <NRF_PSEL(SPIM_SCK, 0, 1)>,
46+
<NRF_PSEL(SPIM_MOSI, 0, 7)>,
47+
<NRF_PSEL(SPIM_MISO, 0, 9)>;
48+
low-power-enable;
49+
};
50+
};
51+
};
52+
53+
&spi131 {
54+
compatible = "nordic,nrf-spim";
55+
status = "okay";
56+
pinctrl-0 = <&spi131_default_alt>;
57+
pinctrl-1 = <&spi131_sleep_alt>;
58+
pinctrl-names = "default", "sleep";
59+
overrun-character = <0x00>;
60+
cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
61+
wake-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
62+
zephyr,pm-device-runtime-auto;
63+
memory-regions = <&cpurad_dma_region>;
64+
spim_dt: spi-device@0 {
65+
compatible = "vnd,spi-device";
66+
reg = <0>;
67+
spi-max-frequency = <DT_FREQ_M(8)>;
68+
};
69+
};
70+
71+
&uart135 {
72+
zephyr,pm-device-runtime-auto;
73+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CONFIG_SPI=y
2+
CONFIG_SPI_NRFX_WAKE_TIMEOUT_US=500
3+
CONFIG_GPIO=y
4+
5+
CONFIG_PM=y
6+
CONFIG_PM_S2RAM=y
7+
CONFIG_PM_S2RAM_CUSTOM_MARKING=y
8+
CONFIG_PM_DEVICE=y
9+
CONFIG_PM_DEVICE_RUNTIME=y
10+
11+
CONFIG_ASSERT=y
12+
13+
CONFIG_PRINTK=n
14+
CONFIG_LOG=n
15+
CONFIG_CONSOLE=n
16+
CONFIG_UART_CONSOLE=n
17+
CONFIG_SERIAL=n

0 commit comments

Comments
 (0)