cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: Pins with similar labels get same label in code

DLoec.1
Associate

I named one pin aLoadcell- and another aLoadcell+ in STM32CubeMx (v6.6.1). They both got the same C #define in the code, as both the '-' and the '+' were replaced by a '_'.

#define aLoadCell__Pin GPIO_PIN_2
#define aLoadCell__GPIO_Port GPIOC
#define aLoadcell__Pin GPIO_PIN_3
#define aLoadcell__GPIO_Port GPIOC

STM32CubeMx should check on uniqueness of all (pin) labels.

2 REPLIES 2
Bob S
Principal

And it should never silently change or ignore the user's input.

And as you saw it silently changes those invalid variable/define name characters to underscores and you end up with duplicate defines.

Interestingly, at least up through CubeMX 6.5.0, if I name two pins with the same names, i.e. both PA8 and PB8 as "SOMEPIN", CubeMX silently renames one of them to include the pin number. For example, for the 2nd pin (PB8), the name becomes "SOMEPINB8". So it appears CubeMX checks for duplicate names, but only before it (silently) changes names due to invalid characters.

Ghofrane GSOURI
ST Employee

Hello @DLoec.1​ @Bob S​ 

Thank you for your contributions and for your detailed explanations,

I confirm the issue on my side, it has been reported to STM32CubeMX development team .

Internal ticket number:  148880(This is an internal tracking number and is not accessible or usable by customers).

I will keep you posted with updates.

Thx

Ghofrane