Reputation: 101
mostly I use STM32F1xx MCUs for my projects. In that MCU a Vector Table Offset is given:
#define VECT_TAB_OFFSET 0x00000000U //copied from system_stm32f1xx.c
I need to change these Offset in case of using a bootloader which is located at Offset 0x00000000
My Main program is located at Offset 0x0000D800.
Now I want to use my bootloader which in made for STM32F1xx on an STM32F0xx. Everything is pretty similar but as I see the STM32F072 has no Vector Table Offset.
I read about it that its necessary that the bootloader copys the VTOR to RAM and move it.
I can't write ASM Code so is there an example or an instruction how to do that? Or is there an easy way to add a Offset Address?
Upvotes: 0
Views: 1705
Reputation: 3524
You're correct, the Cortex M0 doesn't have a VTOR
register, there is however, with your STM32, a way to remap what appears at 0x00000000 during runtime using the SYSCFG->CFGR1
.
You can tell your linker script to place your vector table at the beginning of the embedded SRAM, and then remap that to 0x00000000 using the MEM_MODE
bits of the aforementioned register.
Upvotes: 1