Skip to content

Commit 97936ae

Browse files
committed
tests: drivers: spi: controller_peripheral: add direct variant
Direct variant of this test disables intermediate buffer in the nRF SPI driver and verifies whether devices like nRF54H20, which can peform DMA transcations only from specific memory regions, are handled properly. Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
1 parent 469d8dc commit 97936ae

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

tests/drivers/spi/spi_controller_peripheral/boards/nrf54h20dk_nrf54h20_cpurad.overlay

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
*/
66
#include "nrf54h20dk_nrf54h20_common.dtsi"
77

8+
&cpurad_dma_region {
9+
reg = <0x1680 DT_SIZE_K(2)>;
10+
};
11+
812
&spi130 {
913
memory-regions = <&cpurad_dma_region>;
1014
};

tests/drivers/spi/spi_controller_peripheral/src/main.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,8 @@ static struct k_poll_signal async_sig_spim = K_POLL_SIGNAL_INITIALIZER(async_sig
4040
static struct k_poll_event async_evt_spim =
4141
K_POLL_EVENT_INITIALIZER(K_POLL_TYPE_SIGNAL, K_POLL_MODE_NOTIFY_ONLY, &async_sig_spim);
4242

43-
#define MEMORY_SECTION(node) \
44-
COND_CODE_1(DT_NODE_HAS_PROP(node, memory_regions), \
45-
(__attribute__((__section__( \
46-
LINKER_DT_NODE_REGION_NAME(DT_PHANDLE(node, memory_regions)))))), \
47-
())
48-
49-
static uint8_t spim_buffer[32] MEMORY_SECTION(DT_BUS(DT_NODELABEL(dut_spi_dt)));
50-
static uint8_t spis_buffer[32] MEMORY_SECTION(DT_NODELABEL(dut_spis));
43+
static uint8_t spim_buffer[32];
44+
static uint8_t spis_buffer[32];
5145

5246
struct test_data {
5347
struct k_work_delayable test_work;

tests/drivers/spi/spi_controller_peripheral/testcase.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,8 @@ tests:
102102
- CONFIG_PM_DEVICE=y
103103
- CONFIG_PM_DEVICE_RUNTIME=y
104104
filter: CONFIG_SOC_FAMILY_NORDIC_NRF
105+
106+
drivers.spi.direct_xfer:
107+
extra_configs:
108+
- CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=0
109+
filter: CONFIG_SOC_FAMILY_NORDIC_NRF

0 commit comments

Comments
 (0)