cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to configure the order of the auto generated code?

Jtron.11
Senior

I am using STMCubeIDE version 1.7.0 and I saw the generate code for the initialization

has different orders when I configured my ADC with DMA

Sometime the code was generate with ADC init before the DMA init

 MX_ADC1_Init();

 MX_ADC3_Init();

 MX_DMA_Init();

Sometime the code was generate with DMA init before ADC init

 MX_DMA_Init();

 MX_ADC1_Init();

 MX_ADC3_Init();

Is there a rule for the auto generated code orders?

1 ACCEPTED SOLUTION

Accepted Solutions
Jtron.11
Senior

Thank you TDK. Seem like not me struggling with ADC DMA not working because this not in the right sequence order.

View solution in original post

3 REPLIES 3
TDK
Guru

It’s in there somewhere. Possibly in code generation tab somewhere. I can’t check right now.

edit: in advanced settings somewhere.

https://community.st.com/s/question/0D53W00000GZpgtSAD/cubemx-adc-and-dma-initialized-in-the-wrong-order

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

Thank you TDK. Seem like not me struggling with ADC DMA not working because this not in the right sequence order.

Imen.D
ST Employee

Hello @Jtron.1​ ,

I confirm this issue in CubeMX v6.3.0, that the DMA Init function is called after the peripheral initialization.

So, when DMA is used, the MX_DMA_Init() shall be called BEFORE any other peripheral initialization.

Our CubeMx team is working to resolve this issue in the coming releases.

(Internal ticket 112040 : This is an internal tracking number and is not accessible or usable by customers.)

Thanks for your contribution

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen