Search code examples
embeddedstm32f4discovery

why Flash global interrupt handler not defined in stm32 startup code?


I am trying to implement stm32f407 drivers from bare-metal, I didn't have any problem until I came to interrupt the handler for flash memory operations.

clearly on page 372 in the reference manual (Vector table for STM32F405xx/07xx and STM32F415xx/17xx), it shows that the address of the flash interrupt handler is at 0x0000 0050. but when I opened the startup code provided by stm32, I found this:

  .word RTC_WKUP_IRQHandler                     /* RTC Wakeup interrupt through the EXTI line                         */
  .word 0                                       /* Reserved                                                           */
  .word RCC_IRQHandler                          /* RCC global interrupt    

so for some reason, the address for the flash interrupt handler function is reserved in the startup code, but the reference manual says:

enter image description here

so I really don't understand why ST decided to reserve this address in its startup code?


Solution

  • Are you using a recent version of CubeIDE etc? I just made a project (in version 1.12.0 of STM32CubeIDE) and I see this in startup_stm32f407vetx.s:

      .word     RTC_WKUP_IRQHandler     /* RTC Wakeup through the EXTI line */
      .word     FLASH_IRQHandler        /* FLASH                        */
      .word     RCC_IRQHandler          /* RCC                          */