Skip to content

Commit b4ff177

Browse files
hakehuangnashif
authored andcommitted
tests: spi_loopback: kinetis dspi fix
1. kenistis dspi does support rx and tx with different size, so skip the tx_bigger test. 2. dspi dma need internal alignment and 8192 bytes are too many for k64, so reduce to 1440 bytes fixing: #77010 Signed-off-by: Hake Huang <[email protected]>
1 parent f6d5c2e commit b4ff177

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# enable DMA mode
22
CONFIG_DMA=y
33
CONFIG_DSPI_MCUX_EDMA=y
4-
CONFIG_MCUX_DSPI_BUFFER_SIZE=144
4+
CONFIG_MCUX_DSPI_BUFFER_SIZE=5760

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ 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
6166
#define BUF3_SIZE 8192
67+
#endif
68+
6269

6370
#if CONFIG_NOCACHE_MEMORY
6471
#define __NOCACHE __attribute__((__section__(".nocache")))
@@ -481,6 +488,11 @@ static int spi_rx_bigger_than_tx(struct spi_dt_spec *spec)
481488
return 0;
482489
}
483490

491+
if (IS_ENABLED(CONFIG_DSPI_MCUX_EDMA)) {
492+
LOG_INF("Skip rx bigger than tx");
493+
return 0;
494+
}
495+
484496
LOG_INF("Start rx bigger than tx");
485497

486498
(void)memset(buffer_rx, 0xff, BUF_SIZE);

0 commit comments

Comments
 (0)