cancel
Showing results for 
Search instead for 
Did you mean: 

User labels for peripherals

Lars Gardien
Associate
Posted on September 12, 2017 at 15:37

I have had hands on the CubeMX user label feature for pin assignments and found it very usefull. It was possible to write application code like HAL_GPIO_TogglePin(my_label_GPIO_Port, my_label_GPIO_PIN), and when the pin assignment changed later on, simply regenerating code using CubeMX would redefine the my_label_GPIO_Port and my_label_GPIO_PIN definitions. No changes in application code needed!

Now correct me if I'm wrong, but I believe no such feature is present for full peripherals. Being able to assign a user label to, say, SPI4 would be great. I would be able to do HAL_SPI_Transmit(my_label, buf, len, 0). If I would want to switch from SPI4 to SPI2 I would only need to do so in CubeMX and be sure to give SPI2 the label my_label again. This way again, no changes in application code are needed.

I came across this old thread:

https://community.st.com/message/136659

where the feature is already discussed. Has the feature been implemented for peripheral renaming? Or is renaming pin assignments solely supported?

Thanks in advance.

Lars

#cubemx #user-labels
1 REPLY 1
Jeanne Joly
Senior III
Posted on February 01, 2018 at 15:06

Hello

l.gardien

,

The user label change functionality is available only for pins and not for peripherals.

However, the user label on peripherals is already under study on our side but I can't confirm for the moment that it will be available under CubeMX in the future.

I will keep you informedas soon as we have some changes on that topic.

BR. Jeanne