cancel
Showing results for 
Search instead for 
Did you mean: 

MEM TO MEM DMA

yang hong
Associate II

I am using STM32H743ZI2. I am using 6 ADC with external timer and dma to acquire data. After I acquire adc data (16bits), I will use scale ratio to obtain physicals value I would like to get. This value will be 32bits. After I do power (a x a), the result will be 64bits. I set a 64bit 6 elements array to hold these power value, then I would like to copy to another 64bits 48 elements array to hold (8 x 6 channels data). I would like to use mem-to-mem dma to do transfer. I set dma configuration below:

 hdma_memtomem_dma1_stream1.Instance = DMA1_Stream1;

 hdma_memtomem_dma1_stream1.Init.Request = DMA_REQUEST_MEM2MEM;

 hdma_memtomem_dma1_stream1.Init.Direction = DMA_MEMORY_TO_MEMORY;

 hdma_memtomem_dma1_stream1.Init.PeriphInc = DMA_PINC_ENABLE;

 hdma_memtomem_dma1_stream1.Init.MemInc = DMA_MINC_ENABLE;

 hdma_memtomem_dma1_stream1.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;

 hdma_memtomem_dma1_stream1.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;

 hdma_memtomem_dma1_stream1.Init.Mode = DMA_NORMAL;

 hdma_memtomem_dma1_stream1.Init.Priority = DMA_PRIORITY_LOW;

 hdma_memtomem_dma1_stream1.Init.FIFOMode = DMA_FIFOMODE_ENABLE;

 hdma_memtomem_dma1_stream1.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;

 hdma_memtomem_dma1_stream1.Init.MemBurst = DMA_MBURST_INC4;

 hdma_memtomem_dma1_stream1.Init.PeriphBurst = DMA_PBURST_INC4;

I use the following function to transfer data from one memory to another memory:

 HAL_DMA_Start_IT(&hdma_memtomem_dma1_stream1, &volts_power2[0], &buf_volts_pow2[0], 12);

I am not sure my idea is executable?

1 REPLY 1

Yes?

Edit your question to have some actual content and context. See "V" icon, upper right corner posts

What STM32?

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