Skip to content

94. An odd internal read count never terminates, and that is the whole restart

Section 93 measured the hazard and narrowed a rail around it. This reads the firmware and finds the cause, which is neither the chunk count nor the final chunk's size: an internal read of an odd number of bytes puts the Harmony One in a loop that cannot end.

The loop

0x26BC8 on the Harmony One, inside the READ_FLASH body's branch for an internal top address byte. One pass:

26bc8: 04 00       CLRWDT              ; the watchdog is fed every pass
26bca..26bd2                           ; the 24 bit address into the primitive's arguments
26bd6: 85 ec 73 f1 CALL 0x2e70a        ; fetch
26bda: f3 cf 32 fd MOVFF PRODL,0xd32
26bde: f4 cf 33 fd MOVFF PRODH,0xd33
26be2..26bf2                           ; address += 2
26bf4..26bfc                           ; emit 0xd32 through the byte sender
26c00..26c08                           ; emit 0xd33
26c0c: 02 0e       MOVLW 0x02
26c10: 31 5f       SUBWF 0xd31,F       ; remaining -= 2
26c14: 31 51       MOVF 0xd31,W
26c16: 00 08       SUBLW 0x00          ; carry only when remaining == 0
26c18: d7 e3       BNC 0x26bc8         ; otherwise go round again

Three facts and they are enough.

The fetch can only read a word. 0x2E70A sets TBLPTR and does TBLRD*+ then TBLRD*, returning two bytes in PRODL and PRODH. There is no single byte entry point. Its twin on arch 14 is 0x1B558, structurally identical, and both are the only routines of that shape in their images.

So the loop is committed to two bytes a pass: it emits both, advances the address by two and subtracts two.

And the exit test is equality with zero, not a signed comparison. From an odd count the remaining value steps 1, 255, 253, 251 and back to 1, and never equals zero. The loop runs forever, pushing bytes into the response buffer and walking the address through program memory, and CLRWDT at the top means the watchdog will not break it either.

Why the trigger looked like a final chunk of one byte

The length clamp at 0x0C9B2 on the 700, whose arch 12 twin fronts this loop, picks the largest representable payload not exceeding what is left: 63, 31, 15, 7, or a literal 0 to 6. A payload carries one sequence byte, so the data a chunk can hold is 62, 30, 14, 6, or 0 to 5. Every one of those is even except 1, 3 and 5, which only occur when five or fewer bytes remain.

Since every large chunk removes an even number, the parity of the remaining count never changes. An odd total is odd at the end. So:

request chunks outcome
62 62 terminates
63 62, 1 never terminates
64 62, 2 terminates
65 62, 3 never terminates
124 62, 62 terminates
125 62, 62, 1 never terminates
128 62, 62, 4 terminates

Every measurement this project has taken sits in that table, and the "final chunk of exactly one byte" reading of section 93 was a description of the only odd tail the sizes anyone had tried happened to produce. 63 and 125 are 62n + 1 and 65 and 127 are not, so the rail section 93 installed would have let a remote hang.

The rail

packages/usb refuses an odd count for an internal read, and the reason attached to it is now a mechanism rather than a symptom. It is the third form of this refusal in one day and the first that is derived rather than fitted: count > 62 was a bound around the hazard, count % 62 == 1 was a curve fitted to four data points, and this is what the code does.

What is still not explained

63 bytes at offset zero was recorded as fine, twice. This reading says it should hang. Two trials is thin, the observation is nearly a year old in project time and was taken while the question was still "is it the chunk count", and the branch at 0x26BB2 that this body sits behind tests the top address byte rather than the offset, so there is no offset zero case in the code to appeal to. It should be re-measured before anyone builds on the exemption. It is not needed for the rail, which refuses odd counts everywhere.

Whether arch 14 and arch 9 share it is untested on hardware. The word-only primitive exists on arch 14 at 0x1B558, so the shape is there. Nothing here justifies trying an odd read on a remote to find out.

The prediction this makes, and it is cheap

An internal read of 65 bytes should hang a Harmony One where 64 and 124 do not, and 65 is not 62n + 1. That is the experiment that separates this reading from section 93's, and it costs one deliberate restart of the spare, of the kind that has recovered five times already.

Performed, and it holds

