Skip to content

5. Determining the load address

Method: decode every GOTO/CALL pair (0xEF/0xEC/0xED followed by a word whose top nibble is 0xF), reconstruct the 20-bit word address, double it to get a byte address, then for a candidate base count how many targets fall inside the image and, of those, how many are immediately preceded by a flow terminator (RETURN, RETFIE, RESET, RETLW, the second word of a GOTO, or a BRA). A correct base makes almost every target land on a function boundary; a wrong base does not.

Calibration on the One, where the base is independently known from the update file's destination:

base in range boundary hit
0x000000 0 / 1315 0.0%
0x010000 7 / 1315 14.3%
0x020000 1308 / 1315 (99.5%) 98.9%
0x030000 0 / 1315 0.0%

Harmony 600 dump:

base in range boundary hit
0x000000 232 / 1362 13.4%
0x008000 1043 / 1362 18.9%
0x009000 1181 / 1362 (86.7%) 99.0%
0x010000 1130 / 1362 27.3%

Harmony 700 Region_2, the untruncated arch 14 image:

base in range boundary hit
0x000000 801 / 1638 11.9%
0x008000 1436 / 1638 19.2%
0x009000 1638 / 1638 (100.0%) 98.5%
0x00A000 1554 / 1638 30.1%
0x010000 1238 / 1638 12.0%

The 700 gives a clean 100% in-range result because the image is complete. The 600 falls short of 100% only because of the truncation: its 181 out-of-range targets all lie in 0x01900A to 0x01A292, that is, in the missing tail. Zero targets fall below 0x009000 on either arch 14 image, which is what fixes the base.

Corroboration: the lowest branch target is 0x00904C on both the 600 0.2 and the 700 2.8, that is, the same first function address in two different firmware versions for two different models. Same link map, same codebase.

The 7 stragglers on the One target a 5-entry vector table in internal flash at 0x01E00C, 0x01E00E, 0x01E010, 0x01E012, 0x01E014. That looks like the bootloader's exported service routines, plausibly the flash erase and write helpers the application needs in order to reprogram the external flash.


Section 4 | the archive | section 6. Section 5 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.