Skip to main content
Andrew Neil
Super User
March 19, 2026
Solved

Inconsistent generated Pin and Port names

  • March 19, 2026
  • 1 reply
  • 328 views

See Inconsistent pin naming for CubeMX - does the same apply to CubeMX2 ?

 

(Cross-posting at the request of @Ghofrane GSOURI; again, no label available for "Suggestions")

Best answer by MorkBeck

Hi

We have checked the generated code, and it should be solved in CubeXM2. The defines is now called:

/** Primary aliases for RCC_OSC_IN pin */
#define PH0_OSC_IN_PORT HAL_GPIOH
#define PH0_OSC_IN_PIN HAL_GPIO_PIN_0
 
/** Primary aliases for RCC_OSC_OUT pin */
#define PH1_OSC_OUT_PORT HAL_GPIOH
#define PH1_OSC_OUT_PIN HAL_GPIO_PIN_1

 

So there is consistency in the naming. If you find any non consistent naming schemes, please let us know, so we can get them fixed!

1 reply

MorkBeckBest answer
ST Employee
March 20, 2026

Hi

We have checked the generated code, and it should be solved in CubeXM2. The defines is now called:

/** Primary aliases for RCC_OSC_IN pin */
#define PH0_OSC_IN_PORT HAL_GPIOH
#define PH0_OSC_IN_PIN HAL_GPIO_PIN_0
 
/** Primary aliases for RCC_OSC_OUT pin */
#define PH1_OSC_OUT_PORT HAL_GPIOH
#define PH1_OSC_OUT_PIN HAL_GPIO_PIN_1

 

So there is consistency in the naming. If you find any non consistent naming schemes, please let us know, so we can get them fixed!