cancel
Showing results for 
Search instead for 
Did you mean: 

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

MK8290
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Sara BEN HADJ YAHYA
ST Employee

Hello ​@MK8290​ ,

This issue is fixed in STM32CubeMX latest release.

V6.7.0 is now available under this Link.

Thanks for your contribution 😊

Sara.

View solution in original post

7 REPLIES 7
SofLit
ST Employee

Dear @MK8290​ ,

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

SofLit

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.
TDK
Guru

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
Associate II

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
Associate II

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
ST Employee

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.

Sara BEN HADJ YAHYA
ST Employee

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.

Sara BEN HADJ YAHYA
ST Employee

Hello ​@MK8290​ ,

This issue is fixed in STM32CubeMX latest release.

V6.7.0 is now available under this Link.

Thanks for your contribution 😊

Sara.