This is a shot in the dark and a cry for help.
I am writing a simple bootloader for STM32 F103 series using Arduino IDE.
I figured all the settings and am pretty sure I have set the linker loader script and VTOR table right.
I am confident of that because when I load the target firmware to 0x80080000 address with the cube programmer it works fine and VTOR is set correctly.
However, when I jump to the firmware from the bootloader, the VTOR is not set to 0x8008000! It remains 0x8000000. No idea why!
It is such a simple code and yet, something does not work.
Have you encountered any issues with F103 line?
void boot_jump2Address(const uint32_t address)
{
uint32_t appStack;
pFunction appEntry;
// Serial.print("boot_jump2Address=0x"); Serial.println((uint32_t)address, HEX);
// get the application stack pointer (1st entry in the app vector table)
appStack = (uint32_t)*((__IO uint32_t*)address);
// Serial.print("appStack=0x"); Serial.println((uint32_t)appStack, HEX);
// Get the app entry point (2nd entry in the app vector table
appEntry = (pFunction)*(__IO uint32_t*)(address + 4);
// Serial.print("appEntry=0x"); Serial.println((uint32_t)appEntry, HEX);
delay(1000);
HAL_RCC_DeInit();
HAL_DeInit();
SysTick->CTRL = 0;
SysTick->LOAD = 0;
SysTick->VAL = 0;
// Reconfigure vector table offset to match the app location
delay(100);
__disable_irq();
SCB->VTOR = 0x8008000;
__DSB();
__enable_irq();
__set_MSP(appStack); // Set app stack pointer
appEntry(); // Start the app
while (1); // never reached
}