Skip to content

119. Address 0x200000 is not flash at all: it is the EEPROM, and the boot state machine is in it

The one thing section 118 could not settle. concordance writes 0x02 there to finish a firmware update and calls the destination flash 0x200000, this project adopted that on the client's word, and the address was unreadable because our own validator refused it. All three parts of that are now wrong or resolved, out of the 525's own firmware, and the answer is better than the claim it replaces.

The protocol's "flash" address space is a set of tagged windows

READ_FLASH and WRITE_FLASH take a 24 bit address whose top byte selects a window. Arch 9's validator is an XORLW chain at 0x02E14 in the application image, and identically at 0x01836 in the safe mode image, so both agree and the chain is decoded with chains.py rather than by hand:

top byte offset must be below what it is
0x00 0x8000 internal program flash, 32 KiB
0x20 0x0100 the on chip EEPROM, 256 bytes
0x30 0x0008 eight bytes, and its read arm fetches nothing
0x40 0x0800 data memory, 2048 bytes
0x80 to 0x87 the block the serial flash chip, 512 KiB

Everything else returns RETLW 0x00, refused. The tag is stored in 0xB0 and the read handler dispatches on it at 0x0335A: 0x20 reaches 0x07D68, which is CLRF EECON1, MOVFF into EEADR, BSF EECON1,0, MOVF EEDATA,W, and 0x40 reaches a loop that reads INDF0 through FSR0, which is data memory by definition.

Three closures, none of them fitted to the others. Each bound is a documented size of the PIC18F4550: 256 bytes of EEPROM, 2048 of RAM, 32 KiB of program flash. concordance's own table puts the serial at 0x200010, which is EEPROM offset 0x10 under this reading and inside the 256 byte bound. And the two firmware images, an application and a safe mode image built years apart in the same family, carry the identical chain.

Section 88 was incomplete rather than wrong, and the reason is instructive. It read the validator from 0x02E30 and reported "refuses below 0x80 and at or above 0x88". That is the default arm: the four cases above it are tested first, so the range test only ever sees a top byte that matched none of them. So the sentence describes what an unmatched byte gets, and reading a validator from the middle produced a rule that is true of every input it was tested on and refuses three regions the device serves. packages/usb refused them too, which is why 0x200000 was recorded as unreadable.

The bootloader's boot state machine, read

The 525's bootloader reads EEPROM address 0 at every boot, 0x00AD0, and dispatches on it with another XORLW chain at 0x007AC. Before the chain, two values are folded: 3 becomes 1 and 4 becomes 2.

EEPROM byte 0 what the bootloader does what it writes back
1 or 5 selector 0, install the safe mode image 3, then 6 on success
2 selector 1, install the application 4, then 6 on success
3 handled as 1 as 1
4 handled as 2 as 2
0, 6 or anything else normal boot, install nothing unchanged

The selector is 0x09A, and 0x00422 turns it into an address: 0x010004 when it is 1 and 0x000004 when it is 0, which are the chip offsets of the application and the safe mode image, at +4 because that is firmware_4847_offset and the HG magic. It checks the header there before copying, at four places in the bootloader.

The 4 and the 3 are in progress marks, not resting states, which is the part this section got wrong twice before the remote settled it. Written before the copy, and on success the bootloader overwrites the cell again at 0x0082C: if the install succeeded it puts 6 there and then jumps to 0x01008, the application's entry point past its own header. So the full cycle has one more step than the table above, and the resting value is neither 3 nor 4:

value who writes it what it means
2 a host install the application
1 or 5 a host install the safe mode image
4 or 3 the bootloader, before copying an install is in progress
6 the bootloader, after a successful copy the install finished, tell the user
0 the running image, having seen 6 nothing outstanding, run what is resident

The consumer of 6 is in the application, at 0x07900: it reads EEPROM byte 0, compares it against 6, and if it matches writes 0 back and sets bit 5 of 0x109. That is what makes 6 a message rather than a state, and it is why the cell reads 0 on a healthy remote.

The folds are the power fail interlock, and this is the reading that makes them make sense. 3 and 4 mean "a copy was started and nothing has confirmed it finished", because the confirmation is the 6 and then the 0. A remote that loses power mid copy comes up on a mark, retries, and reaches 6. A remote that finished comes up on 0 and copies nothing, so nothing is reinstalled at every boot.

The failure path is a safety net worth recording. If installing the application fails, either the header check at 0x00422 or the copy at 0x002D4, the value 2 arm does not give up: it branches into the value 1 arm at 0x007F2 and installs the safe mode image instead. So a 525 whose application copy goes wrong lands in safe mode rather than nowhere.

And concordance's byte is confirmed. Writing 2 makes the bootloader install the application. That is exactly FinishFirmware's arch 9 arm, data[0] = 0x02, and it is no longer believed on the client's word: docs/host-client.md loses the entry.

A prediction, before the remote is read

The bench 525 has been stranded in safe mode since 10 August 2026 and is still connected. Under the reading above, its EEPROM byte 0 must be 3: safe mode was installed, the bootloader marked it 3, and every boot since has folded 3 to 1 and done it again.

Falsifiable three ways. A 1 would mean the mark back is not written, so the fold is doing all the work. A 0 or a 4 would mean the state machine is not what latches safe mode and the reading is wrong. Anything above 6 would mean EEPROM address 0 is not this cell at all.

Measured immediately afterwards, on 11 August 2026, over USB, read only, through the window table above:

