binary-databootloaderfirmwarehexdumpmemory-dump

Advantage for hex formats like SREC or Intel HEX


I want to ask if someone can explain me the benefit for using hex formats (e.g. by Motorola S-Record or Intel HEX) over using direct binary images like for firmware or memory dumps?

I understand that it is useful to have some Meta information about the binary file like used memory areas, checksums for data integrity and so on… However, the fact that the actual data size is doubled, because everything will be saved in a hex-ASCII representation is confusing me.

Is the reason for using a hex-ASCII representation only the portability, to prevent problems with systems that have a different byte endianness or are there other benefits?

I found for this topic many tutorials about how to convert binary to hex and backwards or the specifications of the certain formats, but no information about the advantages and disadvantages.


Solution

  • There are a couple of advantages of HEX-ASCII formats over binary image. Here are a couple to start with.

    1. Transport. An ASCII file can be transfered through most mediums. Binary files may not be transferred intact across some mediums.
    2. Validity checks. The HEX file has a checksum on each line. The Binary may not have any checks.
    3. Size. Data is written to selected memory address in the Hex file. The binary image has limited addressing information and is likely to contain every memory location from start address to end of file.