CubeIDE incorrectly generates the initial code of EXTI handlers: namely, it substitutes the wrong names with User Labels
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-12-08 11:35 PM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-01-13 12:47 AM
Hello @AFinn.1 ,
Thanks for your feedback,
This issue was already detected with other STM32 and raised to the development team. I'll keep you posted with the updates.
** Taking the example of PC6 and PA6, both pins CAN be configured as GPIO_EXTI6 **
- PC6 configured as a GPIO_EXTI6, user Label EXTI_PC6 and interrupt enabled in NVIC settings
- PA6 configured as an Output, user label Output_PA6
In EXTI9_5_IRQHandler(), user will find the following HAL_GPIO_EXTI_IRQHandler(Output_PA6_Pin) instead of HAL_GPIO_EXTI_IRQHandler(EXTI_PC6_Pin);
Workaround :
Either remove PA6 user label or set its state to reset state, this will give you a correct generated code.
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 :)
Thanks @Imen DAHMEN and @Peter BENSCH for flagging this to us.
Sara.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-12-08 11:52 PM
How to fix that?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-12-08 11:52 PM
CubeIDE generates the source code of EXTI handlers incorrectly: inserts the wrong names into the HAL_GPIO_EXTI_IRQHandler () handler with custom labels
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-12-09 12:08 AM
Welcome, @AFinn.1, to the community!
You have marked GPIO_PIN_6 in the third and fourth screenshots, but they each belong to different GPIO ports:
- ADC2_nRESET = PA6
- CS = PC6
This is also listed in the lines below that defines the GPIO port:
- ADC2_nRESET_GPIO_Port GPIOA
- CS_GPIO_Port GPIOC
Regards
/Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-01-07 8:57 AM
Hello, in my opinion this is an issue. If you define two User Labels (in my case analog input PA1 as ABC and EXTI PB1 as DEF) configuration tool will generate automatically in main.h:
#define ABC_Pin GPIO_PIN_1
#define ABC_GPIO_Port GPIOA
.
#define DEF_Pin GPIO_PIN_1
#define DEF_GPIO_Port GPIOB
..
than in stm32f1xx_it.c configuration tool will use incorrect User Label automatically generating interrupt handler
void EXTI1_IRQHandler(void)
{
/* USER CODE BEGIN EXTI1_IRQn 0 */
/* USER CODE END EXTI1_IRQn 0 */
HAL_GPIO_EXTI_IRQHandler(ABC_Pin); <------------in my opinion should be DEF_Pin
/* USER CODE BEGIN EXTI1_IRQn 1 */
/* USER CODE END EXTI1_IRQn 1 */
}
I know, that finally that both ABC_Pin and DEF_Pin have same value, but it is a little bit frustrating
Best Regards, Boguslaw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-01-10 12:00 AM
Thanks, Boguslaw, that's indeed a bug and will be transferred to the CubeMX team.
Regards
/Peter
@Imen DAHMEN It is easy to recreate: PA1=ADCx, PB1=GPIO_EXTI1, NVIC=ENBL EXTI -- generates exactly the code shown by Bogulaw for EXTI (confirmed with several STM32).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-01-10 2:23 AM
Tank you, Peter.
Regards, Boguslaw
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-01-12 7:31 AM
Hello All,
Thanks for bringing this issue to our attention.
I added @Sara BEN HADJ YAHYA from CubeMx team for review.
Thanks
Imen
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-01-13 12:47 AM
Hello @AFinn.1 ,
Thanks for your feedback,
This issue was already detected with other STM32 and raised to the development team. I'll keep you posted with the updates.
** Taking the example of PC6 and PA6, both pins CAN be configured as GPIO_EXTI6 **
- PC6 configured as a GPIO_EXTI6, user Label EXTI_PC6 and interrupt enabled in NVIC settings
- PA6 configured as an Output, user label Output_PA6
In EXTI9_5_IRQHandler(), user will find the following HAL_GPIO_EXTI_IRQHandler(Output_PA6_Pin) instead of HAL_GPIO_EXTI_IRQHandler(EXTI_PC6_Pin);
Workaround :
Either remove PA6 user label or set its state to reset state, this will give you a correct generated code.
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 :)
Thanks @Imen DAHMEN and @Peter BENSCH for flagging this to us.
Sara.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-03-07 11:16 PM