0x200000  00 ff ff ff 25 ff ff ff ff ff ff ff ff ff ff ff

Byte 0 is zero, so the prediction is wrong, and it is wrong in the third of the three ways listed above. Recorded rather than quietly replaced, because the explanation that fits is better than the one that was predicted and the difference between them is the point.

Under the state machine, 0 is the arm that installs nothing and boots normally, and normal boot is 0x003BA: read internal program flash at 0x1004, check the HG there, and run what is resident. So the latch is passive. Nothing reinstalls safe mode at every boot. Safe mode persists because it is what is sitting in internal program flash and no state byte asks for that to change. A power cycle does not help because a power cycle is not a request.

The active reading was wrong about the mechanism and right about the consequence, which is the shape worth noticing: both readings predict that the remote stays in safe mode indefinitely, so the behaviour section 118 measured could not distinguish them, and only the byte could. And the zero is what sent this section back to the bootloader, where the 6 and its consumer were sitting unread; the first version of the state table stopped at the in progress marks because nothing had contradicted them yet.

The reading was checked before it was believed, and the window is what it turns on. A byte that is zero everywhere would satisfy any of this, so the address arithmetic was tested rather than assumed: 0x200004 answers 25 and 0x200008 answers 0xFF, so the window honours the low address byte and byte 0 is genuinely zero. Two neighbouring windows corroborate the table the other way, tag 0x40 and tag 0x30 both answering all zeros, which is what section 90 already recorded about arch 9 data memory. A window table that returned zeros everywhere would have proved nothing.

One thing this leaves open, stated rather than papered over: whether the key combination touches EEPROM byte 0 at all is not read. The cell is 0 both before and after the recovery, so entry by key is consistent with never touching it, and nothing measures that directly.

The recovery, performed by hand, and the screen confirmed a firmware path before it was read

On 11 August 2026 the four library calls were run against the stranded 525. The remote displayed "upgrade voltooid", its Dutch for upgrade complete, which needed a battery pull to clear, and came up on its normal screen.

That message is the closure, and it is the good kind because it was observed before the path that emits it had been found. Nothing predicted a message; the section had the bootloader writing 4 and stopping there. Looking for what cleared the 4 is what turned up 0x0082C writing 6 and 0x07900 consuming it, and the only thing 0x07900 does on a match is set a status bit. So a user visible event nobody had asked the firmware about is explained by the one path that fires on 6.

Verified afterwards over USB, read only:

before, in safe mode after
USB product string Harmony Safe Mode! Harmony Remote 0-3.0.0
GET_VERSION 20 25 12 ff 94 16 00 30 25 12 ff 90 16 09
software type 4, safe mode 0, application
EEPROM byte 0 0 0
internal 0x1000 to 0x7FFF an image under 10 KiB, erased above 0x3800 byte identical to h525_code at five offsets including 0x3800 and 0x7000
config at 0x820000 not checked byte identical to its lab dump at two offsets, AHCM framing intact

So the version reply is exactly what the same unit answered on 8 August, the application region is restored including the two offsets that were erased flash while it was stranded, and the config survived, which is what concordance's is_config_safe_after_fw predicts on an architecture whose firmware_update_base differs from its config_base.

This project still did not perform the write, and that is not a formality. The four calls ran from a script in the private lab, by hand, on our own remote, after the reading above was in place. The rails are unchanged: arch 9 is not in ARCHITECTURES_WITH_A_WRITE_TARGET, and nothing in this repository has ever written to a remote.

The safe mode image serves the EEPROM too, which is what makes the recovery reachable

Necessary for any of this to be useful, and not to be assumed: the write goes to a remote running the safe mode image, not the application. Both images implement all three tag dispatches, and for tag 0x20 both reach the EEPROM:

application safe mode image
read arm 0x0335A case 0x20, helper 0x07D68 0x01CFE, helper 0x034FE
write arm 0x0313C case 0x20, helper 0x07D74 0x01AFA, helper 0x0350A

0x0350A is MOVFF into EEADR, MOVFF into EEDATA, MOVLW 0x04 into EECON1 for write enable, then the unlock sequence and a spin on EECON1 bit 1. So a stranded 525 can be told which image to boot, which is the only reason a one byte recovery exists at all.

The read window corroborates itself the same way: tag 0x40 and tag 0x30 both answer all zeros on this remote, which is what section 90 already recorded about arch 9 data memory, while tag 0x20 answers content. A window table that returned zeros everywhere would prove nothing.

What this changes, and what it does not

packages/usb/src/protocol.ts carries the window table now, ARCH9_WINDOWS, with the firmware's own offset bounds enforced because a bound this library shares with the device can only ever agree with it. Three regions became readable and nothing became writable: the write path is decided by CONFIG_REGION_BASE and ARCHITECTURES_WITH_A_WRITE_TARGET, which do not consult regionOf, and arch 9 is in neither. There is a test whose only job is to say so.

The recovery is understood rather than attempted. One byte, into 256 bytes of on chip EEPROM, at an address the firmware bounds to that size, served by the image the remote is actually running, into a cell whose five states are read. What remains is that this project does not perform it, and the reason has moved since. This said "arch 9 has no write target" and that "nothing here has ever written to a remote" and both halves are dead, sections 222 and 269. What refuses it now is the writable range, which starts at the configuration and stops below the log area, so the EEPROM is outside it, and the judgment that a write path this young should not be the thing that installs firmware. The script that does it lives in the private lab.


Section 118 | the archive | section 120. Section 119 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.