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 #defineVECT_TAB_ADDR which is defined in platforms\ststm32\builder\frameworks\arduino\maple\stm32f1.py.

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 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?

@ivankravets
Yes, I can reproduce it. But I think the way it works now is even better in some aspects. It allows to specifically undefine a build flag with specific content, whereas previously it undefined a build flag with certain name regardless of its content.
Maybe it’s possible to keep both variants of env.ProcessUnFlags?