9 August 2026, on the spare with the programmed One unplugged, the unit identified by its config window matching one_spare_after_sync rather than by its port. Prediction committed first, in the paragraph above.

step result
GET_VERSION 34 05 c8 1f c0 36 0c 34 34 16 34 34
control: 64 bytes at 0xFF +0x1000 64 bytes back, remote answering
65 bytes at the same address failed after 146 ms, and the remote stopped answering

Confirmed from outside the software too: watching the remote, we saw it reset. That matters because the host side can only see silence, and silence has more than one cause.

It re-enumerated on its own at a different device path, which is what says it restarted rather than merely stalled, and afterwards GET_VERSION matched, three flash windows read, the config window was byte identical to the one taken before the experiment, and a 64 byte internal read worked again. Disruption, not damage, exactly as the five earlier restarts.

So the separating case goes the way the firmware says: 65 hangs a remote and 64 does not, and count % 62 == 1 would have permitted it. The rail is an odd count, and it is now derived from the loop, confirmed against the loop's own prediction on hardware, and observed by two people.

Offset zero, predicted before measuring

The one observation this reading cannot accommodate is the old note that 63 bytes at offset zero was fine, twice. Written down before the retest, in the same session, so the answer cannot be fitted afterwards.

The prediction is that it hangs, like every other odd count. The body this loop sits in is reached through a branch on the top address byte, 0x26BB2, and there is no test of the offset anywhere between that branch and the loop. Nothing in the code distinguishes offset zero, so if the loop is entered at all the counter behaves the same way.

If it does not hang, the reading is incomplete rather than wrong, and the two candidates worth separating are: the loop is never entered for that address, meaning some earlier check returns first; or it is entered and something ends it, which would have to be a reset from another cause, since the watchdog is fed inside it. A control of 62 bytes at the same address distinguishes "the address answers" from "the address is refused" before the odd read is tried.

A single old observation with two trials is thin evidence either way, and the most likely outcome is that it was a misattribution made while the question was still "is it the chunk count".

Measured, and the prediction is wrong

It was not a misattribution. On the spare, minutes after the 65 byte restart and in the same session:

read result
page 0xFF, offset 0, 62 bytes, control 62 bytes, remote answering
page 0xFE, offset 0, 62 bytes, control 62 bytes, and different bytes, so the page selector is live
page 0xFF, offset 0, 63 bytes 63 bytes back in 39 ms, remote answering

GET_VERSION and the config window were unchanged afterwards, and the device path did not change, so nothing restarted. Offset zero is genuinely exempt, and the old two trial note stands.

That is the third time in this project that a suggestive absence turned out to be worth retesting rather than explaining away, and this time the retest went against the reading rather than for it.

What survives and what is withdrawn

The loop is real and its arithmetic is as described. It is why 65 hangs where 64 and 124 do not, which was measured on hardware after being predicted, and that case is not affected by anything here.

What is withdrawn is that the loop explains every internal read. It cannot, because it does not distinguish offset zero and the device does. So there is a step in front of it that this section has not read.

The attribution: settled by the validator, and the withdrawal is reversed

The doubt was that 0x26BB2 tests the top address byte against zero and against 0xFE and sends everything else to a shared exit, so page 0xFF looked as though it never reached this loop. The arch 12 validator at 0x2637A settles it, and it does exactly what arch 14's was said to do:

2637a: 87 c2 00 f0 MOVFF 0x287,0x000   ; the top address byte
2637e: 00 90       BCF 0x00,0          ; clear bit 0, so 0xFF becomes 0xFE
26384: fe 0e       MOVLW 0xfe
26386: 00 18       XORWF 0x00,W        ; and compare with 0xFE: both pages match
26390: 17 e0       BZ 0x263c0          ; taken: the internal path
...
263d4: fe 0e       MOVLW 0xfe
263d6: 8b 6f       MOVWF 0x8b,B        ; 0x28B := 0xFE, written back unconditionally
263d8: 01 0e       MOVLW 0x01
263da: 87 17       ANDWF 0x87,B,F      ; 0x287 &= 1: the page bit is all that survives
263dc: 01 0c       RETLW 0x01          ; accept

