2024-07-07 11:37 PM - last edited on 2024-07-09 10:40 AM by Tesla DeLorean
within the STM32 Cube IDE After creating a hex file, I noticed that some lines had less data than others due to linker separation. How can I use the STM32 Cube IDE to add dummy bytes to the memory?
Solved! Go to Solution.
2024-07-09 10:38 AM
ALIGN(8) instead of ALIGN(4) at the end of each section ?
2024-07-08 12:09 AM - edited 2024-07-08 12:12 AM
> that some lines had less data than others
Thats "normal" in a (Intel-)HEX file.
see:
https://developer.arm.com/documentation/ka003292/latest/
>to add dummy bytes to the memory
Why ?
2024-07-08 01:27 AM
In order to extract data from a hex file and write it into memory while working on the bootloader, I must do a remote update. In order to accomplish this, I must write 0xffff in a location where there is less data on the specific lines. I now know that the linker script can be used to change it but not How to do that.
2024-07-09 12:21 AM
Other (better) hex generators will add fill bytes for you but I could not see a way to do that here.
Instead you can use fill statements in your linker script as you already understood. There is a nice summary here about how to proceed:
2024-07-09 12:51 AM
Just - erased flash is anyway at 0xFFFF , so why write some extra FF there ?
2024-07-09 08:08 AM
You can do that without postbuild in the linker script and fill the sections by using Align command!
2024-07-09 09:50 AM
When I flashed the .hex file with the STM 32 utility, it automatically divided into two halves and was written appropriately. And I need to write 0xFFFFFFFF at that specific spot if I want to write it manually using the bootloader.
2024-07-09 09:52 AM
Kindly give the commands where it has to be written.
2024-07-09 10:03 AM
This is why it's best not to have your bootloader process Hex files!
Give it a .bin file instead!
2024-07-09 10:38 AM
ALIGN(8) instead of ALIGN(4) at the end of each section ?