SchmalzHaus logoHEXMATE.EXE Instructions


Hexmate.exe is a command line program for Windows that Microchip publishes with it's Hi-Tech tool suite. (Microchip acquired Hi-Tech and hexmate.exe was part of the Hi-Tech tools for a long time.) It is the best tool for combining hex files that I have found. It is very easy to use and does a very good job. Oh, and it comes for free as part of Microchip's MPLAB X install.  You can find it at C:\Program Files (x86)\Microchip\MPLABX\mplab_ide\bin\hexmate.exe (on Windows 64, adjust first part of path based on your OS). If you just want to download hexmate itself, please see the link below.

The UBW, UBW32 and EBB boards all use a USB based bootloader. This allows users to update or change the firmware on the boards without using a hardware programmer. Instead, the new firmware is transferred over the USB from an application on the PC and then burned into Flash on the board. This works very well and is very easy to use, but it means that there are two separate programs that need to be loaded onto the board's Flash - first the bootloader and then the actual firmware application.

These two programs are developed separately and built as separate HEX files. Once the two HEX files have been created, there are two ways to get these HEX files onto a board:

For speed's sake, the second method is used for production. Thus there is a need to combine HEX files into one. Hexmate.exe is the right tool for that job, this page explains how to use it.


Microchip has been kind enough to grant us permission to distribute Hexmate.exe from this website. So you can pick up a copy right here without downloading a larger package from Microchip


You can do some very complicated things with hexmate, but the most common thing to do is to combine two hex files into one. Let's say you have a bootloader file called boot.hex and a firmware file called firmware.hex. You want an output file called combined.hex. So put both files in the same directory, put hexmate.exe there as well (or put it in your path), then open a command window and navigate to the directory. Then type:
hexmate boot.hex firmware.hex -Ocombined.hex
If there are any sections of the two hex files that overlap, hexmate will complain and not output a file. You can either choose to fix the problem by re-building the offending hex file, or you can ask hexmate to use the second file's data as the 'winner' of the conflict by using
hexmate boot.hex +firmware.hex -Ocombined.hex
There are a lot of other options for hexmate.exe. For a complete list, and for complete documentation, see section 6.6 of the HI-TECH PICC compiler manual (called manual.pdf, installed by default to C:\Program Files\HI-TECH Software\PICC\9.70\docs\manual.pdf). Or run hexmate.exe --help from the command line.

Questions? E-mail me at my e-mail address

Creative Commons License
UBW32 USB Bit Whacker by Brian Schmalz is licensed under a Creative Commons Attribution 3.0 United States License.
Based on a work at
Permissions beyond the scope of this license may be available at