cancel
Showing results for 
Search instead for 
Did you mean: 

Dma differences between stm32l4 & stm32f4

rolly loysney
Associate II
Posted on October 06, 2017 at 11:30

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

1 REPLY 1
Nesrine M_O
Lead II
Posted on October 06, 2017 at 12:34

Hi

rmivdc

,

I recommend you to have a look to DMA section in

http://www.st.com/content/ccc/resource/technical/document/application_note/group0/02/46/be/cf/31/75/4e/de/DM00263732/files/DM002637pdf/jcr:content/translations/en.DM002637pdf

Application note aboutMigrating from STM32F405/415 line and STM32F407/417 line to STM32L4 Series microcontrollers or

http://www.st.com/content/ccc/resource/technical/document/application_note/group0/87/fc/79/9d/3c/cc/49/84/DM00144612/files/DM001446pdf/jcr:content/translations/en.DM001446pdf

Application note aboutMigrating from STM32F401 and STM32F411 lines to STM32L4 Series microcontrollers.

-Nesrine-