boards/stm32f3: nucleo-f302r8:ihm07m1_b16: enable LTO to fit flash#19454
Merged
Conversation
The ihm07m1_b16 (FOC motor control) configuration overflows the STM32F302R8 64 KiB flash region by ~470 bytes, so it no longer links. Enable GNU Full LTO (CONFIG_LTO_FULL=y); cross-module dead-code elimination brings the image back under the limit (flash drops from ~66.0 KiB to ~57.7 KiB, 88%). Signed-off-by: anjiahao <anjiahao@xiaomi.com>
anjiahao1
requested review from
Donny9,
GUIDINGLI,
pkarashchenko,
raiden00pl and
xiaoxiang781216
as code owners
July 16, 2026 01:30
xiaoxiang781216
approved these changes
Jul 16, 2026
jerpelea
approved these changes
Jul 16, 2026
This was referenced Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
nucleo-f302r8:ihm07m1_b16(FOC motor control) configuration nolonger links: the image overflows the STM32F302R8 64 KiB flash region
by ~470 bytes.
CONFIG_LTO_FULL=y) for this configuration socross-module dead-code elimination brings the image back under the
flash limit.
Impact
memory usage increase, but the image fits flash (88% used vs. previous
overflow).
because the config is otherwise unbuildable within 64 KiB.
Testing
I confirm that changes are verified on local setup and works as intended:
nucleo-f302r8:ihm07m1_b16(STM32F302R8, 64 KiB flash)./tools/configure.sh nucleo-f302r8:ihm07m1_b16 && makeTesting logs before change (link fails — flash overflowed):
Testing logs after change (links cleanly with LTO):
PR verification Self-Check