Skip to content

Commit d812554

Browse files
committed
tests: drivers: spi: dt_spec: add from zephyr, support L20 and L09
Taken from zephyr to check support for L20 and L09. Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
1 parent f9ba1c1 commit d812554

File tree

7 files changed

+86
-0
lines changed

7 files changed

+86
-0
lines changed

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@
839839
/tests/drivers/uart/uart_baudrate_test/ @nrfconnect/ncs-low-level-test
840840
/tests/drivers/sensor/multicore_temp/ @nrfconnect/ncs-low-level-test
841841
/tests/drivers/sdp_asm/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus
842+
/tests/drivers/spi/ @nrfconnect/ncs-low-level-test
842843
/tests/lib/at_cmd_parser/ @nrfconnect/ncs-modem
843844
/tests/lib/at_cmd_custom/ @nrfconnect/ncs-modem
844845
/tests/lib/at_parser/ @nrfconnect/ncs-modem

scripts/ci/tags.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -1530,3 +1530,8 @@ ci_samples_drivers_audio_dmic:
15301530
files:
15311531
- nrf/samples/drivers/audio/dmic/
15321532
- zephyr/samples/drivers/audio/dmic/
1533+
1534+
ci_tests_drivers_spi:
1535+
files:
1536+
- nrf/tests/drivers/spi/
1537+
- zephyr/tests/drivers/spi/
+11
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_dt_spec)
10+
11+
target_sources(app PRIVATE ${ZEPHYR_BASE}/tests/drivers/spi/dt_spec/src/main.c)

tests/drivers/spi/dt_spec/README.txt

+4
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/dt_spec.

tests/drivers/spi/dt_spec/app.overlay

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/ {
2+
test {
3+
#address-cells = <0x1>;
4+
#size-cells = <0x1>;
5+
6+
test_gpio: gpio@deadbeef {
7+
compatible = "vnd,gpio";
8+
gpio-controller;
9+
reg = <0xdeadbeef 0x1000>;
10+
#gpio-cells = <0x2>;
11+
status = "okay";
12+
};
13+
14+
test_spi_cs: spi@33334444 {
15+
#address-cells = <1>;
16+
#size-cells = <0>;
17+
compatible = "vnd,spi";
18+
reg = <0x33334444 0x1000>;
19+
status = "okay";
20+
clock-frequency = <2000000>;
21+
22+
cs-gpios = <&test_gpio 0x10 0x20>;
23+
24+
test_spi_dev_cs: test-spi-dev@0 {
25+
compatible = "vnd,spi-device";
26+
reg = <0>;
27+
spi-max-frequency = <2000000>;
28+
};
29+
};
30+
31+
test_spi_no_cs: spi@55556666 {
32+
#address-cells = <1>;
33+
#size-cells = <0>;
34+
compatible = "vnd,spi";
35+
reg = <0x55556666 0x1000>;
36+
status = "okay";
37+
clock-frequency = <2000000>;
38+
39+
test_spi_dev_no_cs: test-spi-dev@0 {
40+
compatible = "vnd,spi-device";
41+
reg = <0>;
42+
spi-max-frequency = <2000000>;
43+
};
44+
};
45+
};
46+
};

tests/drivers/spi/dt_spec/prj.conf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CONFIG_ZTEST=y
2+
CONFIG_SPI=y
3+
CONFIG_GPIO=y
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
tests:
2+
nrf.extended.drivers.spi.dt_spec:
3+
tags:
4+
- drivers
5+
- spi
6+
- devicetree
7+
- ci_tests_drivers_spi
8+
# depends_on:
9+
# - spi
10+
# - gpio
11+
platform_allow:
12+
- nrf54l20pdk/nrf54l20/cpuapp
13+
- nrf54l09pdk/nrf54l09/cpuapp
14+
integration_platforms:
15+
- nrf54l20pdk/nrf54l20/cpuapp
16+
- nrf54l09pdk/nrf54l09/cpuapp

0 commit comments

Comments
 (0)