cancel
Showing results for 
Search instead for 
Did you mean: 

Method to reorder peripheral init functions? (DMA BUG)

ALars.2
Associate II

Is there a way to reorder the peripheral initialization functions in the main.c auto code without opening the .ioc file? MX_DMA_Init() was getting called after MX_USART1_UART_Init() in my project, which was causing the DMA instance's registers to not update inside HAL_UART_MspInit(), and thus made the entire peripheral to fail (which I'm pretty sure is a bug).

Using STM32CubeIDE Version: 1.8.0 (Build: 11526_20211125_0815 (UTC))

For anyone else that runs into this kind of thing (assuming there isn't a proper fix), I manually reordered the functions by editing ProjectManager.functionlistsort in the project .ioc file.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

> Is there a way to reorder the peripheral initialization functions in the main.c auto code without opening the .ioc file?

Doesn't seem like it:

https://community.st.com/s/question/0D53W00001EzCmCSAV/mxdmainit-order-in-the-mainc-file-generated-by-stm32cubemx-how-to-fix

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

> Is there a way to reorder the peripheral initialization functions in the main.c auto code without opening the .ioc file?

Doesn't seem like it:

https://community.st.com/s/question/0D53W00001EzCmCSAV/mxdmainit-order-in-the-mainc-file-generated-by-stm32cubemx-how-to-fix

If you feel a post has answered your question, please click "Accept as Solution".

Well, at least it's fixed for new projects. Thanks!