Skip to content

Commit

Permalink
tests: drivers: spi: spi_error_cases: add from zephyr, support L20
Browse files Browse the repository at this point in the history
Taken from zephyr to check support for L20.

Signed-off-by: Piotr Kosycarz <[email protected]>
  • Loading branch information
nordic-piks committed Feb 26, 2025
1 parent 3f37410 commit 2327a7d
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/drivers/spi/spi_error_cases/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(spi_error_cases)

target_sources(app PRIVATE $ENV{ZEPHYR_BASE}/tests/drivers/spi/spi_error_cases/src/main.c)
4 changes: 4 additions & 0 deletions tests/drivers/spi/spi_error_cases/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This sample extends the same-named Zephyr sample to verify it
with Nordic development kits.

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 number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*

Check failure on line 1 in tests/drivers/spi/spi_error_cases/boards/nrf54l20pdk_nrf54l20_cpuapp.overlay

View workflow job for this annotation

GitHub Actions / call-workflow / Run license checks on patch series (PR)

License Problem

"APACHE-2.0" license is not allowed for this file.
* Copyright (c) 2025 Nordic Semiconductor
*
* SPDX-License-Identifier: Apache-2.0
*/

&pinctrl {
spi22_default_alt: spi22_default_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 9)>,
<NRF_PSEL(SPIM_MISO, 1, 10)>,
<NRF_PSEL(SPIM_MOSI, 1, 2)>;
};
};

spi22_sleep_alt: spi22_sleep_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 1, 9)>,
<NRF_PSEL(SPIM_MISO, 1, 10)>,
<NRF_PSEL(SPIM_MOSI, 1, 2)>;
low-power-enable;
};
};

spi21_default_alt: spi21_default_alt {
group1 {
psels = <NRF_PSEL(SPIS_SCK, 1, 8)>,
<NRF_PSEL(SPIS_MISO, 1, 11)>,
<NRF_PSEL(SPIS_MOSI, 1, 3)>,
<NRF_PSEL(SPIS_CSN, 1, 1)>;
};
};

spi21_sleep_alt: spi21_sleep_alt {
group1 {
psels = <NRF_PSEL(SPIS_SCK, 1, 8)>,
<NRF_PSEL(SPIS_MISO, 1, 11)>,
<NRF_PSEL(SPIS_MOSI, 1, 3)>,
<NRF_PSEL(SPIS_CSN, 1, 1)>;
low-power-enable;
};
};

};


&gpio1 {
status = "okay";
};

&spi22 {
status = "okay";
pinctrl-0 = <&spi22_default_alt>;
pinctrl-1 = <&spi22_sleep_alt>;
pinctrl-names = "default", "sleep";
overrun-character = <0x00>;
cs-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
dut_spi_dt: test-spi-dev@0 {
compatible = "vnd,spi-device";
reg = <0>;
spi-max-frequency = <4000000>;
};
};

dut_spis: &spi21 {
compatible = "nordic,nrf-spis";
status = "okay";
def-char = <0x00>;
pinctrl-0 = <&spi21_default_alt>;
pinctrl-1 = <&spi21_sleep_alt>;
pinctrl-names = "default", "sleep";
/delete-property/rx-delay-supported;
/delete-property/rx-delay;
};

&uicr {
nfct-pins-as-gpios;
};
7 changes: 7 additions & 0 deletions tests/drivers/spi/spi_error_cases/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONFIG_SPI=y
CONFIG_SPI_SLAVE=y
CONFIG_GPIO=y
CONFIG_POLL=y
CONFIG_SPI_ASYNC=y
CONFIG_SPI_EXTENDED_MODES=y
CONFIG_ZTEST=y
15 changes: 15 additions & 0 deletions tests/drivers/spi/spi_error_cases/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
common:
# depends_on: spi
tags:
- drivers
- spi
- ci_tests_drivers_spi
harness: ztest
harness_config:
fixture: gpio_spi_loopback
tests:
nrf.extended.drivers.spi.spi_error_cases:
platform_allow:
- nrf54l20pdk/nrf54l20/cpuapp
integration_platforms:
- nrf54l20pdk/nrf54l20/cpuapp

0 comments on commit 2327a7d

Please sign in to comment.