Get the latest version of my hex2xxdhex
function in my eRCaGuy_dotfiles repo here: .bash_useful_functions. Copy and paste that function to the bottom of your ~/.bashrc
file. Then, re-source your ~/.bashrc
file with . ~/.bashrc
. Finally, use my hex2xxdhex
function like this:
# pass multiple `.hex` files to convert to `.bin`, `.xxd.hex`, and
# `.xxd_short.hex` files
hex2xxdhex path/to/myfile1.hex path/to/myfile2.hex
# then compare the two output ".xxd.hex" or ".xxd_short.hex" files with `meld`
meld path/to/myfile1.xxd_short.hex path/to/myfile2.xxd_short.hex
meld path/to/myfile1.xxd.hex path/to/myfile2.xxd.hex
In the above comparison of the two *.xxd*.hex
files, you'll see all of the hex chars, followed by the binary/ASCII chars in a column on the right-hand-side, allowing you to more easily identify hex file differences between the two files.
The .xxd_short.hex
files are simply the same as the .xxd.hex
files, except with all lines containing only zeros removed. This way, if your hex file places portions of your firmware at drastically different address locations, all of the padded zeros between the two address locations are removed.
If your initial .hex
file is 3.5 MB, your .bin
file might be 45 MB, your .xxd.hex
file might be 200 MB, and your .xxd_short.hex
file (with all rows of pure zeros) might be 5 MB. meld
can compare two 5 MB files just fine, but it struggles with 200 MB files. That's why I generate the .xxd_short.hex
version too.
Other options: