Summary
fix LD_FLASH_OFFSET build flag in platformio-build.py. Previously, setting LD_FLASH_OFFSET or VECT_TAB_OFFSET would be overridden by the builder. This small patch allows you to actually set the build flag manually (e.g. for custom bootloader applications). I also added a little warning for when the aforementioned parameters get overridden by the builder.
This PR fixes/implements the followingfeatures
motivation
i am implementing my own BLE OTA bootloader for the STM32WB55, so i need to compile code with a vector table (VTOR) offset. For an applied example, seethis example sketch
Validation
i'm not entirely sure how to demonstrate that it's working, so here is an excerpt of builder output after setting:
build_flags = -Wl,--defsym=LD_FLASH_OFFSET=0xF000 ; Note: offset value must be a multiple of 0x200
Processing OTA_z_STM32WB55 (platform: ststm32; board: nucleo_wb55rg_p; framework: arduino)--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` optionCONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_wb55rg_p.htmlPLATFORM: ST STM32 (16.0.0) > P-Nucleo WB55RGHARDWARE: STM32WB55RG 64MHz, 192KB RAM, 512KB FlashDEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)PACKAGES: - framework-arduinoststm32 @ 0.0.0+sha.ddd6e9c - framework-cmsis @ 2.50700.210515 (5.7.0) - tool-dfuutil @ 1.11.0 - tool-openocd @ 3.1200.0 (12.0) - tool-stm32duino @ 1.0.2 - toolchain-gccarmnoneeabi @ 1.100301.220327 (10.3.1)existing LD_FLASH_OFFSET link-flag found: 0xf000 Setting VECT_TAB_OFFSET accordinglyLDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldfLDF Modes: Finder ~ chain, Compatibility ~ softFound 15 compatible librariesScanning dependencies...Dependency Graph|-- STM32duinoBLE @ 1.2.5|-- STM32WB55_custom_arduino_bootloaderBuilding in release modeCompiling .pio\build\OTA_z_STM32WB55\FrameworkArduinoVariant\PeripheralPins.c.oCompiling .pio\build\OTA_z_STM32WB55\FrameworkArduinoVariant\generic_clock.c.oCompiling .pio\build\OTA_z_STM32WB55\FrameworkArduinoVariant\variant_P_NUCLEO_WB55RG.cpp.oCompiling .pio\build\OTA_z_STM32WB55\FrameworkArduinoVariant\variant_generic.cpp.oCompiling .pio\build\OTA_z_STM32WB55\SrcWrapper\src\HAL\stm32yyxx_hal.c.oCompiling .pio\build\OTA_z_STM32WB55\SrcWrapper\src\HAL\stm32yyxx_hal_adc.c.o...
where the line of important is:
existing LD_FLASH_OFFSET link-flag found: 0xf000 Setting VECT_TAB_OFFSET accordingly
Code formatting
(i couldn't find the style guide?)
Summary
fix LD_FLASH_OFFSET build flag in platformio-build.py. Previously, setting LD_FLASH_OFFSET or VECT_TAB_OFFSET would be overridden by the builder. This small patch allows you to actually set the build flag manually (e.g. for custom bootloader applications). I also added a little warning for when the aforementioned parameters get overridden by the builder.
This PR fixes/implements the followingfeatures
motivation
i am implementing my own BLE OTA bootloader for the STM32WB55, so i need to compile code with a vector table (VTOR) offset. For an applied example, seethis example sketch
Validation
i'm not entirely sure how to demonstrate that it's working, so here is an excerpt of builder output after setting:
where the line of important is:
Code formatting
(i couldn't find the style guide?)