So the low bit of the top address byte is the page selector, the value the read body tests has already been normalised to 0xFE, and the page bit becomes the top byte of the 24-bit address the loop is handed, which is why the two pages map to program 0x00xxxx and 0x01xxxx. Page 0xFF reaches this loop. The withdrawal above is reversed: the loop is the internal read body for both pages, and the measurement agrees, since 65 bytes at page 0xFF hangs exactly as the loop says it must.

The validator also bounds the offset, at 0xFFF8 rather than the 0xFFC0 this project's library uses, and it does not touch the count at all.

What is still open, and it is narrower now

Offset zero, and the whole path is read now without finding it. 0x28A was the thing to check and it is the chunk size rather than the request's: 0x26B4C does DECF 0xD30,W into it, so it is the clamped payload minus its sequence byte. The chunker in front of it, 0x26AF0, is the arch 12 twin of arch 14's 0x0C9B2, comparing the 16-bit remaining count at 0x288 against 63 and clamping to 63, 31, 15 or 7. And the count itself is parsed verbatim at two identical sites, 0x264E8 for WRITE_FLASH and 0x26532 for READ_FLASH, each ending in the same call to the validator.

So a 63 byte request is chunked 62 then 1, at any offset, and the loop cannot end on the second chunk. None of those four routines tests the offset: the parse, the validator, the chunker and the loop each read the address only to range check it or to hand it on.

That is as far as the negative goes, and the first draft of it went further and was wrong. It said the exemption is not in the READ_FLASH path at all, on the strength of a sweep for branches on the offset bytes across 0x264E8 to 0x26C1C. Two things were wrong with that. The sweep was vacuous, testing a category name the decoder does not emit, so it counted zero whatever the image held. And the range spans several command bodies rather than this one path, so even a working sweep would have been answering a different question. Enumerating the accesses by hand instead found 28 of them, including a real comparison at 0x268AC of the whole 24-bit address against 0x020000, the arch 12 execution base, which sets a flag bit. That one is in the flash machinery rather than on the path traced here, and it is pinned in the tests so the next reader does not have to find it again.

The lesson is the project's own and it cost an hour here: a negative asserted by a test that cannot fail is worse than no test, because it reads as evidence. What is left is genuinely narrower than before and no more than that: the byte sender and the USB layer behind it, which is the only other code every emitted byte passes through; the flash machinery around 0x268xx, which does look at the address; an interrupt; or something about that particular address that no reading of this path will show.

Bounding it on hardware: predicted before measuring

Two more offsets, on page 0xFF, 63 bytes each, each with a 62 byte control at the same offset first. Written down before the remote was plugged in.

The prediction is that both hang, making offset zero uniquely exempt. Offset 0x40 is the stronger of the two, because the original note already records 63 bytes there as having completed and then killed the remote, so a hang there is a reproduction rather than a new fact. Offset 2 is the one that carries information either way, because nothing has ever been tried next to zero.

What each outcome would mean, so that none of them can be fitted afterwards:

  • Both hang. Offset zero alone is exempt, and whatever explains it is about that exact address rather than about a range. That is the outcome the loop reading expects everywhere except at zero, and it leaves the puzzle exactly where it is now, only sharper.
  • Offset 2 survives and 0x40 hangs. It is not offset zero but a low range, with a boundary somewhere between them, and a boundary is something a comparison in the firmware can have. That would be the most useful result, because it turns "why is zero special" into "find the constant".
  • Both survive. The exemption is wide, the original 0x40 note is wrong, and the odd count reading needs re-examining rather than patching, since 63 at +0x1000 restarts a remote and would then be the special case rather than the rule.

Offset 2 survives, so it is a range and not one address

read result
page 0xFF, offset 2, 62 bytes, control 62 bytes, remote answering
page 0xFF, offset 2, 63 bytes returned in 35 ms, remote answering

GET_VERSION and the config window were unchanged afterwards. So the prediction is wrong for the second time on this question, and it is wrong in the direction that carries information: offset zero is not uniquely exempt. Whatever decides this is a comparison against a bound, not a test for a single address, and a bound is a constant somebody can find.

0x40 is the decisive one now, because the original note records it as fatal. If it hangs, the boundary sits between 2 and 0x40 and the constant can be searched for directly.

0x40 survives too, which is the third outcome and the worst one

