cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 DMA differenct src & dst memory increments

hari
Associate II
Posted on July 31, 2015 at 08:55

Hi Everyone,

Does STM32 DMA controller provide options to perform following copy procedure

Say the data in the source memory as follows. (x, y are 16 bit each)

Source Memory:

x1 ,y1,x2,y2.,.,xn ,yn

I want to copy to destination memory just (alternate source data)

Destination Memory:

x1,x2,.,.,xn

Thanks

#adc_dual #adc #dma
3 REPLIES 3
Posted on July 31, 2015 at 18:33

Which STM32 specifically? They make like hundreds of variants, from dozens of families.

I think it should be able to take a 32-bit value (2x 16-bit pair) and copy out only one 16-bit value, repeating over the count. Can't say I've tried it, but it should take you more than 10 minutes of so to prove to yourself one way or the other.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
hari
Associate II
Posted on August 12, 2015 at 03:35

Thanks clive,

I am using STM32F4x

Tried configuring different word size for source and destination. It is not copying data to destination in an interleaved fashion as expected.

Basically I am trying to use DMA to transfer data from two ADCs (adc1 & adc2) in dual mode (synchronized).

In dual mode if I am not wrong adc samples are stored in interleaved fashion. 

Can it be redirected to two different buffers, so that reshuffling can be avoided?

BR

hgs

Posted on August 12, 2015 at 06:26

Ideally you'd just process the data in place.

You could alternatively use two ADC, with two DMA, independently, but triggered via the same timer, at the same instant. This would be less of a circus than trying to reorganize the array with an independent DMA operation.

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