2021-10-07 03:38 AM
Hi, I am wondering why STm32CubeMX in some projects will generate the correct order of MX_DMA_Init() before MX_USART6_UART_Init(), but in other projects it will reverse that order. if the order is reversed, then the DMA will not work.
I have looked into the *.ioc-files. I notived the Mcu.IPxx fields are not ordered correctly starting with Mcu.IP10.
working file (DMA_init before USART6_init)
Mcu.Family=STM32H7
Mcu.IP0=CORTEX_M7
Mcu.IP1=DMA
Mcu.IP2=NVIC
Mcu.IP3=RCC
Mcu.IP4=SYS
Mcu.IP5=USART6
Mcu.IPNb=6
not working file (DMA_init after USART6_init)
Mcu.Family=STM32H7
Mcu.IP0=CORTEX_M7
Mcu.IP1=DEBUG
Mcu.IP10=TIM3
Mcu.IP11=USART6
Mcu.IP2=DMA
Mcu.IP3=ETH
Mcu.IP4=FREERTOS
Mcu.IP5=HRTIM
Mcu.IP6=LWIP
Mcu.IP7=NVIC
Mcu.IP8=RCC
Mcu.IP9=SYS
Mcu.IPNb=12
Is there anything I can do to get generated code that is independent of the Mcu.IPNb < 10 ?
Solved! Go to Solution.
2021-10-07 03:56 AM
Hello @FZida.1 ,
This is a known issue with CubeMX v6.3.0 when DMA is used.
The MX_DMA_Init() shall be called BEFORE any other peripheral initialization.
This issue will be fixed in the coming releases of CubeMx (see this post for more details).
I marked this post as "Best Answer" to close the question and this will help Community users with the same request find that answer faster.
Imen
2021-10-07 03:56 AM
Hello @FZida.1 ,
This is a known issue with CubeMX v6.3.0 when DMA is used.
The MX_DMA_Init() shall be called BEFORE any other peripheral initialization.
This issue will be fixed in the coming releases of CubeMx (see this post for more details).
I marked this post as "Best Answer" to close the question and this will help Community users with the same request find that answer faster.
Imen