Skip to content

Commit 1d0310b

Browse files
ppelikan-nordicrlubos
authored andcommitted
[nrf fromlist] tests: drivers: spi: enable SPI support for FLPR core
Add corresponding test overlays so that the SPI tests run correctly under Twister for the FLPR core. Signed-off-by: Paweł Pelikan <pawel.pelikan@nordicsemi.no> Upstream PR #: 109472
1 parent 662cdbd commit 1d0310b

9 files changed

Lines changed: 377 additions & 3 deletions

File tree

boards/nordic/nrf54h20dk/nrf54h20dk_nrf54h20_cpuflpr_xip_0_9_0.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ flash: 48
1313
supported:
1414
- gpio
1515
- counter
16+
- spi
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) 2026 Nordic Semiconductor ASA
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
CONFIG_GPIO_NRFX_INTERRUPT=n
7+
CONFIG_NRFX_GPIOTE=y
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/gpio/gpio.h>
8+
9+
&gpio1 {
10+
status = "okay";
11+
};
12+
13+
&gpio0 {
14+
status = "okay";
15+
};
16+
17+
&gpio6 {
18+
status = "okay";
19+
};
20+
21+
&gpio7 {
22+
status = "okay";
23+
};
24+
25+
&pinctrl {
26+
spis120_default_alt: spis120_default_alt {
27+
group1 {
28+
psels = <NRF_PSEL(SPIS_SCK, 6, 0)>,
29+
<NRF_PSEL(SPIS_MISO, 6, 3)>,
30+
<NRF_PSEL(SPIS_MOSI, 6, 4)>,
31+
<NRF_PSEL(SPIS_CSN, 6, 9)>;
32+
};
33+
};
34+
35+
spis120_sleep_alt: spis120_sleep_alt {
36+
group1 {
37+
psels = <NRF_PSEL(SPIS_SCK, 6, 0)>,
38+
<NRF_PSEL(SPIS_MISO, 6, 3)>,
39+
<NRF_PSEL(SPIS_MOSI, 6, 4)>,
40+
<NRF_PSEL(SPIS_CSN, 6, 9)>;
41+
low-power-enable;
42+
};
43+
};
44+
45+
spi120_default: spi120_default {
46+
group1 {
47+
psels = <NRF_PSEL(SPIM_MISO, 7, 6)>;
48+
};
49+
50+
group2 {
51+
psels = <NRF_PSEL(SPIM_SCK, 7, 3)>,
52+
<NRF_PSEL(SPIM_MOSI, 7, 7)>;
53+
nordic,drive-mode = <NRF_DRIVE_E0E1>;
54+
};
55+
};
56+
57+
spi120_sleep: spi120_sleep {
58+
group1 {
59+
psels = <NRF_PSEL(SPIM_SCK, 7, 3)>,
60+
<NRF_PSEL(SPIM_MISO, 7, 6)>,
61+
<NRF_PSEL(SPIM_MOSI, 7, 7)>;
62+
low-power-enable;
63+
};
64+
};
65+
};
66+
67+
&dma_fast_region {
68+
status = "okay";
69+
};
70+
71+
dut_spis: &spis120 {
72+
compatible = "nordic,nrf-spis";
73+
status = "okay";
74+
def-char = <0x00>;
75+
pinctrl-0 = <&spis120_default_alt>;
76+
pinctrl-1 = <&spis120_sleep_alt>;
77+
pinctrl-names = "default", "sleep";
78+
memory-regions = <&dma_fast_region>;
79+
};
80+
81+
&spi120 {
82+
compatible = "nordic,nrf-spim";
83+
status = "okay";
84+
pinctrl-0 = <&spi120_default>;
85+
pinctrl-1 = <&spi120_sleep>;
86+
pinctrl-names = "default", "sleep";
87+
overrun-character = <0x00>;
88+
memory-regions = <&dma_fast_region>;
89+
zephyr,pm-device-runtime-auto;
90+
cs-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
91+
92+
dut_spi_dt: test-spi-dev@0 {
93+
compatible = "vnd,spi-device";
94+
reg = <0>;
95+
spi-max-frequency = <DT_FREQ_M(8)>;
96+
};
97+
};
98+
99+
&uart120 {
100+
status = "disabled";
101+
};

