Skip to main content
Associate II
March 16, 2025
Solved

STM32H503 External Interrupt HAL Library Doesn't work

  • March 16, 2025
  • 3 replies
  • 1772 views

Dear All,

Recently I am learning STM32H503CBU6, but I find the external interrupt doesn't work with HAL library. I want to get reference from official example code, I only find external interrupt example code with LL library in official SDK. I think STM32H5x HAL should support external interrupt. My code and CUBEMX setting showed as below. Could you kindly help advise about this problem?

Thanks for your help so much!

Best regards,

Gerald 

 

 

Screenshot 2025-03-15 234431.png

Screenshot 2025-03-15 234452.png

Screenshot 2025-03-15 234210.png

Screenshot 2025-03-15 234233.png

Gerald_W_1-1742108537983.png

 

 

This topic has been closed for replies.
Best answer by TDK

Looks right it's calling the right functions to me.

Does EXTI5_IRQHandler get called? Set a breakpoint.

Does the IDR5 bit in GPIOB->IDR bit 5 get toggled as the line is toggled?

 

Example:

STM32CubeH5/Projects/NUCLEO-H533RE/Examples/GPIO/GPIO_EXTI/Src/main.c at 047a3e84bc870a5609d2f9f38c74caf20d033403 · STMicroelectronics/STM32CubeH5

3 replies

TDK
TDKBest answer
March 16, 2025

Looks right it's calling the right functions to me.

Does EXTI5_IRQHandler get called? Set a breakpoint.

Does the IDR5 bit in GPIOB->IDR bit 5 get toggled as the line is toggled?

 

Example:

STM32CubeH5/Projects/NUCLEO-H533RE/Examples/GPIO/GPIO_EXTI/Src/main.c at 047a3e84bc870a5609d2f9f38c74caf20d033403 · STMicroelectronics/STM32CubeH5

"If you feel a post has answered your question, please click ""Accept as Solution""."
Gerald_WAuthor
Associate II
March 16, 2025

Hi TDK,

Thanks for your replying a lot. I compared the example you provided and my code, and I found the callback function was different. After I can changed as below, it works. Is it new feature of HAL?

Gerald_W_0-1742165213818.png

Thanks,

Gerald

TDK
March 16, 2025

It's been that way as long as the H5 HAL has existed (2 years).

Blaming stm32h5xx-hal-driver/Inc/stm32h5xx_hal_gpio.h at 8c41bbe0b445f5036163d2ac637b50962d8b2f21 · STMicroelectronics/stm32h5xx-hal-driver

 

On some other families, it is HAL_GPIO_EXTI_Callback because there's no way to know in general if it's due to a falling or rising edge.

"If you feel a post has answered your question, please click ""Accept as Solution""."