Skip to content

Commit 525d6ab

Browse files
djiatsaf-stnordicjm
authored andcommitted
[nrf fromtree] tests: drivers: spi: spi_loopback: handle rx/tx buffers nocache memory
Place transfer buffers in non-cacheable memory when CONFIG_NOCACHE_MEMORY=y. This change ensures that DMA transfer buffers are allocated in non-cacheable memory on platforms where CONFIG_NOCACHE_MEMORY is enabled. This avoids potential cache coherence issues that are not handled by the SPI driver. Signed-off-by: Fabrice DJIATSA <[email protected]> (cherry picked from commit cc4e2f5)
1 parent 8dcefc8 commit 525d6ab

File tree

1 file changed

+2
-2
lines changed
  • tests/drivers/spi/spi_loopback/src

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,8 @@ static struct k_thread thread[3];
717717
static K_SEM_DEFINE(thread_sem, 0, 3);
718718
static K_SEM_DEFINE(sync_sem, 0, 1);
719719

720-
static uint8_t __aligned(32) tx_buffer[3][32];
721-
static uint8_t __aligned(32) rx_buffer[3][32];
720+
static uint8_t __aligned(32) tx_buffer[3][32] __NOCACHE;
721+
static uint8_t __aligned(32) rx_buffer[3][32] __NOCACHE;
722722

723723
atomic_t thread_test_fails;
724724

0 commit comments

Comments
 (0)