Skip to main content
MK8290
Associate II
January 18, 2022
Solved

How to make the CubeMX generate the code with the user label given to the IOs?

  • January 18, 2022
  • 7 replies
  • 3938 views

I am using the latest version 6.4.0. I used a user label for some IO configuration, but when the code is generated, the code is not using the user label; For ex PC4 I used LED_1 as a label and the code is still using the label GPIO_PIN_4. How can Igenarte the code with user-defined labels?

Thanks

This topic has been closed for replies.
Best answer by Sara BEN HADJ YAHYA

Hello ​@MK8290​ ,

This issue is fixed in STM32CubeMX latest release.

V6.7.0 is now available under this Link.

Thanks for your contribution :smiling_face_with_smiling_eyes:

Sara.

7 replies

mƎALLEm
Technical Moderator
January 19, 2022

Dear @MK8290​ ,

@Sara BEN HADJ YAHYA​  can help you on this topic.

SofLit

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
TDK
Super User
January 19, 2022

It should. Attach an IOC file that shows the issue.

"If you feel a post has answered your question, please click ""Accept as Solution""."
MK8290
MK8290Author
Associate II
January 19, 2022

Please find ioc file attached. In this test project, I have labeled PA2, PA3, and PB0 as LED_1, LED_2, and LED_3.

Thanks.

MK8290
MK8290Author
Associate II
January 19, 2022

Update -

I configured 2 more IO's to interrupts and enabled NVIC, and in Project Manager, I enabled this 0693W00000JMc20QAD.pngwhen I generated code with these settings in addition to LED IO as output, the Pins used user labels.

I believe project settings change nothing to do with this. Somehow configuring interrupt triggered something to use user labels I think.

Sara BEN HADJ YAHYA
Technical Moderator
January 20, 2022

Hello @MK8290​ ,

Thanks for your feedback,

It seems that there is nothing wrong with your .ioc file, I generated a code using it and the user labels are defined correctly.

I tested it on CubeIDE and IAR and I didn't face any issue.

0693W00000JMdteQAD.pngCould you please repeat the process and share with us the results.

If you issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Thanks,

Sara.

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.
Sara BEN HADJ YAHYA
Technical Moderator
January 24, 2022

Hello @MK8290​ ,

You are totally right, the issue is now confirmed. I had to refresh data to get the same results as you.

The user labels are generated correctly in main.h but they are not used in MX_GPIO_Init() function in main.c file. I submitted a ticket to the development team to fix this issue and I will keep you posted with the updates.

You can still use the user labels in your code since their definition is already done in main.h.

If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Thanks @Community member​  for flagging this to us,

Sara.

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.
Sara BEN HADJ YAHYA
Technical Moderator
November 28, 2022

Hello ​@MK8290​ ,

This issue is fixed in STM32CubeMX latest release.

V6.7.0 is now available under this Link.

Thanks for your contribution :smiling_face_with_smiling_eyes:

Sara.

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.