Skip to main content
FZida.1
Visitor II
October 7, 2021
Solved

CubeMX not consistent with generating MX_DMA_Init() before MX_USART6_UART_Init(). Bug?

  • October 7, 2021
  • 1 reply
  • 1105 views

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 ?

This topic has been closed for replies.
Best answer by Imen.D

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

1 reply

Imen.DBest answer
ST Technical Moderator
October 7, 2021

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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks