Skip to content

Commit 5df942b

Browse files
committed
[nrf fromlist] 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. Upstream PR #: 93487 Signed-off-by: Nikodem Kastelik <[email protected]>
1 parent 41a6274 commit 5df942b

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
@@ -39,14 +39,8 @@ static struct k_poll_signal async_sig_spim = K_POLL_SIGNAL_INITIALIZER(async_sig
3939
static struct k_poll_event async_evt_spim =
4040
K_POLL_EVENT_INITIALIZER(K_POLL_TYPE_SIGNAL, K_POLL_MODE_NOTIFY_ONLY, &async_sig_spim);
4141

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

5145
struct test_data {
5246
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
@@ -105,3 +105,8 @@ tests:
105105
- CONFIG_PM_DEVICE=y
106106
- CONFIG_PM_DEVICE_RUNTIME=y
107107
filter: CONFIG_SOC_FAMILY_NORDIC_NRF
108+
109+
drivers.spi.direct_xfer:
110+
extra_configs:
111+
- CONFIG_SPI_NRFX_RAM_BUFFER_SIZE=0
112+
filter: CONFIG_SOC_FAMILY_NORDIC_NRF

0 commit comments

Comments
 (0)