My board: STM32F407G-DISC1 (based on STM32F407VGT6 microcontroller)
See reference manual. (pages around 371 are related)
My understandings
Each interrupt service routine is located in a memory address, and this memory addresses are hold in NVIC vector table. Normally, we have weak declarations of those interrupt service routine(callback) functions in startup.s
file. So, overwriting them in a .c
file, in main.c
for example, will be enough to use them. Those names are defined strictly, and one have to use same names, for example : EXTI0_IRQHandler()
However, we also have VTOR
, Vector Table Offset Register, by which I can relocate vector table to another memory region, and can use my customly defined callback functions with different names by writing their memory addresses(function address) to the new memory location of the corresponding interrupt vector.
So far, everything is fine, I confirmed that when I relocated the vector table by VTOR
, the old names are useless unless, i.e, just defining an ISR function named as EXTI0_IRQHandler()
is not sufficient without further work(writing its address to new vector table location for EXTI0).
Question
At this point, one thing confused me, even I migrate/move the NVIC vector table, pressing the black button(reset button) on the board resets the microcontroller still. But I would expect reset not to work since the ISR pointer for Reset_Handler()
is not defined/found in the new location of the vector table.
My guess: Reset_Handler()
does not move with NVIC vector table, always located at 0x0000 0004
, and its definition is in startup.s
. So, it will be the same.
I assume I have some conceptual misunderstanding in this. Can you point what is wrong with my thinking?