2020-10-14 05:04 AM
Hello!
I have generated with STM32CubeIDE the BIN file and the HEX file from the same application.
Then I used STM32CubeProgrammer to program the MCU, first using the BIN file, and then the HEX file. After each time the MCU is programmed, I have read the flash memory.
I was expecting these two memory dumps to be exactly the same. However, there are 8 bytes that in one of them are zeros (00), and in the other one are ones (FF). It is only 8 bytes out of 131071, but I would like to know why this happens.
Thanks!
Solved! Go to Solution.
2020-10-14 05:18 AM
HEX files can be sparse, unwritten areas of flash will retain their 0xFF erased state. The BIN decribes all bytes, with 0x00 being chosen as the fill byte in this case.
2020-10-14 05:18 AM
HEX files can be sparse, unwritten areas of flash will retain their 0xFF erased state. The BIN decribes all bytes, with 0x00 being chosen as the fill byte in this case.
2020-10-14 05:42 AM
Also with .bin file you have to tell the start address to the programming tool (e.g. 0x8000000 in most cases). With .hex files the addresses are indicated inside.
2020-10-14 06:53 AM
That's great, thanks a lot for the info! That explains it.