Skip to content

Commit ad265b1

Browse files
ananglPerMac
authored andcommitted
tests: drivers: Add MSPI driver test based on multiple SPISes
Add a test that allows verifying the functionality of an MSPI driver using multiple SPIS peripherals (one per IO line). TX transfers only for now, with a configuration using sQSPI on nRF54H20. Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 74cc2c9 commit ad265b1

File tree

6 files changed

+573
-0
lines changed

6 files changed

+573
-0
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,7 @@
858858
/tests/drivers/fprotect/ @nrfconnect/ncs-pluto
859859
/tests/drivers/lpuart/ @nordic-krch @nrfconnect/ncs-low-level-test
860860
/tests/drivers/mspi/app_fault_timer/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus
861+
/tests/drivers/mspi/mspi_with_spis/ @nrfconnect/ncs-low-level-test
861862
/tests/drivers/mspi/trap_handler/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus
862863
/tests/drivers/nrf_wifi/ @sachinthegreen @krish2718
863864
/tests/drivers/nrfx_integration_test/ @nrfconnect/ncs-co-drivers
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
9+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
10+
project(mspi_with_spis)
11+
12+
target_sources(app PRIVATE src/main.c)
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
/*
2+
* Wiring required for the test:
3+
* - P7.0 <-> P0.0
4+
* - P7.1 <-> P0.5
5+
* - P7.2 <-> P0.6
6+
* - P7.3 <-> P0.7
7+
* - P7.4 <-> P0.8
8+
* - P7.5 <-> P0.9
9+
*/
10+
11+
&pinctrl {
12+
sqspi_default: sqspi_default {
13+
group1 {
14+
psels = <NRF_PSEL(SDP_MSPI_SCK, 7, 0)>,
15+
<NRF_PSEL(SDP_MSPI_CS0, 7, 5)>,
16+
<NRF_PSEL(SDP_MSPI_DQ0, 7, 1)>;
17+
nordic,drive-mode = <NRF_DRIVE_E0E1>;
18+
};
19+
group2 {
20+
psels = <NRF_PSEL(SDP_MSPI_DQ1, 7, 2)>,
21+
<NRF_PSEL(SDP_MSPI_DQ2, 7, 3)>,
22+
<NRF_PSEL(SDP_MSPI_DQ3, 7, 4)>;
23+
nordic,drive-mode = <NRF_DRIVE_E0E1>;
24+
bias-pull-up;
25+
};
26+
};
27+
28+
sqspi_sleep: sqspi_sleep {
29+
group1 {
30+
low-power-enable;
31+
psels = <NRF_PSEL(SDP_MSPI_SCK, 7, 0)>,
32+
<NRF_PSEL(SDP_MSPI_CS0, 7, 5)>,
33+
<NRF_PSEL(SDP_MSPI_DQ0, 7, 1)>,
34+
<NRF_PSEL(SDP_MSPI_DQ1, 7, 2)>,
35+
<NRF_PSEL(SDP_MSPI_DQ2, 7, 3)>,
36+
<NRF_PSEL(SDP_MSPI_DQ3, 7, 4)>;
37+
};
38+
};
39+
40+
spis130_default_alt: spis130_default_alt {
41+
group1 {
42+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
43+
<NRF_PSEL(SPIS_MOSI, 0, 5)>,
44+
<NRF_PSEL_DISCONNECTED(SPIS_MISO)>,
45+
<NRF_PSEL(SPIS_CSN, 0, 9)>;
46+
};
47+
};
48+
49+
spis130_sleep_alt: spis130_sleep_alt {
50+
group1 {
51+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
52+
<NRF_PSEL(SPIS_MOSI, 0, 5)>,
53+
<NRF_PSEL_DISCONNECTED(SPIS_MISO)>,
54+
<NRF_PSEL(SPIS_CSN, 0, 9)>;
55+
low-power-enable;
56+
};
57+
};
58+
59+
spis131_default_alt: spis131_default_alt {
60+
group1 {
61+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
62+
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
63+
<NRF_PSEL_DISCONNECTED(SPIS_MISO)>,
64+
<NRF_PSEL(SPIS_CSN, 0, 9)>;
65+
};
66+
};
67+
68+
spis131_sleep_alt: spis131_sleep_alt {
69+
group1 {
70+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
71+
<NRF_PSEL(SPIS_MOSI, 0, 6)>,
72+
<NRF_PSEL_DISCONNECTED(SPIS_MISO)>,
73+
<NRF_PSEL(SPIS_CSN, 0, 9)>;
74+
low-power-enable;
75+
};
76+
};
77+
78+
spis132_default_alt: spis132_default_alt {
79+
group1 {
80+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
81+
<NRF_PSEL(SPIS_MOSI, 0, 7)>,
82+
<NRF_PSEL_DISCONNECTED(SPIS_MISO)>,
83+
<NRF_PSEL(SPIS_CSN, 0, 9)>;
84+
};
85+
};
86+
87+
spis132_sleep_alt: spis132_sleep_alt {
88+
group1 {
89+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
90+
<NRF_PSEL(SPIS_MOSI, 0, 7)>,
91+
<NRF_PSEL_DISCONNECTED(SPIS_MISO)>,
92+
<NRF_PSEL(SPIS_CSN, 0, 9)>;
93+
low-power-enable;
94+
};
95+
};
96+
97+
spis133_default_alt: spis133_default_alt {
98+
group1 {
99+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
100+
<NRF_PSEL(SPIS_MOSI, 0, 8)>,
101+
<NRF_PSEL_DISCONNECTED(SPIS_MISO)>,
102+
<NRF_PSEL(SPIS_CSN, 0, 9)>;
103+
};
104+
};
105+
106+
spis133_sleep_alt: spis133_sleep_alt {
107+
group1 {
108+
psels = <NRF_PSEL(SPIS_SCK, 0, 0)>,
109+
<NRF_PSEL(SPIS_MOSI, 0, 8)>,
110+
<NRF_PSEL_DISCONNECTED(SPIS_MISO)>,
111+
<NRF_PSEL(SPIS_CSN, 0, 9)>;
112+
low-power-enable;
113+
};
114+
};
115+
};
116+
117+
&cpuflpr_vpr {
118+
pinctrl-0 = <&sqspi_default>;
119+
pinctrl-1 = <&sqspi_sleep>;
120+
pinctrl-names = "default", "sleep";
121+
interrupts = <212 NRF_DEFAULT_IRQ_PRIORITY>;
122+
status = "okay";
123+
/delete-property/ execution-memory;
124+
};
125+
126+
/delete-node/ &cpuflpr_code_data;
127+
/delete-node/ &cpuapp_cpuflpr_ipc_shm;
128+
/delete-node/ &cpuflpr_cpuapp_ipc_shm;
129+
/delete-node/ &cpuapp_cpuflpr_ipc;
130+
131+
&ram21_region {
132+
status = "okay";
133+
134+
softperiph_ram: memory@0 {
135+
reg = <0 0x4000>;
136+
ranges;
137+
#address-cells = <1>;
138+
#size-cells = <1>;
139+
140+
dut: sqspi: sqspi@3e00 {
141+
compatible = "nordic,nrf-sqspi";
142+
#address-cells = <1>;
143+
#size-cells = <0>;
144+
reg = <0x3e00 0x200>;
145+
zephyr,pm-device-runtime-auto;
146+
memory-regions = <&sqspi_buffers>;
147+
};
148+
};
149+
150+
sqspi_buffers: memory@4000 {
151+
compatible = "zephyr,memory-region";
152+
reg = <0x4000 0x4000>;
153+
#memory-region-cells = <0>;
154+
zephyr,memory-region = "SQSPI_BUFFERS";
155+
zephyr,memory-attr = <DT_MEM_CACHEABLE>;
156+
};
157+
};
158+
159+
&cpuapp_dma_region {
160+
status = "okay";
161+
};
162+
163+
test_line0: &spi130 {
164+
compatible = "nordic,nrf-spis";
165+
status = "okay";
166+
def-char = <0x00>;
167+
pinctrl-0 = <&spis130_default_alt>;
168+
pinctrl-1 = <&spis130_sleep_alt>;
169+
pinctrl-names = "default", "sleep";
170+
memory-regions = <&cpuapp_dma_region>;
171+
/delete-property/rx-delay-supported;
172+
/delete-property/rx-delay;
173+
};
174+
175+
test_line1: &spi131 {
176+
compatible = "nordic,nrf-spis";
177+
status = "okay";
178+
def-char = <0x00>;
179+
pinctrl-0 = <&spis131_default_alt>;
180+
pinctrl-1 = <&spis131_sleep_alt>;
181+
pinctrl-names = "default", "sleep";
182+
memory-regions = <&cpuapp_dma_region>;
183+
/delete-property/rx-delay-supported;
184+
/delete-property/rx-delay;
185+
};
186+
187+
test_line2: &spi132 {
188+
compatible = "nordic,nrf-spis";
189+
status = "okay";
190+
def-char = <0x00>;
191+
pinctrl-0 = <&spis132_default_alt>;
192+
pinctrl-1 = <&spis132_sleep_alt>;
193+
pinctrl-names = "default", "sleep";
194+
memory-regions = <&cpuapp_dma_region>;
195+
/delete-property/rx-delay-supported;
196+
/delete-property/rx-delay;
197+
};
198+
199+
test_line3: &spi133 {
200+
compatible = "nordic,nrf-spis";
201+
status = "okay";
202+
def-char = <0x00>;
203+
pinctrl-0 = <&spis133_default_alt>;
204+
pinctrl-1 = <&spis133_sleep_alt>;
205+
pinctrl-names = "default", "sleep";
206+
memory-regions = <&cpuapp_dma_region>;
207+
/delete-property/rx-delay-supported;
208+
/delete-property/rx-delay;
209+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
CONFIG_TEST=y
8+
CONFIG_ZTEST=y
9+
CONFIG_MSPI=y
10+
CONFIG_SPI=y
11+
CONFIG_SPI_SLAVE=y
12+
CONFIG_SPI_ASYNC=y

0 commit comments

Comments
 (0)