2025-05-01 5:57 AM
Hi,
I have a well functioning application transmitting on uart4 using GPDMA1 CH1.
If I turn on DCache, then it does transmit the correct length, only all characters are 0x00 (no problem in turning ICache on).
In HAL_UART_Transmit_DMA(huart, (const uint8_t*)pTx, len), if I make this substitution: HAL_UART_Transmit_DMA(huart, (const uint8_t*)"Hi "/*pTx*/, 3/*len*/), then it works.
I have tried allocating the variable pointed to by pTx to just about any available memory area / type without success.
Any suggestions?
2025-05-01 6:01 AM
After writing the values to memory, but before sending them with DMA, clean the cache with SCB_CleanDCache_by_Addr. You'll need to ensure the buffer is aligned to a cache page.
Managing Cache Coherency on Cortex-M7 Based MCUs