Hexmate is a utility application that can perform a variety of tasks on HEX files and is shipped with and executed by the MPLAB® XC8 compiler. The MPLAB X IDE also uses it to merge HEX files in its Loadables folder. Hexmate can produce a log file which is especially useful if you are using any of Hexmate’s features, like checksums, filling the unused memory, or inserting serial numbers.
If you use the XC8 compiler on the command line or in the IDE, a log file is produced by default. The IDE will direct the file to the dist/default/debug|production folder with a project name.hxl filename; the XC8 driver creates a file in the current output folder with the same base name as the first source file specified. If you are explicitly using Hexmate on the command line after building with any compiler (see this article for more information) use the -logfile hexmate option to request generation of this file and specify its name.
The log file shows information relating to the HEX file content, such as unused memory addresses, memory ranges that were filled, serial numbers encoded into the file, address ranges over which checksums (or hashes) were calculated, and checksum results, etc., The following extract obtained from this file shows a checksum result 0xE6C9, calculated from data in the range 0 to 0xFFF, and stored as two bytes starting at 0x2100.
Stored checksum result ranges:
2100h - 2101h
### Checksum Reports ###
Checksum 0 : (0h to FFFh) = E6C9
A text-based map in the log file shows a visual summary of the HEX file content. The following map snippet shows filled locations (F), serial numbers (S), checksums (C), the contribution from the project code (1), and unused locations (-). Remember that addresses shown by Hexmate are always the addresses used by the HEX file, not addresses used by the device.
00001F80: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
00001FC0: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
00002040: ------1111111111SSSS--------------------------------------------
00002100: CC--------------------------------------------------------------
00200000: 11111111--------------------------------------------------------
00300000: 11111111111111--------------------------------------------------
Hexmate can merge two or more HEX files together, but note that a log file is not requested if you are using the IDE to perform merging of files placed in its Loadables folder. The log file produced when using XC8 in the IDE is generated as part of the compilation process and before merging is performed by the IDE. If you perform merging by running Hexmate explicitly, however, the contribution from each file will be shown in the content map in the log file.