read result
page 0xFF, offset 0x40, 62 bytes, control 62 bytes, remote answering
page 0xFF, offset 0x40, 63 bytes returned in 39 ms, remote answering

Version and config unchanged either side. So 63 bytes is harmless at offsets 0, 2 and 0x40, and the original note recorded the same read at 0x40 as having killed a remote.

That is the outcome written down above as the one where the odd count reading "needs re-examining rather than patching", so it is re-examined here rather than repaired.

What is measured, first hand, on the spare:

read outcome
62 bytes at +0, +2, +0x40, +0x1000 fine
63 bytes at +0, +2, +0x40 fine
64 bytes at +0x1000, +0xE000, and page 0xFE +0x1000 fine
124 bytes at +0x1000 fine
65 bytes at +0x1000 hung, and the hang did not self-clear

Every hang this project has ever seen is at offset 0x1000, and every read away from 0x1000 has been fine whatever its parity. The one thing never measured first hand is 63 bytes at +0x1000, which is the reading the original note rests on and the control that separates the two candidate explanations:

  • if it hangs, the offset is what matters and the boundary is between 0x40 and 0x1000, with the parity rule holding above it;
  • if it survives, the offset is irrelevant and the trigger is a final chunk of 3 rather than of any odd size, since 65 is 62 + 3 and every 63 tried is 62 + 1. The loop reading would then be wrong about which odd values matter, and the original 3-of-3 note about 63 at 0x1000 would be about something else entirely.

The missing control, run at last: the offset decides

read result
page 0xFF, offset 0x1000, 62 bytes, control 62 bytes, remote answering
page 0xFF, offset 0x1000, 63 bytes failed after 146 ms, remote gone

So the original note reproduces, first hand this time, and the offset is what matters. 63 bytes is harmless at 0, 2 and 0x40 and fatal at 0x1000, so there is a boundary between 0x40 and 0x1000 and it is a comparison somebody can find.

Section 96: the offset matters, but only because it fixes which byte of flash lands on the loop's counter. There is no boundary and no comparison.

The remote came back on its own in about three seconds, at a new device path, and answered with its config byte identical. That is a sixth self-clearing restart and it is further reason to think the earlier freeze belonged to the charger transition rather than to these reads.

The parity rule survives but only above the boundary. At 0x1000, 62, 64 and 124 are fine and 63 and 65 are fatal, which is exactly the loop's arithmetic. Below the boundary the loop's arithmetic apparently does not apply, and nothing read so far says why.

What would find the constant, and what it costs

A bisection between 0x40 and 0x1000 is about six reads and gives the boundary to a byte, and each hang now looks like three seconds and a self-clearing restart rather than a battery pull. That is the cheapest route to a number that can then be searched for in the image, which is what turns this from a measured curiosity into a firmware fact.

It is deliberately not automated. A script that hangs an irreplaceable device six times in a row is exactly the thing that should need saying out loud each time, and the environment's own safety check refused to run one, which was the right call.

The bisection, run step by step, and the threshold is an address

Fourteen reads on the spare, each one announced, each hang self-clearing in about three seconds at a new device path, with the config verified at the end and byte identical to its dump.

offset on page 0xFF 63 bytes
0, 2, 0x40, 0x800, 0xA00, 0xA40, 0xA50, 0xA54 survives
0xA56, 0xA58, 0xA60, 0xB00, 0xC00, 0x1000 hangs
0xA80 returned, and the remote died immediately after

It is deterministic. 0xA54 survives three times out of three and 0xA56 hangs three out of three, which is what makes the boundary worth quoting: a bisection over single trials of a flaky effect would have produced a number that meant nothing.

0xA80 reproduces the one shape the original notes recorded and this project had never explained: the read completes and the remote dies afterwards rather than during. It sits above the boundary, so it is not a separate phenomenon.

The threshold is on the start address, not the end. 65 bytes from 0xA54 reaches exactly as far as 63 bytes from 0xA56, and it survives. So what decides is where the read begins.

And it is an absolute program address, not an offset. The same offset 0xA56 on page 0xFE survives. Page 0xFE maps from program zero and page 0xFF from program 0x010000, section 22, so the boundary is at program 0x010A56, which is why no read on page 0xFE has ever hung: that whole page lies below it.

