[STM32 library] Library improvement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-08 4: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
- Debug => no offset
- Release => offset
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-08 5:20 AM
​Hello @Community member​ ,
I will report your feedback to our team for consideration.
Thanks for your contribution.
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-08 7: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;
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-03-08 8: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.
