2026-02-10 10:46 PM - edited 2026-02-10 11:54 PM
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?
Solved! Go to Solution.
2026-02-11 2:36 AM
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.
2026-02-10 11:16 PM
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.
2026-02-10 11:42 PM
2026-02-11 2:36 AM
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.
2026-02-11 6:37 AM - edited 2026-02-11 6:40 AM
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.