⊕

PRIVATE BROWSER TOOL

Merge Intel HEX firmware files safely

Load two or more images, review their ranges and download one normalized HEX file. Conflicting bytes stop the merge instead of being overwritten silently.

01

Inputs

● Local processing — this file never leaves your browser.
02

Results

⊕

Run the tool to see a structured report here.

ON THIS DEVICE

Recent history

Your latest 10 runs will appear here on this device.

HOW IT WORKS

Method and formulas

All inputs are validated and expanded into address-to-byte maps. Unique ranges and identical overlaps are combined; different values at the same address are reported as conflicts.

Accuracy note

Always compare generated firmware with the target device’s memory map, linker output and programming documentation before flashing.

GUIDE

What this tool does and when to use it

This tool merges multiple Intel HEX firmware files by mapping every byte to its absolute address and producing a single combined output. Engineers commonly employ it when a bootloader occupies the lower address range while an application image starts at a higher offset, or when configuration data must be appended without disturbing existing code sections. The process begins by parsing each input file into an address-to-byte dictionary, discarding any record checksum errors after validation. Once all files are expanded, the tool examines every address for uniqueness or exact matches; identical byte values at the same location are retained once, while mismatched values trigger an explicit conflict report listing the source files and differing data. This approach prevents silent corruption that can occur when simple concatenation utilities ignore address information. Firmware developers use the merger during production builds to combine a verified bootloader binary with an application release and factory calibration constants stored in separate HEX containers. Because the operation occurs entirely within the browser, no firmware data leaves the local machine, preserving confidentiality for proprietary code. The resulting merged file can be downloaded directly or inspected for overlap warnings before flashing to target hardware.

Worked example with realistic numbers

Consider three input files. The bootloader HEX contains data from address 0x00000000 to 0x00000FFF with 4096 bytes of code. The application HEX starts at 0x00001000 and extends to 0x00003FFF. A configuration HEX supplies 128 bytes at addresses 0x0000F000 through 0x0000F07F. After expansion the address map shows no collisions between the three ranges. The merged output therefore contains 4224 bytes total. If the configuration file instead attempted to place a byte at 0x00001000 that differed from the application value, the tool would list a conflict at that exact address together with the two source filenames and the two byte values. A table of the first few addresses illustrates the mapping:

AddressByte ValueSource
0x000000000xE0bootloader.hex
0x000000010xFFbootloader.hex
0x000010000x12application.hex
0x0000F0000xAAconfig.hex

The final merged HEX file is emitted with contiguous records only where data exists, preserving gaps for erased flash regions.

Formula and method table

InputUnitProcessing StepOutput
Intel HEX recordASCII text lineParse length, address, type, data, checksumAddress-byte pairs
Address rangeHexadecimal 32-bitInsert into sorted mapCombined map
Byte value at address0-255 decimalCompare with existing entryConflict list or merged byte
Final mapAddress-byte dictionaryGenerate standard HEX recordsSingle merged HEX file

Units and conversions notes

Intel HEX addresses are expressed in hexadecimal and represent byte-granular locations in the target memory map. Record type 00 carries data bytes while type 01 marks end-of-file; extended address records of type 02 or 04 adjust the upper address bits when 16-bit fields are insufficient. All byte values remain in the range 0x00 to 0xFF; no endian conversion is performed because the format stores raw bytes. Address arithmetic uses unsigned 32-bit integers internally, allowing coverage up to 4 GB although practical flash devices rarely exceed 16 MB. When gaps larger than 16 bytes appear between populated regions the output omits those addresses rather than emitting zero-filled records, reducing file size.

Limitations

The tool rejects any input containing checksum failures or malformed record syntax and reports the offending line number. Maximum total data size is constrained by available browser memory, typically supporting combined images up to several megabytes before performance degrades. Overlapping regions with differing data are never resolved automatically; the user must edit source files or accept the conflict report. The merger does not interpret segment or start-address records beyond storing their data; execution start information must be supplied by the final flashing utility. No encryption or authentication of input files is performed.

Common mistakes

Users sometimes supply files whose base addresses were generated with different linker scripts, producing unexpected overlaps at the same numeric address despite originating from separate memory banks. Another frequent error is neglecting to verify that the merged result still fits within the target microcontroller flash size after combination. Attempting to merge files that contain the same data at identical addresses but were produced by different compiler versions can mask subtle differences if only the first file is retained. Finally, omitting the conflict report review before flashing has led to devices that boot the bootloader yet crash when the application attempts to read configuration data that was never written.

LONG-FORM ANSWERS

Frequently asked questions

How does the merger handle two identical byte values written at the exact same address from separate HEX files?

The duplicate entry is stored once in the final map and no conflict is raised. The source filename of the first encountered value is recorded for traceability.

What address width does the output HEX file use when input files contain type-04 extended linear address records?

The output preserves 32-bit addressing and emits type-04 records only when necessary to represent addresses above 0xFFFF. All data bytes remain correctly placed regardless of original record width.

Can the tool merge files whose data regions cross a 64 KB boundary?

Yes. Extended address records are parsed correctly so that bytes at 0x0000FFFF and 0x00010000 are treated as adjacent addresses without artificial truncation.

What happens if an input HEX file contains a data record whose checksum does not match the calculated value?

The file is rejected immediately and the line number plus expected versus actual checksum values are displayed. No partial map is produced.

Does the merger adjust any start-address records present in the bootloader or application files?

Start-address records are parsed but not modified. The final output retains the start address from the first file that supplies one; subsequent start addresses are ignored.

How are gaps between non-contiguous data blocks represented in the downloaded merged HEX file?

Gaps are simply omitted. No zero-filled records are generated, resulting in a compact file that flash utilities interpret as erased memory in those regions.

Is there a limit on the number of input files that can be supplied simultaneously?

Browser memory determines the practical limit. In typical desktop environments eight to ten multi-megabyte HEX files can be processed before JavaScript heap exhaustion occurs.

What information is included in the conflict report when differing bytes collide at one address?

The report lists the numeric address in hexadecimal, the two byte values in hex, and the filenames of the two conflicting source files so the user can decide which data to retain.