2021-03-08 04:39 AM
Dear,
It's just an idea to improve the STM32 library.
In the "system_stm32fxxx.c" files in the CMSIS folder, the vector table offset is defined as follow :
#define VECT_TAB_OFFSET 0x00
In some product, I use a bottloader, so the vector table is relocated.
And then I have one Debug configuration and one Release configuration, the vector table offset isn't the same in this two configuration
To do this, I need to modify this file.
Why do not add a conditional compilation as is do for the oscillator value in the "stm32fxx_hal_conf.h" file ?
Something like that :
#if !defined (VECT_TAB_OFFSET)
#define VECT_TAB_OFFSET 0x00
#endif
Like that, it is possible to defined the "VECT_TAB_OFFSET" in the project properties proprocessor.
2021-03-08 05:20 AM
Hello @Community member ,
I will report your feedback to our team for consideration.
Thanks for your contribution.
Imen
2021-03-08 07:52 AM
Surely the REAL solution is to avoid all this #define nonsense and just let the linker fix the address with the GD vector table symbol?
ie SCB->VTOR = &__Vectors;
2021-03-08 08:20 AM
Yes, probably, but if I remember correctly, the vector table address isn't define is the same way depending the linker file (IAR or GCC).
And to have something coherent between all libraries files, it more easy to add a conditional compilation.