cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate fixed length hex file using STM32CUBEIDE ?

JP_RS
Associate II

I am trying to develop a boot-loader for STM32H7xx micro-controller. For that i need a hex file of my program, i am using STM32CUBEIDE for that but the problem is that my generated hex file length is not same some line is short but i need fixed length hex file for my boot-loader.

How can i create fixed length hex file using stm32cubeide .

2 REPLIES 2
TDK
Guru

You can use command line options to achieve this.

https://community.st.com/s/question/0D50X0000Bq9QQO/post-build-armnoneeabiobjcopy-gapfill0xff-in-stm32cubeide

In case the link breaks in the future, something like: 

arm-none-eabi-objcopy --verbose -S -O binary --gap-fill 0xFF --pad-to 0x08020000 "project.elf" "project.bin"

If you feel a post has answered your question, please click "Accept as Solution".

Perhaps code the loader more robustly, or pre-process the .HEX on the PC side to get it into a normalized/simplified form your loader can digest. Or package it as a binary, with size and signing data to validate its integrity.

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