AnsweredAssumed Answered

Dma differences between stm32l4 & stm32f4

Question asked by rolly loysney on Oct 6, 2017
Latest reply on Oct 6, 2017 by Nesrine M

Hello,

 

I'm trying to port a code from stm32l4 to stm32f4 

it seems that DMA initialization is a bit different between those two chips:

 

stm32l4 requires" DMA_REQUEST_XX" :

 

hdma_tim.Init.Request = DMA_REQUEST_4;
hdma_tim.Init.Direction = DMA_MEMORY_TO_PERIPH;
hdma_tim.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_tim.Init.MemInc = DMA_MINC_ENABLE;
hdma_tim.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
hdma_tim.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_tim.Init.Mode = DMA_CIRCULAR;
hdma_tim.Init.Priority = DMA_PRIORITY_HIGH;

 

hdma_tim.Instance = DMA1_Channel5;

 

while stm32f4 :

 

hdma_tim.Init.Channel = DMA_CHANNEL_5;
hdma_tim.Init.Direction = DMA_MEMORY_TO_PERIPH;
hdma_tim.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_tim.Init.MemInc = DMA_MINC_ENABLE;
hdma_tim.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
hdma_tim.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
hdma_tim.Init.Mode = DMA_CIRCULAR;
hdma_tim.Init.Priority = DMA_PRIORITY_HIGH;

 

hdma_tim.Instance = DMA1_Channel5;

 

have that "channel" parameter instead of "request"

 

 

Does it work the same ? My dma can also start well ?

 

thank you

Outcomes