2025-07-01 6:15 AM
Setup:
Problem Description:
When enabling RegisterCallback for EXTI Interrupts, the generated code still calls a predefined interrupt callback for EXTI interrupts and does not call the registered callback function.
/**
* @brief Handle EXTI interrupt request.
* @PAram GPIO_Pin Specifies the port pin connected to corresponding EXTI line.
* @retval None
*/
void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin)
{
/* EXTI line interrupt detected */
if (__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != 0x00u)
{
__HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
HAL_GPIO_EXTI_Callback(GPIO_Pin);
}
}
/**
* @brief EXTI line detection callback.
* @PAram GPIO_Pin: Specifies the port pin connected to corresponding EXTI line.
* @retval None
*/
__weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
/* Prevent unused argument(s) compilation warning */
UNUSED(GPIO_Pin);
/* NOTE: This function should not be modified, when the callback is needed,
the HAL_GPIO_EXTI_Callback could be implemented in the user file
*/
}
The generated code sets the correct #define value, but the define value is not referenced anywhere in the code.
#define USE_HAL_EXTI_REGISTER_CALLBACKS 1U
Expected: The interrupt calls the registered callback function instead.
How to reproduce:
2025-07-01 6:31 AM
Hello @JulianHartmer ,
First let me thank you for posting and welcome to the ST Community.
For more investigation, I suggest that you provide your Ioc.File.
Thanks.
Mahmoud
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.
2025-07-01 8:37 AM
2025-07-03 9:17 AM
Hello @JulianHartmer ,
Further to your comment, let me thank you for bringing this issue to our attention.
The issue was reported and raised to the Development team under an internal ticket (Ticket Number : 213411)
Thanks.
Mahmoud
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.