cancel
Showing results for 
Search instead for 
Did you mean: 

Hex file: adding dummy bytes - STM32 Cube IDE - GNU/LD

Sanjay8344
Associate II

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?

Sanjay8344_0-1720420608647.png

 

12 REPLIES 12

Or have a more sophisticated .HEX parser.

Or post-process .HEX into a more uniform/linear format suitable for the parser and the FLASH line-widths. The data from the linker can have voids, be non-linear (jump around), be sparse, etc and still be technically correct/valid.

Perhaps settings with OBJCOPY or SRECORDS to achieve formatting and padding desired.

But yes, having a binary or otherwise packaged firmware is recommended, allowing for CRC, SHA256, ECSDA signing/authentication. Perhaps compression and/or encryption to complicated reverse-engineering or attack.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

There is no way that a file is changed by a tool! As I said before, you need to check which section ends at 0x800017C and use ALIGN to make sure it fits there! 

Yes, it worked. Thank you.

The dummy bytes are replaced with 0xFF when >FLASH = 0xFF and with 0xFF when = 0xFF.

 

Sanjay8344_0-1721198506955.png