2024-10-22 01:11 AM
STM32CubeIDE generates the hex file from elf file using below command.
arm-none-eabi-objcopy -O ihex ${ProjName}.elf ${ProjName}.hex
But when i use the STM32CubeProgrammer, it generates the hex file which is smaller than that of STM32CubeIDE hex generate file.
I wonder what arguments are used in "arm-none-eabi-objcopy" to match the hex file that generated by STM32CubeProgrammer.
2024-10-22 01:32 AM - edited 2024-10-23 08:43 AM
How much smaller?
Did you compare the 2 Hex files - what was/were the difference(s).
Note that there are many different ways to represent the same binary using Intel Hex format - this is why it's generally best not to try to build an embedded Hex reader!
PS:
Another example of why not to try to build an embedded Intel Hex reader:
#IntelHex
2024-10-22 01:52 AM
Hi Andrew,
From STM32CubeIDE hex is 325KB and from STM32CubeProgrammer is 277KB. Yeah I compare it and most of the data were different.
One of the different I notice is that the "gap fill" is zero from STM32CubeProgrammer but from STM32CubeIDE is 0xFF.
The reason i asked is that the hex file that generated from STM32CubeIDE did not run properly but OK from STM32CubeProgrammer generated hex file.
So i am curious about the reason behind it. From my understanding is no matter we generated from STM32CubeIDE or STM32CubeProgrammer, it should be OK but not.
2024-10-22 02:05 AM
I guess the 'gap fill' could make a difference - especially if you're not doing a full chip erase before programming?