2024-10-16 8:21 AM - edited 2024-10-16 8:28 AM
I have three variables:
volatile uint16_t a[20000];
volatile uint16_t b[20000];
volatile uint16_t c[20000];
However, I only have one DMA channel.
Can I use the DMA to transfer these three variables together in circular mode?
starting with the first 10,000 items of each 3 variable, so the total items will be 30,000
currently:
HAL_DMA_Start(&hdma_tim8_com, (uint8_t*)xxx, &dst, 30000);
Solved! Go to Solution.
2024-10-16 9:24 AM
>>Can I use the DMA to transfer these three variables together in circular mode?
No, it's also not going to interleave.
Perhaps use a STRUCTURE or multi-dimensional ARRAY
3 ARRAYs will need 3 TRIGGERS, and 3 DMA CHANNELS
Also volatile isn't on it's own sufficient. You must still manage Cache Coherency, DMA data doesn't update content of the MCU's cache, it's not bus sniffing.
2024-10-16 9:24 AM
>>Can I use the DMA to transfer these three variables together in circular mode?
No, it's also not going to interleave.
Perhaps use a STRUCTURE or multi-dimensional ARRAY
3 ARRAYs will need 3 TRIGGERS, and 3 DMA CHANNELS
Also volatile isn't on it's own sufficient. You must still manage Cache Coherency, DMA data doesn't update content of the MCU's cache, it's not bus sniffing.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.