tests/drivers/spi/spi_error_cases/sysbuild/vpr_launcher/boards/nrf54h20dk_nrf54h20_cpuapp.overlay

Lines changed: 109 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,121 @@
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6-
#include "../../../boards/nrf54h20dk_nrf54h20_common.dtsi"
6+
7+
&gpio1 {
8+
status = "reserved";
9+
};
10+
11+
&gpio0 {
12+
status = "reserved";
13+
};
14+
15+
&gpio6 {
16+
status = "reserved";
17+
};
18+
19+
&gpio7 {
20+
status = "reserved";
21+
};
22+
23+
&pinctrl {
24+
spi130_default_alt: spi130_default_alt {
25+
group1 {
26+
psels = <NRF_PSEL(SPIM_SCK, 0, 0)>,
27+
<NRF_PSEL(SPIM_MISO, 0, 6)>,
28+
<NRF_PSEL(SPIM_MOSI, 0, 8)>;
29+
};
30+
};
31+
32+
spi130_sleep_alt: spi130_sleep_alt {
33+
group1 {
34+
psels = <NRF_PSEL(SPIM_SCK, 0, 0)>,
35+
<NRF_PSEL(SPIM_MISO, 0, 6)>,
36+
<NRF_PSEL(SPIM_MOSI, 0, 8)>;
37+
low-power-enable;
38+
};
39+
};
40+
41+
spis131_default_alt: spis131_default_alt {
42+
group1 {
43+
psels = <NRF_PSEL(SPIS_SCK, 0, 1)>,
44+
<NRF_PSEL(SPIS_MISO, 0, 7)>,
45+
<NRF_PSEL(SPIS_MOSI, 0, 9)>,
46+
<NRF_PSEL(SPIS_CSN, 0, 11)>;
47+
};
48+
};
49+
50+
spis131_sleep_alt: spis131_sleep_alt {
51+
group1 {
52+
psels = <NRF_PSEL(SPIS_SCK, 0, 1)>,
53+
<NRF_PSEL(SPIS_MISO, 0, 7)>,
54+
<NRF_PSEL(SPIS_MOSI, 0, 9)>,
55+
<NRF_PSEL(SPIS_CSN, 0, 11)>;
56+
low-power-enable;
57+
};
58+
};
59+
60+
spis120_default_alt: spis120_default_alt {
61+
group1 {
62+
psels = <NRF_PSEL(SPIS_SCK, 6, 0)>,
63+
<NRF_PSEL(SPIS_MISO, 6, 3)>,
64+
<NRF_PSEL(SPIS_MOSI, 6, 4)>,
65+
<NRF_PSEL(SPIS_CSN, 6, 9)>;
66+
};
67+
};
68+
69+
spis120_sleep_alt: spis120_sleep_alt {
70+
group1 {
71+
psels = <NRF_PSEL(SPIS_SCK, 6, 0)>,
72+
<NRF_PSEL(SPIS_MISO, 6, 3)>,
73+
<NRF_PSEL(SPIS_MOSI, 6, 4)>,
74+
<NRF_PSEL(SPIS_CSN, 6, 9)>;
75+
low-power-enable;
76+
};
77+
};
78+
79+
spi120_default: spi120_default {
80+
group1 {
81+
psels = <NRF_PSEL(SPIM_MISO, 7, 6)>;
82+
};
83+
84+
group2 {
85+
psels = <NRF_PSEL(SPIM_SCK, 7, 3)>,
86+
<NRF_PSEL(SPIM_MOSI, 7, 7)>;
87+
nordic,drive-mode = <NRF_DRIVE_E0E1>;
88+
};
89+
};
90+
91+
spi120_sleep: spi120_sleep {
92+
group1 {
93+
psels = <NRF_PSEL(SPIM_SCK, 7, 3)>,
94+
<NRF_PSEL(SPIM_MISO, 7, 6)>,
95+
<NRF_PSEL(SPIM_MOSI, 7, 7)>;
96+
low-power-enable;
97+
};
98+
};
99+
};
7100

