fix: flush SLIP reader after ReadFlash to prevent stale data corruption#34
Merged
Conversation
5 tasks
jgangemi
added a commit
to dangernoodle-io/pogopin
that referenced
this pull request
Apr 19, 2026
- add esp32p4-rev1 case to parseChipType mapping to espflasher.ChipESP32P4Rev1 - split .firmware/sdkconfig.defaults into board-agnostic base + per-target overlays (esp32s3: USB_CDC + 8MB; esp32p4: UART + 16MB) - target ESP32-P4 ECO2 silicon (SELECTS_REV_LESS_V3 + REV_MIN_100) to avoid rev-3 illegal-instruction panic on Elecrow CrowPanel P4 HMI 7.0 - rewrite .firmware/README test plan with current tool names and per-target expected values; capture operational notes (erase-first for ValidateFlashOffsets, stale USB-JTAG unplug/replug) - pin tinygo.org/x/espflasher to fork branch jgangemi/espflasher#jae/esp32p4 via pseudo-version (SLIP flush, P4 Rev1, unixTightReset, hardReset DTR); upstream PRs tinygo-org/espflasher#34, #36, #37, #38 Validated end-to-end on T-Dongle-S3 and Elecrow P4 (both CH340 and USB-JTAG paths). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
jgangemi
added a commit
to dangernoodle-io/pogopin
that referenced
this pull request
Apr 19, 2026
- add esp32p4-rev1 case to parseChipType mapping to espflasher.ChipESP32P4Rev1 - split .firmware/sdkconfig.defaults into board-agnostic base + per-target overlays (esp32s3: USB_CDC + 8MB; esp32p4: UART + 16MB) - target ESP32-P4 ECO2 silicon (SELECTS_REV_LESS_V3 + REV_MIN_100) to avoid rev-3 illegal-instruction panic on Elecrow CrowPanel P4 HMI 7.0 - rewrite .firmware/README test plan with current tool names and per-target expected values; capture operational notes (erase-first for ValidateFlashOffsets, stale USB-JTAG unplug/replug) - pin tinygo.org/x/espflasher to fork branch jgangemi/espflasher#jae/esp32p4 via pseudo-version (SLIP flush, P4 Rev1, unixTightReset, hardReset DTR); upstream PRs tinygo-org/espflasher#34, #36, #37, #38 Validated end-to-end on T-Dongle-S3 and Elecrow P4 (both CH340 and USB-JTAG paths). Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
- add slipReader.reset() to clear leftover buffer - update flushInput() to also reset SLIP reader state - call flushInput() after ReadFlash's raw block protocol completes - add public FlushInput() method for callers reusing connections - rename GetMD5 to FlashMD5 ReadFlash uses a non-standard SLIP protocol (block reads + ACKs + MD5 frame) that can leave stale bytes in the SLIP reader's leftover buffer. These bytes corrupt subsequent command responses when the flasher connection is reused across multiple operations.
562e396 to
595aea6
Compare
deadprogram
reviewed
Apr 22, 2026
Addresses review feedback on tinygo-org#34 — FlashMD5 suggested flashing behavior; GetFlashMD5 makes the read intent explicit.
Member
|
Thanks for the fix @jgangemi now squash/merging. |
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.
ReadFlash uses a non-standard SLIP protocol (block reads + ACKs + MD5
frame) that can leave stale bytes in the SLIP reader's leftover buffer.
These bytes corrupt subsequent command responses when the flasher
connection is reused across multiple operations.