Skip to content

Commit 614e7d5

Browse files
nordic-krchhenrikbrixandersen
authored andcommitted
tests: drivers: spi: loopback: Configurable large buffer
In order to allow fiting test in targets with smaller memory make large buffer configurable through Kconfig. Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent 28ec98a commit 614e7d5

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

tests/drivers/spi/spi_loopback/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ source "Kconfig.zephyr"
77
config SPI_LOOPBACK_MODE_LOOP
88
bool "Configure the SPI in LOOP mode, so that no extra wiring is needed"
99

10+
config SPI_LARGE_BUFFER_SIZE
11+
int "Large buffer size"
12+
default 8192
13+
1014
if SOC_SERIES_STM32H7X
1115

1216
config SPI_LOOPBACK_16BITS_FRAMES

tests/drivers/spi/spi_loopback/overlay-mcux-dspi-dma.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
CONFIG_DMA=y
33
CONFIG_DSPI_MCUX_EDMA=y
44
CONFIG_MCUX_DSPI_BUFFER_SIZE=5760
5+
CONFIG_SPI_LARGE_BUFFER_SIZE=1440

tests/drivers/spi/spi_loopback/src/spi.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,7 @@ static struct spi_dt_spec spi_slow = SPI_DT_SPEC_GET(SPI_SLOW_DEV, SPI_OP(FRAME_
5858
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACK_SIZE)
5959
#define BUF_SIZE 18
6060
#define BUF2_SIZE 36
61-
62-
#ifdef CONFIG_DSPI_MCUX_EDMA
63-
/*DSPI DMA need aligned buffer for internal*/
64-
#define BUF3_SIZE 1440
65-
#else
66-
#define BUF3_SIZE 8192
67-
#endif
61+
#define BUF3_SIZE CONFIG_SPI_LARGE_BUFFER_SIZE
6862

6963

7064
#if CONFIG_NOCACHE_MEMORY

0 commit comments

Comments
 (0)