cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX incorrectly generating code for STM32U0 MCO2

flammmable_new
Associate II

I'm trying to generate code using CubeMX for the Nucleo-U031R8 demo board to output a clock signal to the MCO2 pin. But the generated MX_GPIO_Init function makes the following assignment:

GPIO_InitStruct.Alternate = GPIO_AF0_TRACE;

Naturally, the compiler throws an error: "GPIO_AF0_TRACE undeclared".

If I manually change the code to the following:

GPIO_InitStruct.Alternate = GPIO_AF0_MCO2;

...the code compiles without errors.

Is it possible to fix this bug in the next CubeMX release?

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @flammmable_new 

 

Let me thank you for bringing this issue to our attention.

The issue has been escalated internally to the dedicated team for further investigation and resolution (Ticket 227030).This is an internal tracking number and is not accessible or usable by customers.)

AS WA I recommend that you change the code manually.

HAL Driver:

GPIO_InitStruct.Alternate = GPIO_AF0_MCO2;

LL Driver:

GPIO_InitStruct.Alternate = LL_GPIO_AF_0;

 

Thanks

Mahmoud

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Mahmoud Ben Romdhane
ST Employee

Hello @flammmable_new 

Let me thank you for posting.

For more investigation, I suggest that you provide your IOC.File.

Thank

Mahmoud 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Here you are

Hello @flammmable_new 

 

Let me thank you for bringing this issue to our attention.

The issue has been escalated internally to the dedicated team for further investigation and resolution (Ticket 227030).This is an internal tracking number and is not accessible or usable by customers.)

AS WA I recommend that you change the code manually.

HAL Driver:

GPIO_InitStruct.Alternate = GPIO_AF0_MCO2;

LL Driver:

GPIO_InitStruct.Alternate = LL_GPIO_AF_0;

 

Thanks

Mahmoud

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks!

I like the words "escalated" and "investigation" :)

I hope the group will solve the problem and it won't be in the next release of the CubeMX.