7.2.3.10 Addressing Hexmate Option

The -addressing=units option specifies the addressing units of any addresses used in Hexmate's command line options.

If this option is not used, units defaults to the value 1 and all addresses specified with Hexmate options are assumed to be byte addresses, that is, each address specifies one byte of data. This matches the addressing used by Intel HEX files. For example, with the addressing units set to the value 1, the option -mask=0F@0-FF will mask any data from HEX file address 0x0 to address 0xFF (inclusive). If the target device is also byte addressable, then this data will be found in the device at the same addresses.

Some device architectures, however, use a native addressing format other than byte addressing. Devices that use 16-bit word addressing, for example, require two uniquely addressed bytes from the HEX file to program a single program memory address, thus there is a mismatch between addresses at which data will be found in the HEX file and the addresses at which that same data will be programmed into the device.

If you prefer to use device addresses with Hexmate options and the device's program memory is not byte addressable, use the -addressing option to specify the mapping between the two address spaces. The argument can be a value from 1 to 4 and indicates the number of HEX file bytes that will be stored at each device address. Use of this option is not mandatory, even with word-addressed devices; however, if it is not used, you must remember that any addresses specified with options refer to HEX file addresses, not device addresses.

The following table shows the units argument that will allow device addresses to be used with Hexmate options, based on the target Microchip device family.
Device familyOption argument
8-bit Baseline, Mid-range, and Enhanced Mid-range PIC MCUs2
PIC18 MCUs1 (default value)
8-bit AVR MCUs2
PIC24 MCUs2
dsPIC DSCs with 24-bit instruction sets2
dsPIC DSCs with 32-bit instruction sets1 (default value)
PIC32 and SAM MCUs and MPUs1 (default value)

For example, if you were using a Mid-range PIC device and you used both the -addressing=2 and -mask=0F@0-FF options, the mask would be performed over the HEX file data that will ultimately be programmed between addresses 0x0 to 0xFF on the device, but in the HEX file, this would be the data located from HEX file address 0x0 to address 0x1FF.