Use VECT_TAB_OFFSET from upload method#111
Use VECT_TAB_OFFSET from upload method#111dmlambo wants to merge 1 commit intoCommunityGD32Cores:mainfrom
Conversation
Add bootloader flags to compilation of c, cpp and S files.
| #define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ | ||
|
|
||
| #define VECT_TAB_OFFSET (uint32_t)0x00 /* vector table base offset */ | ||
| //#define VECT_TAB_OFFSET (uint32_t)0x00 /* vector table base offset */ |
There was a problem hiding this comment.
I don't see a
#ifndef VECT_TAB_OFFSET
#define VECT_TAB_OFFSET ...
#endif here to allow a user-overridable value, would that not mean that this file tries to use a hardcoded vector table offset?
There was a problem hiding this comment.
It's pulled in from platform.txt. The variable build.bootloader_flags=-DVECT_TAB_OFFSET={build.flash_offset} wasn't being used anywhere. flash_offset is being used to inform the linker script through LD_FLASH_OFFSET={build.flash_offset}.
There was a problem hiding this comment.
But if -DVECT_TAB_OFFSET={build.flash_offset} is additionally set as global compiler settings, would that not cause a "VECT_TAB_OFFEST redefined" warning in GCC when compiling this file like in https://stackoverflow.com/a/73518725?
There was a problem hiding this comment.
Indeed it would, so the correct way for the user to override it would be setting build.flash_offset.
Add bootloader flags to compilation of c, cpp and S files.