Skip to content

Commit 9f5fd6e

Browse files
committed
tests: drivers: spi: spi_error_cases: add from zephyr, support L20
Taken from zephyr to check support for L20. Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
1 parent 3dfd9ed commit 9f5fd6e

File tree

5 files changed

+109
-0
lines changed

5 files changed

+109
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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(spi_error_cases)
10+
11+
target_sources(app PRIVATE ${ZEPHYR_BASE}/tests/drivers/spi/spi_error_cases/src/main.c)
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/tests/drivers/spi/spi_error_cases.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
&pinctrl {
2+
spi22_default_alt: spi22_default_alt {
3+
group1 {
4+
psels = <NRF_PSEL(SPIM_SCK, 1, 9)>,
5+
<NRF_PSEL(SPIM_MISO, 1, 10)>,
6+
<NRF_PSEL(SPIM_MOSI, 1, 2)>;
7+
};
8+
};
9+
10+
spi22_sleep_alt: spi22_sleep_alt {
11+
group1 {
12+
psels = <NRF_PSEL(SPIM_SCK, 1, 9)>,
13+
<NRF_PSEL(SPIM_MISO, 1, 10)>,
14+
<NRF_PSEL(SPIM_MOSI, 1, 2)>;
15+
low-power-enable;
16+
};
17+
};
18+
19+
spi21_default_alt: spi21_default_alt {
20+
group1 {
21+
psels = <NRF_PSEL(SPIS_SCK, 1, 8)>,
22+
<NRF_PSEL(SPIS_MISO, 1, 11)>,
23+
<NRF_PSEL(SPIS_MOSI, 1, 3)>,
24+
<NRF_PSEL(SPIS_CSN, 1, 1)>;
25+
};
26+
};
27+
28+
spi21_sleep_alt: spi21_sleep_alt {
29+
group1 {
30+
psels = <NRF_PSEL(SPIS_SCK, 1, 8)>,
31+
<NRF_PSEL(SPIS_MISO, 1, 11)>,
32+
<NRF_PSEL(SPIS_MOSI, 1, 3)>,
33+
<NRF_PSEL(SPIS_CSN, 1, 1)>;
34+
low-power-enable;
35+
};
36+
};
37+
38+
};
39+
40+
41+
&gpio1 {
42+
status = "okay";
43+
};
44+
45+
&spi22 {
46+
status = "okay";
47+
pinctrl-0 = <&spi22_default_alt>;
48+
pinctrl-1 = <&spi22_sleep_alt>;
49+
pinctrl-names = "default", "sleep";
50+
overrun-character = <0x00>;
51+
cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
52+
dut_spi_dt: test-spi-dev@0 {
53+
compatible = "vnd,spi-device";
54+
reg = <0>;
55+
spi-max-frequency = <4000000>;
56+
};
57+
};
58+
59+
dut_spis: &spi21 {
60+
compatible = "nordic,nrf-spis";
61+
status = "okay";
62+
def-char = <0x00>;
63+
pinctrl-0 = <&spi21_default_alt>;
64+
pinctrl-1 = <&spi21_sleep_alt>;
65+
pinctrl-names = "default", "sleep";
66+
/delete-property/rx-delay-supported;
67+
/delete-property/rx-delay;
68+
};
69+
70+
&uicr {
71+
nfct-pins-as-gpios;
72+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CONFIG_SPI=y
2+
CONFIG_SPI_SLAVE=y
3+
CONFIG_GPIO=y
4+
CONFIG_POLL=y
5+
CONFIG_SPI_ASYNC=y
6+
CONFIG_SPI_EXTENDED_MODES=y
7+
CONFIG_ZTEST=y
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
common:
2+
# depends_on: spi
3+
tags:
4+
- drivers
5+
- spi
6+
- ci_tests_drivers_spi
7+
harness: ztest
8+
harness_config:
9+
fixture: gpio_spi_loopback
10+
tests:
11+
nrf.extended.drivers.spi.spi_error_cases:
12+
platform_allow:
13+
- nrf54l20pdk/nrf54l20/cpuapp
14+
integration_platforms:
15+
- nrf54l20pdk/nrf54l20/cpuapp

0 commit comments

Comments
 (0)