Skip to main content
Visitor II
September 28, 2024
Question

How to set interrupt handler on STM32?

  • September 28, 2024
  • 3 replies
  • 1132 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.

    3 replies

    Super User
    September 28, 2024

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

     

    Graduate II
    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)

    LucazAuthor
    Visitor II
    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?

    Super User
    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 ))