Fix ESP32 flash read errors by correcting stub protocol issues - #114
Fix ESP32 flash read errors by correcting stub protocol issues#114Jason2866 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (18)
💤 Files with no reviewable changes (16)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthrough
ChangesFlash read protocol
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR updates ESP32 flash-read protocol handling to improve reliability, and no actionable merge-blocking risk remains based on the supplied evidence. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This pull request addresses multiple issues in the ESP32 flash read implementation that were causing timeouts and read failures. The changes made are as follows:
Corrected Parameter Interpretation: The stub was incorrectly interpreting the
maxInFlightparameter as a packet count instead of bytes. This led to overwhelming the USB buffer. The fix convertsmaxInFlightfrom bytes to the appropriate packet count before sending it to the stub.ACK Logic Update: The acknowledgment (ACK) logic was modified to send an ACK after every packet, aligning it with the behavior of the Python esptool. This change improves flow control and prevents packet loss.
MD5 Hash Handling: The stub was sending an MD5 hash after each chunk, which was not being read by the host, leading to data corruption in subsequent reads. The implementation now includes reading and discarding the MD5 hash to prevent this issue.
Abort Frame Correction: The abort frame sent during errors was changed from a zero-length SLIP frame to a one-byte frame, ensuring that the stub correctly breaks out of its loop on error.
These changes collectively enhance the reliability of the flash read process for the ESP32, resolving the timeout and data corruption issues previously encountered.
Summary by CodeRabbit
Bug Fixes
Chores