8101
&spi130 {
9102
status = "reserved";
103+
pinctrl-0 = <&spi130_default_alt>;
104+
pinctrl-1 = <&spi130_sleep_alt>;
105+
pinctrl-names = "default", "sleep";
10106
interrupt-parent = <&cpuppr_clic>;
11107
};
12108

13-
&dut_spis {
109+
&spi131 {
14110
status = "reserved";
111+
pinctrl-0 = <&spis131_default_alt>;
112+
pinctrl-1 = <&spis131_sleep_alt>;
113+
pinctrl-names = "default", "sleep";
15114
interrupt-parent = <&cpuppr_clic>;
16115
};
116+
117+
&spis120 {
118+
status = "reserved";
119+
pinctrl-0 = <&spis120_default_alt>;
120+
pinctrl-1 = <&spis120_sleep_alt>;
121+
pinctrl-names = "default", "sleep";
122+
interrupt-parent = <&cpuflpr_clic>;
123+
};

tests/drivers/spi/spi_error_cases/testcase.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ tests:
1414
- nrf5340dk/nrf5340/cpuapp
1515
- nrf54h20dk/nrf54h20/cpuapp
1616
- nrf54h20dk/nrf54h20/cpuppr
17+
- nrf54h20dk/nrf54h20/cpuflpr/xip
1718
- nrf54h20dk/nrf54h20/cpurad
1819
- nrf54l15dk/nrf54l15/cpuapp
1920
- nrf54lm20dk/nrf54lm20a/cpuapp
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2026 Nordic Semiconductor ASA
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
CONFIG_SPI_IDEAL_TRANSFER_DURATION_SCALING=15
7+
8+
# nRF54H20 FLPR has no GPIO interrupts available
9+
CONFIG_GPIO_NRFX_INTERRUPT=n
10+
CONFIG_NRFX_GPIOTE=y
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/gpio/gpio.h>
8+
9+
&cpuflpr_code_partition {
10+
reg = <0xf4000 DT_SIZE_K(64)>;
11+
};
12+
13+
&gpio1 {
14+
status = "okay";
15+
};
16+
17+
&pinctrl {
18+
spi120_default: spi120_default {
19+
group1 {
20+
psels = <NRF_PSEL(SPIM_MISO, 7, 6)>;
21+
};
22+
23+
group2 {
24+
psels = <NRF_PSEL(SPIM_SCK, 7, 3)>,
25+
<NRF_PSEL(SPIM_MOSI, 7, 7)>;
26+
nordic,drive-mode = <NRF_DRIVE_E0E1>;
27+
};
28+
};
29+
30+
spi120_sleep: spi120_sleep {
31+
group1 {
32+
psels = <NRF_PSEL(SPIM_SCK, 7, 3)>,
33+
<NRF_PSEL(SPIM_MISO, 7, 6)>,
34+
<NRF_PSEL(SPIM_MOSI, 7, 7)>;
35+
low-power-enable;
36+
};
37+
};
38+
};
39+
40+
&gpio7 {
41+
status = "okay";
42+
};
43+
44+
&dma_fast_region {
45+
status = "okay";
46+
};
47+
48+
&spi120 {
49+
status = "okay";
50+
pinctrl-0 = <&spi120_default>;
51+
pinctrl-1 = <&spi120_sleep>;
52+
pinctrl-names = "default", "sleep";
53+
overrun-character = <0x00>;
54+
memory-regions = <&dma_fast_region>;
55+
zephyr,pm-device-runtime-auto;
56+
57+
slow@1 {
58+
compatible = "test-spi-loopback-slow";
59+
reg = <1>;
60+
spi-max-frequency = <DT_FREQ_M(4)>;
61+
};
62+
63+
dut_fast: fast@0 {
64+
compatible = "test-spi-loopback-fast";
65+
reg = <0>;
66+
spi-max-frequency = <DT_FREQ_M(8)>;
67+
};
68+
};
69+
70+
&uart120 {
71+
status = "disabled";
72+
};

0 commit comments

Comments
 (0)