2022-07-18 06:03 PM
When attempting to initialize a single GPIO EXTI as disabled, the generated code still enables the interrupt. I did notice that if I uncheck all of the EXTI lines, then none of them are enabled in the generated code. So it seems it's all or nothing. Is this the expected behavior?
Thanks,
Frank
This:
Generates:
/* EXTI interrupt init*/
HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(EXTI0_IRQn);
HAL_NVIC_SetPriority(EXTI2_IRQn, 6, 0);
HAL_NVIC_EnableIRQ(EXTI2_IRQn);
HAL_NVIC_SetPriority(EXTI3_IRQn, 6, 0);
HAL_NVIC_EnableIRQ(EXTI3_IRQn);
HAL_NVIC_SetPriority(EXTI4_IRQn, 6, 0);
HAL_NVIC_EnableIRQ(EXTI4_IRQn);
However, this:
Generates:
/* EXTI interrupt init*/
HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0);
HAL_NVIC_SetPriority(EXTI2_IRQn, 6, 0);
HAL_NVIC_SetPriority(EXTI3_IRQn, 6, 0);
HAL_NVIC_SetPriority(EXTI4_IRQn, 6, 0);
Solved! Go to Solution.
2022-07-29 07:10 AM
Hello @FLomb.2 (Community Member) & @KnarfB (Community Member) ,
Thanks for your feedback,
This is a known issue and it is already raised to the dev team. When "Generate enable in init" is unchecked, its respective HAL_NVIC_EnableIRQ(XXXX_IRQn) should not be generated.
I will keep you posted with updates
Internal ticket number: 129363 (This is an internal tracking number and is not accessible or usable by customers).
If your 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.
2022-07-18 09:41 PM
Confirmed on NUCLEO_STM32G431KB PA4 and PB0. Flagged as bug-report.
hth
KnarfB
2022-07-20 04:59 AM
Hi @FLomb.2 & @KnarfB ,
Thanks for reporting the issue and adding relevant topics.
I add @Sara BEN HADJ YAHYA & @Khouloud OTHMAN to investigate it and take relevant actions.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-07-29 07:10 AM
Hello @FLomb.2 (Community Member) & @KnarfB (Community Member) ,
Thanks for your feedback,
This is a known issue and it is already raised to the dev team. When "Generate enable in init" is unchecked, its respective HAL_NVIC_EnableIRQ(XXXX_IRQn) should not be generated.
I will keep you posted with updates
Internal ticket number: 129363 (This is an internal tracking number and is not accessible or usable by customers).
If your 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.
2023-12-13 02:17 AM
The call to HAL_NVIC_EnableIRQ(XXXX_IRQn) seems to be correctly omitted when the initialization code is generated in main.c. It is erroneously called when the initialization code is generated in gpio.c.
See my related bug report: https://community.st.com/t5/stm32cubemx-mcus/bug-report-exti-irq-erroneously-enabled-when-initializing-in/m-p/619087