I use Arduino for STM32. I need to place interrupt vectors table at a different address to use my firmware with bootloader.
For moving the interrupt vectors table, I need to change the preprocessor #define
VECT_TAB_ADDR which is defined in
Supplying new value was easy - just add
-D VECT_TAB_ADDR=whatever to
build_flags. But the compiler throws a warning that preprocessor symbol was redefined. If I enable verbose compiler output, I see that VECT_TAB_ADDR is defined on the command line twice.
So, the removing of old symbol value is where I’m stuck.
build_unflags - doesn’t work.
I tried adding
extra_scripts = post_extra_script.py to
platformio.ini. The contents of
Import("env") env.Replace(CPPDEFINES=[d for d in env['CPPDEFINES'] if d != ('VECT_TAB_ADDR', 134217728)])
So that it should remove the definition. Doesn’t work! The firmware is built with old value of VECT_TAB_ADDR. Looks like the CPPDEFINES are already cached somewhere else at the time my extra script is run, and changing them doesn’t influence anything.
How can it be done without editing
stm32f1.py deep in STM32 platform tree?