ESP32 UART Bridge Fix (Flash ESP32 via Pico)#18
Open
DynaMight1124 wants to merge 8 commits into
Open
Conversation
* Auto-Reset Logic: Implemented the specific DTR/RTS signal mapping required for direct (transistor-less) Pico-to-ESP32 connections.
* Protection Window: Added a 5-second ignore window for DTR/RTS signals upon entering UART mode. This prevents the OS from accidentally knocking the ESP32 out of its manual bootloader state when the COM port
is first opened.
* High-Speed Stability: Moved UART handling to a high-priority polling loop on Core 1 and added volatile memory protection to prevent data loss at high baud rates.
* Auto-Exit: Restored the logic to detect the PROGRAMMING_COMPLETE flag so the Pico reboots back to controller mode automatically.
Updated declarations to expose the new bridge control and callback functions.
Implementation: Overrode the new CDC callbacks to pass signal data directly into the core bridge logic.
Implementation: Overrode the new CDC callbacks to pass signal data directly into the core bridge logic.
Improved Timing: Refined the enter_programming_mode() sequence to hold the Boot pin (GPIO0) LOW for a full 500ms after reset, ensuring the ESP32 reliably catches the bootloader state.
Performance: Increased CDC TX/RX buffer sizes from 256 to 1024 bytes. This is required to prevent "Sync" errors when flashing at high speeds (e.g., 921600 baud).
Infrastructure: Linked the global TinyUSB CDC events (Line State/Coding) to the internal driver system so the UART bridge can actually "hear" the DTR/RTS signals from the PC.
Architecture: Added virtual methods for CDC callbacks to the base driver class, allowing the UART bridge to implement them without breaking other drivers.
Owner
|
I'll take a look at these requests when I have time I've just been busy, promise I'm not ignoring you! |
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.
Hi
Heres another AI fix, the original dev created a UART bridge that cleverly allowed the Pico to programme the ESP32 however I could never get it to work, however AI added some fixes that worked and now it programmes perfectly. Granted it is a little bit of a niche setup using an ESP32 for the BT side, but there are some uses such as limited space. I had recently designed a PCB that fitted into an old Xbox DVD dongle and a Pico-W was too long so went with the Pico/ESP32 sandwiched either side.
Heres some AI info on what files were changed and why:
The following 7 files contain the complete and verified fix for the ESP32 flashing issue: