ports/raspberrypi: pull Pico-PIO-USB deterministic SYNC realignment (Fruit Jam USB host wedge)#11135
Draft
mikeysklar wants to merge 1 commit into
Draft
ports/raspberrypi: pull Pico-PIO-USB deterministic SYNC realignment (Fruit Jam USB host wedge)#11135mikeysklar wants to merge 1 commit into
mikeysklar wants to merge 1 commit into
Conversation
The PIO USB receiver can lock onto an incoming packet a few bits early, so every byte arrives shifted and the aligned CRC check fails on wire data that is perfectly valid. The device retransmits forever and the endpoint is stuck until reboot. On the Fruit Jam this presents as hub hot plug delivery dying permanently, gated by unrelated build flags (vectorio compiled in but never imported), because the firmware memory layout steers the timing that decides the framing. Pulls sekigon-gonnoc/Pico-PIO-USB#211, which keys the realignment on the SYNC byte (0x80) to derive the exact shift and recover the packet. Fixes the 3-year-old sekigon-gonnoc/Pico-PIO-USB#97. DRAFT: submodule temporarily points at the mikeysklar fork so CI can fetch the commit. Repoint to the upstream sekigon-gonnoc SHA and restore the .gitmodules URL once adafruit#211 merges.
mikeysklar
force-pushed
the
fruitjam-rx-framing-recovery
branch
from
July 23, 2026 16:33
2827170 to
650281d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DRAFT. Do not merge as is: the submodule temporarily points at my Pico-PIO-USB fork so CI can fetch the commit before it exists upstream.
Pulls the Pico-PIO-USB deterministic SYNC realignment (sekigon-gonnoc/Pico-PIO-USB#211) into the raspberrypi port.
The PIO USB receiver can lock onto an incoming packet a few bits early, so every byte arrives shifted and the aligned CRC check fails on wire data that is perfectly valid. The device retransmits forever, and the endpoint is stuck until reboot. On the Fruit Jam this presents as hub hot plug delivery dying permanently, gated by unrelated build flags (vectorio compiled in but never imported), because the firmware memory layout steers the timing that decides the framing. Full investigation with captures: hathach/tinyusb#3776.
Fixes #10563. Same root cause as the 3-year-old sekigon-gonnoc/Pico-PIO-USB#97.
Because a correct packet always begins with SYNC (0x80), the shift is not a guess: the fix drops leading bits until SYNC reappears, confirms with the PID check nibble and a recomputed CRC, then delivers. One observed offset, the captured bytes shifted vs the expected packet:
Validated on the Fruit Jam layout that previously wedged the port on the first hub hot plug and never recovered: 34 consecutive hot plug events all delivered across an automated cycling harvest.