No interrupt after the interrupt vector table relocated to SRAM. STM32F072CBTx
- June 24, 2021
- 2 replies
- 4066 views
Hi, there
I am developing a bootloader to upgrade the firmware through CAN. I have done it successfully with a STM32L431CCUx platform. Everything works when the SCB->VTOR is available.
When it comes to this Cortext-M0 core (STM32F072), which has no VTOR, I realized that I need to the followings:
- Reserve the beginning 196 bytes of SRAM to store the Interrupt Vector Table. See ReserveSRAM.png. I did this in the beginning of SystemInit(). I've also tried it in the beginning of main(), failed the same.
- Copy the Interrupt Vector Table of the application to the beginning of SRAM. My application codes starts at 0x08014000. See CopyMemories.png.
- Remap 0x20000000 to 0x00000000. See SYSCFG_CFGR1.png.
However, after I've done all these, the interrupt subroutines in the application code are never called. The SysTick timer interrupt, and any other interrupt if enabled, is always pending. See NVIC.png. The break point at the interrupt handler is never hit. I can trace the firmware from my bootloader all the way to the main application and everything seems to be working fine. The main application hangs inside the HAL SPI driver to wait for the interrupt that never came.
Can anybody point out what I'm missing ?
Thanks,
Regards,
Eric
