cancel
Showing results for 
Search instead for 
Did you mean: 

DMA with multple variable

xkamail
Associate

 

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);

1 ACCEPTED SOLUTION

Accepted Solutions

>>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.

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

View solution in original post

1 REPLY 1

>>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.

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