I was working on some of my projects involving Atmel AVR development and, as the code got bigger and bigger, it didn’t fit into the flash anymore.
I needed a tool to show me the binary size of the HEX files the IDE was generating, but to no avail. Converters on the Internet were either too complicated, either part of a programming tool, either in Chinese, either not working at all.
So I wrote my own version of a tool that converts from Intel HEX to binary and viceversa files up to 10Mbytes. The tool runs fine on Windows XP, Windows 7, Windows 8, Windows 8.1 and Windows 10.
It works in a very simple way: Load either Hex or binary files, save them as either Hex or binary. The “file length” caption shows the binary bytes, not the number of bytes actually on the file. Very useful to see if we went over the microcontroller flash or eeprom capacity.
Because a Intel HEX file may load not contiguous data and leave memory blocks not addressed, the application automatically fills all the memory block with 0xFF (not programmed memory location).
The hex editor works this way:
After loading a file, double click on the panel displaying the file name and a hex editor will appear:
Data may be edited, deleted or inserted. Once data is modified, the status bar will indicate this, along with the new size of the data:
At this time, whenever the editor window or the main application is closed, warning dialogs will pop up, telling you that data is modified and that it should be saved.
Saving data in either format or loading a new file resets both the app and the editor, suppressing the warnings pop-ups until a new data edit is performed.
After using the editor to alter data, double clicking on the file name does not reload the file but shows the modified data into the editor instead.
In case one wishes to repeat the same conversion over and over during a project development, pressing the “Silent Op” button after having performed one conversion will redo that conversion silently, without popping the dialog windows for file names. Also, upon performing the first conversion manually, the tool remembers file names but also file types, and sets the radio buttons accordingly.
The “Silent Op” button does not do data manipulation. It just loads a file, converts it according to your choice and saves it.
This tool was written in Pascal and compiled with the free pascal IDE, Lazarus.
The hex editor is provided as-is by tkweb, here.
The tool is free for non commercial use.
Download here the Lazarus source files, including the hex editor package.
Download here the zipped Windows executable.