Skip to content

Commit f47f3fe

Browse files
nordic-seglkartben
authored andcommitted
tests: drivers: spi: spi_loopback: Test fast instance at low frequency
Due to limited value of clock divider, fast SPI instance can work only at higher bitrates. Add check for error message when fast instance is configured to work at low/unsupported bitrate. Signed-off-by: Sebastian Głąb <[email protected]>
1 parent 5413270 commit f47f3fe

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
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: Apache-2.0
5+
*/
6+
7+
/* Note: 1 MHz is too low for fast SPI instance on some nRF platforms.
8+
* In such case, use slow instance instead.
9+
* This overlay is for negative test.
10+
*/
11+
12+
&dut_fast {
13+
spi-max-frequency = <DT_FREQ_M(1)>;
14+
};
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: Apache-2.0
5+
*/
6+
7+
/* Note: 2 MHz is too low for fast SPI instance on some nRF platforms.
8+
* In such case, use slow instance instead.
9+
* This overlay is for negative test.
10+
*/
11+
12+
&dut_fast {
13+
spi-max-frequency = <DT_FREQ_M(2)>;
14+
};

tests/drivers/spi/spi_loopback/testcase.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,18 @@ tests:
232232
filter: CONFIG_DT_HAS_NXP_FLEXIO_ENABLED and
233233
CONFIG_DT_HAS_NXP_FLEXIO_SPI_ENABLED
234234
platform_allow: mimxrt1040_evk
235+
drivers.spi.nrf54h_fast_2mhz:
236+
extra_args:
237+
- DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay"
238+
- EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_2mhz.overlay"
239+
platform_allow:
240+
- nrf54h20dk/nrf54h20/cpuapp
241+
harness: console
242+
harness_config:
243+
fixture: spi_loopback
244+
type: one_line
245+
regex:
246+
- "Failed to initialize nrfx driver"
235247
drivers.spi.nrf54h_fast_8mhz:
236248
extra_args: DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay"
237249
platform_allow:
@@ -248,6 +260,17 @@ tests:
248260
- EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_32mhz.overlay"
249261
platform_allow:
250262
- nrf54h20dk/nrf54h20/cpuapp
263+
drivers.spi.nrf54l_1mhz:
264+
extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_1mhz.overlay"
265+
platform_allow:
266+
- nrf54l15dk/nrf54l15/cpuapp
267+
- nrf54l20pdk/nrf54l20/cpuapp
268+
harness: console
269+
harness_config:
270+
fixture: spi_loopback
271+
type: one_line
272+
regex:
273+
- "Failed to initialize nrfx driver"
251274
drivers.spi.nrf54l_8mhz:
252275
extra_args: EXTRA_DTC_OVERLAY_FILE="boards/nrf_at_8mhz.overlay"
253276
platform_allow:

0 commit comments

Comments
 (0)