STM32 interrupt vector transfer

Good time of day.
According to the theory, the controller based on the ARM CORTEXM3 architecture starts working by loading a pointer to the stack from the zero address, and a pointer to the Reset interrupt from the address 4.
Question two:
-The FIRST null address is available, taking into account the offset at the beginning of the flush (in STM, the flush starts with the address 0x8000000) ? That is, when it says "0x0" it means "0x8000000"? (according to the glee man, this is how it should be)
-SECOND why does the standard initialization function SystemInit() transfer the interrupt vector TO THE SAME ADDRESS AS IN the LINKER ?? Thank you

Author: Сергей Норик, 2017-12-03

1 answers

At startup, the controller actually reads the interrupt table, including the stack pointer, from the null address. The SCB->VTOR register is zero. And the boot ROM is located at the zero address in STM32. All the functions of the boot ROM are known only to the manufacturer, but it is this program that just sets SCB->VTOR to 0x08000000. In the linker script, the constant of the flash memory address is written separately, and further placement of blocks (interrupt tables, code sections, data sections) occurs relative to this constant.

Let's say the controller has already started the program starting from the ResetHandler address, which is stored in the interrupt table. After that, you can safely write any value to the SCB->VTOR register, and the controller will pick up the new interrupt table. Of course, you first need to make sure that the correct interrupt table is located in the new location. This can be useful if you need to change interrupt handlers on the fly.

 2
Author: maestro, 2017-12-19 13:00:24