2021-08-12 06:09 AM
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.
2021-08-12 06:12 AM
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
2021-08-12 06:17 AM
I'm sorry but I didn't understand
Can you be more specific?
2021-08-12 06:22 AM
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.
2021-08-12 06:28 AM
That is 0's
I'm sorry, but please give me a specific example
2021-08-12 06:44 AM
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)
2021-08-12 06:55 AM
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.
2021-08-12 07:40 AM
Examples for using DMA with UARTs