Post build arm-none-eabi-objcopy --gap-fill=0xff in STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-12 12:44 AM
Hello,
I'm using the IDE project properties "MCU Post build outputs" section to enable bin file generation.
The default behavior though is filling non used gaps in output bin with 0x00, Is it possible to override the "arm-none-eabi-objcopy" with "--gap-fill=0xff" to change default behavior? I couldn't find any place to override this in project properties inside the IDE itself... only run it via post build steps manually and disable the "output bin generation" checkbox above.
Thank you.
- Labels:
-
STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-12-12 12:49 AM
I don't know CubeIDE, but filling gaps (unused space) in actual Flash with 0xFF is common practice.
This avoids Flash wear, and keeps the programming times low.
> The default behavior though is filling non used gaps in output bin with 0x00,
This makes sense for RAM areas, or PC/host-based applications.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-21 8:18 AM
I have the same question. I've even set the post-build step command to:
arm-none-eabi-objcopy --verbose -S -O binary --gap-fill 0xFF --pad-to 0x20000 "project.elf" "project.bin"
Set in the STM32CubeIDE project settings as so:
But my binary is not padded to 128 KB even though it is produced. The only output I receive, despite the --verbose setting, is:
copy from `project.elf' [elf32-littlearm] to `project.bin' [binary]
How can I pad my binary out to the full 128 KB flash size using STM32CubeIDE?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-21 8:45 AM
Try --pad-to 0x08020000
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-01-21 9:05 AM
Perfect, that did work. Thanks JW. I didn't realize the pad-to value is an absolute reference relative to the elf file, not a relative offset.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-06 2:29 PM
That was IT Jan.
