Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

VECT_TAB_OFFSET patch#2134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
thijses wants to merge1 commit intostm32duino:mainfromthijses:main
Closed

VECT_TAB_OFFSET patch#2134

thijses wants to merge1 commit intostm32duino:mainfromthijses:main

Conversation

thijses
Copy link

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

  • LD_FLASH_OFFSET build_flag fix
  • LD_FLASH_OFFSET / VECT_TAB_OFFSET override warning

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

@fpistm
Copy link
Member

Hi@thijses . Thanks for this PR. I guess@valeros would be interested to review it ?

@valeros
Copy link
Contributor

Hi there, thanks for pinging me. While@thijses work was made with the best interests of the project in mind, the changes seem quite project specific to me and can be handled simply by using the combination of thebuild_flags andbuild_unflags options. Additionally, I'm working on a PR with the latest changes to the build script, so the current revision of the PlatformIO build script will receive some minor changes that apparently will conflict with this PR.

fpistm reacted with thumbs up emoji

@fpistm
Copy link
Member

Thanks@valeros for the quick feedback,
If I well understood, you think this change is not requires and user have to use custom flag so this change should not be merged?

@valeros
Copy link
Contributor

If I well understood, you think this change is not requires and user have to use custom flag so this change should not be merged?

That's right, the PR I'm working on should simplify this issue in a bit more generic way.

@fpistm
Copy link
Member

OK.
So@thijses .
I close this PR as it will be deprecated by@valeros future update.

@fpistmfpistm closed thisSep 19, 2023
@fpistmfpistm added the wontfixThis will not be worked on labelSep 19, 2023
@thijses
Copy link
Author

impressively fast response, and fair enough conclusion. Looking forward to@valeros's future update.

P.S., for posterity:
Yes, one can indeed solve it withbuild_unflags:

build_unflags = -Wl,--defsym=LD_FLASH_OFFSET=0x0build_flags = -Wl,--defsym=LD_FLASH_OFFSET=0xF000                     -D VECT_TAB_OFFSET=0xF000

My platformio scripting has been slowly improving, so i genuinely did not know how to make it work with justbuild_ options untill now. Always nice to learn something new!

fpistm and thijses reacted with thumbs up emoji

@fpistm
Copy link
Member

@thijses
@valeros submitetd the PR:#2135 , hope this answer to your need.

@thijses
Copy link
Author

yes indeed, thank you :)

fpistm reacted with thumbs up emoji

@fpistm
Copy link
Member

yes indeed, thank you :)

Mainly thanks to@valeros who was very reactive 😉

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
wontfixThis will not be worked on
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@thijses@fpistm@valeros

[8]ページ先頭

©2009-2025 Movatter.jp