STM32 Zephyr 3.7.1-rc1 issue: E: Rx buffer should be placed in a nocache memory region
#75032
-
I am testing the move from Zephyr 3.6.0 to the 3.7.0-rc1 and our STM32F7 platform (which uses async UART, though that may not necessarily be relevant) throws a new error:
...and afterwards random crashes occur in All our RX buffers are just |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi @RobMeades
In the contrary, it's quite relevant as you apparently have The solution would be to either disable DCACHE, or put your UART buffers in a Nocache memory region as done in |
Beta Was this translation helpful? Give feedback.
-
Hi, and thanks for the swift response. I haven't specifically enabled Configuring looks frighteningly complicated; I will chicken out and disable it for now. Will confirm back here if that fixes things for me... |
Beta Was this translation helpful? Give feedback.
-
Confirmed that removes the error message, though a crash remains, now somewhere in the Zephyr heap, I will debug that separately.
|
Beta Was this translation helpful? Give feedback.
-
Hi , I’m running into the same issue while working with the STM32U575 MCU. I followed your advice, @ajarmouni-st and checked out the file #if defined(CONFIG_DCACHE) && defined(CONFIG_DT_DEFINED_NOCACHE)
#define __NOCACHE __attribute__ ((__section__(CONFIG_DT_DEFINED_NOCACHE_NAME)))
#define NOCACHE_MEM 1
First thing I noticed: there’s no sample I also tried enabling Kept digging and saw that The only thing that worked for me was going into Am I missing something? Is there a correct way to disable dcache and use a nocache region on STM32U575? |
Beta Was this translation helpful? Give feedback.
Hi @RobMeades
In the contrary, it's quite relevant as you apparently have
CONFIG_DCACHE
enabled in your project & you are using DMA (async UART => UART with DMA), & since STM32 UART driver does not yet handle cache coherency by itself, it checks if the buffers provided by the application are in a non-cached memory region before performing any transfer.This behavior was introduced in #70503
The solution would be to either disable DCACHE, or put your UART buffers in a Nocache memory region as done in
tests/drivers/uart/uart_async_api/src/test_uart_async.c
.