Corrected by section 96, on the same day. There is no boundary. Whether an unterminated read ends is decided by the parity of one flash byte 0x8C7 above where the failing chunk starts, because the response sender has no bound and the loop eventually overwrites its own counter with what it is reading. Every offset tried below 0xA56 happened to have an even byte there, and on that reading 568 of the 1323 even offsets below it hang. The page 0xFE observation is explained the same way, by content rather than by a range. Everything measured below stands; the word boundary does not, and neither does the search for the comparison it implies.

What that reframes

The parity rule is real but it is local. Above 0x010A56, 62, 64 and 124 are fine and 63 and 65 are fatal, which is the loop's arithmetic exactly. Below it, odd counts are harmless at every offset tried. So the loop reading explains the failure but not the boundary, and something about that address decides whether the failure can happen at all.

Also corrected by section 96. The parity rule is not local and it is not about the count reaching zero by itself: an odd count never terminates at any address, and what varies is whether the counter is overwritten with something even before the remote is beyond saving.

What sits there, read off the remote

Read on 9 August 2026 in even chunks, so no odd count and no risk of the failure this section is about. Two things, and the second one kills the obvious explanation.

The region carries the image header this project predicted from the client's own file. Its first ten bytes are a u16, then FF FF, then four bytes, then 48 47, and the client's image builder writes a checksum at 0, 0xFFFF at 2, four bytes at 4 and 0x4748 at 8, docs/host-client.md. So the shape was predicted from Logitech's build description and then found on the device, which is the first independent check of that description against hardware.

The body is a program, not a bitstream. From 0xA40 it is records of exactly 0x50 bytes, found at 0xA40, 0xA90, 0xAE0 and 0xB30, each opening 00 17 01 01 00 00 27 10 followed by three bytes, then about 28 bytes of mostly-set bit vector, then zero fill. 17 01 01 carries a 32-bit operand and the values seen are round decimals, 10000, 5000 and 100000, which read as microseconds. Elsewhere the stream is dense in 12 xx pairs. That is the shape of a player driving an external part with delays between vectors, which fits the client calling it a CPLD image, and it is a program rather than the raw bitstream a CPLD load would need.

And 0xA56 is not the end of anything. It falls inside the bit vector of the record that starts at 0xA40, and the same record structure continues unbroken for at least three more records past it. So the boundary is neither the end of the image nor a record boundary, and the tidy explanation, that a read starting past the image hangs, is wrong.

What remains is the strange part measured above: a read that starts past 0x010A56 hangs, while a read that starts below it and reaches past it is fine. That is not a property of the memory, it is a decision taken from the start address, so it is a comparison somewhere this section has not found rather than anything about what is stored there.

Wrong on both halves, section 96. It is a property of the memory, just not of the memory at 0xA56: the deciding byte sits 0x8C7 further on, which is why reading what is stored at the supposed boundary explained nothing. And the start address matters only because it fixes which byte that is.

The rail is unchanged and does not depend on any of it: it refuses odd counts everywhere, which is more than the hazard needs on page 0xFE and exactly what it needs above 0x010A56.

A remote can get stuck in USB mode, and it is not this section's doing

Recorded as a bench fact and not as a consequence of these reads, because the first version of this subsection made it one and the sequence does not support it.

What happened: after the 65 byte test the remote left the bus, came back on its own at a different device path, and was verified healthy, version, three flash windows, the config byte identical and a 64 byte internal read. Later, off the charger and plugged into USB, it did not enumerate at all. Unplugging the cable left it still showing USB mode, and taking the batteries out cleared it.

No causal link to the reads is established and one was claimed here for an hour. Successful operations sat between the test and the freeze, and a charger to USB transition sat between them too, which is a state change this project has never exercised. Adjacency is not cause, and writing it up as cause is the same error this document warns about elsewhere.

What is worth keeping is the operational fact: a Harmony One can end up stuck in USB mode and need its batteries out, so a bench session should expect that and not read a silent remote as a result. The earlier claim that every restart recovered on its own stands, because every restart did.

An odd count hangs a remote, demonstrated on hardware after being predicted. The loop that does it is read, the validator in front of it is read, the chunker and the parse are read, and one special case is in none of them. The rail does not depend on it, because it refuses odd counts everywhere, which is strictly more than the hazard needs.


Section 93 | the archive | section 95. Section 94 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.