HAL library 04- EXTI for STM32Fxxx

EXTI library is used to set GPIO pin as external interrupt. It is designed to easily enable/disable interrupt and handle irq requests.

If you don’t know how EXTI works on STM32F4 or STM32F7 lines, you should take a look here.


Read more about new HAL libraries


  • Allows up to 16 external interrupts at a time
  • Allows to setup rising or falling edge for pin
  • Allows to disable interrupt
  • Single function for interrupt handling
  • Works for STM32F0, STM32F4 and STM32F7 series


  • HAL
  • TM
    • STM32Fxxx HAL
    • defines.h
    • GPIO

Library interrupt handling

STM32F4/7 has 7 interrupt handler function. They are all implemented in my library and all handlers calls one function, which is single callback function for different EXTI lines. On bottom example you will be able to see how to handle interrupts with single function.

For STM32F0, there are 3 interrupt handlers. They are also implemented in my library and all of them calls one function. Check example on the bottom.

Functions and enumerations


Project is available on my Github account, download all libraries below.


Owner of this site. Application engineer, currently employed by STMicroelectronics. Exploring latest technologies and owner of different libraries posted on Github.

You may also like...

Read before commenting!

Before you make a new comment, make sure you agree with things listed below:

  • - Read post to make sure if it is already posted what you are asking for,
  • - Make sure you have the latest version of libraries used in your project,
  • - Make a clean and grammatically correct written message,
  • - Report as many details as possible, including what have you done so far,
  • - Do NOT post any code here. Use Pastebin,
  • - Do NOT post any error codes here. Use Pastebin,
  • - Specify STM32Fxxx family and used Discovery/EVAL/Nucleo or custom made board,
  • - Make sure your clock is set correct for PLL,
  • - If you are using my HAL drivers, please check this post how to start.
Comment will be deleted on breaking these rules without notification!