cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect pin definitions in interrupt code (CubeMX 6.4.0, FW_G4 1.5.0)

JBrown
Associate II

Processor STM32G473VET, for MDK-ARM

The generated code in stm32g4xx_it.c under EXTI2_IRQHandler() and EXTI15_10_IRQHandler() is passing the incorrect ***_Pin defines to HAL_GPIO_EXTI_IRQHandler(); I believe the port index number may be correct, but the signal is from the wrong port.

e.g.,

Only one of these signals is actually configured as interrupts in CubeMX, however each is on the same index as a configured interrupt on a different port (given the interrupt limitations of 1 per index across all ports, I think this code may actually function).

 HAL_GPIO_EXTI_IRQHandler(M1_FAULT_N_Pin);

 HAL_GPIO_EXTI_IRQHandler(M2_TEMP_FB_ADC_Pin);

 HAL_GPIO_EXTI_IRQHandler(SPI_SCK_Pin);

 HAL_GPIO_EXTI_IRQHandler(WAKEUP_Pin);

 HAL_GPIO_EXTI_IRQHandler(OSC32_OUT_Pin);

2 REPLIES 2
Sara BEN HADJ YAHYA
ST Employee

Hello @Community member​ ,

Thanks for your feedback,

This is a known issue and already raised to the dev team. For more details, please check my answer in this thread CubeIDE incorrectly generates the initial code of EXTI handlers: namely, it substitutes the wrong names with User Labels

Sorry for any inconvenience that this may cause.

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 :)

Sara.

Sara BEN HADJ YAHYA
ST Employee

Hello @Community member​ ​ ,

This issue is fixed in STM32CubeMX latest release.

V6.5.0 is now available under this Link.

When your issue is solved, please close this topic by choosing Select as Best.

Thanks for your contribution.

Sara.