2017-10-06 02:30 AM
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
2017-10-06 03:34 AM
Hi
rmivdc
,I recommend you to have a look to DMA section in
Application note aboutMigrating from STM32F405/415 line and STM32F407/417 line to STM32L4 Series microcontrollers or Application note aboutMigrating from STM32F401 and STM32F411 lines to STM32L4 Series microcontrollers.-Nesrine-