cancel
Showing results for 
Search instead for 
Did you mean: 

UART DMA

BPark.5
Associate II

I am using STM32H743

I used uart's DMA

Check whether data has been received through this function

But there is no data in the buffer. Why the hell is this happening?

And, of course, I changed the linker start(0x24000000) and end address(0x2407FFFF) of the project.

7 REPLIES 7

DMA coherency? This stuff operates independently of the MCU.

Use the DCache Invalidate By Address function so it sees the data in the physical memory

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
BPark.5
Associate II

I'm sorry but I didn't understand

Can you be more specific?

TDK
Guru

No data? Or 0's?

Disable data cache and try again. Likely it will work, in which case you will need to manage the cache appropriately by cleaning prior to sending and invalidating after receiving.

If you feel a post has answered your question, please click "Accept as Solution".

That is 0's

I'm sorry, but please give me a specific example

Do people really exist in such a vacuum of knowledge/understanding?

You need to force the CPU side cache to refetch the content of the memory, the DMA operates on the memory directly, not what the cache is holding, the cache here is not exotic, it doesn't do any bus snooping to catch external activity.

/**

 \brief  D-Cache Invalidate by address

 \details Invalidates D-Cache for the given address

 \param[in]  addr  address (aligned to 32-byte boundary)

 \param[in]  dsize  size of memory block (in number of bytes)

*/

__STATIC_INLINE void SCB_InvalidateDCache_by_Addr (uint32_t *addr, int32_t dsize)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Be careful however the cache-lines are 32-bytes wide and you can do collateral damage to structures/variables that span the boundaries, or have pending writes.

Best to have an aligned DMA buffer, and padded out so other structures are uninvolved.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Evangelist III