bug: Invalid PlatformIO option for memory offset #22017
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
A subset of STM32F1 & STM32F4 board definitions are using the option
board_build.address
to specifying the memory location for firmware.The correct option to be used is
board_upload.offset_address
, whichwas added in platformio/platform-ststm32#853208d1. PR #21488
(recently submitted) uses the correct option for some newly added
hardware abstractions, but left this in place for existing hardware.
Using this option presently overwrites the bootloader when using
openocd
and an STLinkV2.For example: https://ask.csdn.net/questions/4185515
This is occurring because the option gets ignored and the default vector
table location of
0x08000000
gets used (which is the location of thebootloader).
NOTE: All changes were made using the following mechanism
sed -i 's/board_build.address/board_upload\.offset_address/g' ini/stm32f{1,4}.ini
No other changes to spacing or validation beyond verification on the
STM32F103RE_btt board. This is confirmed operational with the offset
previously used with the invalid option,
0x08007000
.Requirements
STM32
Benefits
Users with conforming boards should be able to upload directly using OpenOCD without obliterating their bootloader (though it seems this should, long term, really be added to the processor definition as opposed to individual boards).
Related Issues
Affects: