So I have an interesting problem. I have a F103 module, which we have a custom (CAN based) bootloader, which is written in STM32CubeIDE. I would like the option of writing code using the STM32dunio core, mostly for library/peripheral testing, but also much quicker to bring code online.
The jump from our bootloader is a pretty standard approach, and usually in our application (written in CubeIDE) we can just make sure the vector table is relocated at the start of the application:
Code: Select all
SCB->VTOR = 0x08002800U;
from system\SMT32F1xx\system_stm32f1xx.c:
Code: Select all
/* Note: Following vector table addresses must be defined in line with linker
configuration. */
/*!< Uncomment the following line and change the address
if you need to relocate your vector Table at a custom base address (+ VECT_TAB_OFFSET) */
/* #define VECT_TAB_BASE_ADDRESS 0x08000000 */
/*!< Uncomment the following line if you need to relocate your vector Table
in Sram else user remap will be done by default in Flash. */
/* #define VECT_TAB_SRAM */
#ifndef VECT_TAB_OFFSET
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
#endif
#ifndef VECT_TAB_BASE_ADDRESS
#if defined(VECT_TAB_SRAM)
#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
#else
#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
#endif /* VECT_TAB_SRAM */
#endif /* VECT_TAB_BASE_ADDRESS */
...
/* Configure the Vector Table location add offset address ------------------*/
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET;
Code: Select all
#define VECT_TAB_OFFSET 0x00002800U
I am using the "Export Compiled Binary" option to generate a BIN which we load into our bootloader host application for transmitting to the target.
Any idea why this isn't working and/or what additional defines I need to add to the sketch to get the Vector table to jump appropriately when using this core?
Cheers