Skip to main content
Associate
September 28, 2024
Question

How to set interrupt handler on STM32?

  • September 28, 2024
  • 4 replies
  • 1167 views

How do you call an interrupt hanlder as a result of an interrupt (like systick) in the STM32F4xx library? Do you have to change the value in the vector table to point to the handler manually or how is this handled?

This topic has been closed for replies.

4 replies

Pavel A.
September 28, 2024

Just look at the example projects. Every example has a systick handler.

 

Tesla DeLorean
Guru
September 28, 2024

The names in the vector table of startup.s have weak linkage, so when you define an actual function in those names, it will be that which is called. See perhaps stm32f4xx_it.c

ie void USART2_IRQHandler(void)

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
LucazAuthor
Associate
September 28, 2024

Oh okay thank you so much. Where do i find the startup.s file, cant find it? Is it part of the library or does each project have one?

Pavel A.
September 28, 2024

In the ST example projects, each project has a separate copy of the .s file. You can use a common (template) file in the "Cube library" if you don't need to change it. Can't find it? train your file searching skills ))