Repository navigation
firmware flash: reach a native-USB ESP32 through its ROM port; take --before/--after - #211
Merged
Merged
Conversation
…-before/--after A board running MicroPython on its native USB shows TinyUSB's CDC (303a:4001), which ignores DTR and RTS, so esptool's default reset kept talking to the interpreter and failed with "Invalid head of packet". firmware flash now sends such a board to its bootloader the way `mpftp bootloader` does, waits for the ROM's USB-Serial/JTAG port (303a:1001) whose serial number carries the same MAC, and flashes there. A UART bridge, a board already in its ROM, and --before no-reset are flashed where they are. The outer firmware flash parser now declares --before and --after and passes them to the engine, which already accepted them. Checked on an ESP32-S3 running MicroPython on native USB: an app-only flash from its running state went to the ROM port, wrote and verified, and the board booted back to its app with its files in place. Unit tests cover the port matching, the fallbacks and the option passthrough. Closes #208 Closes #209
…ps to its bootloader
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.
mpftp firmware flashon an ESP32-S2/S3 running MicroPython on its native USB (TinyUSB CDC, 303a:4001) no longer fails with "Invalid head of packet". That port ignores DTR and RTS, so esptool's reset never reached the ROM. Flash now sends the board to its bootloader the waympftp bootloaderdoes, waits up to 20 s for the ROM's USB-Serial/JTAG port (303a:1001) whose serial number carries the same MAC (or, on an S2, the new ROM USB port 303a:0002, whose serial number has no MAC), and flashes there. A UART bridge, a port already in the ROM, and--before no-resetare flashed where they are; if no ROM port appears, it stops with the BOOT+RESET instructions instead of flashing a port that has gone.firmware flashalso accepts--beforeand--afternow and passes them to the engine, which already took them.I flashed an ESP32-S3 (LILYGO T-Display-S3) from its running app with an app-only write at 0x10000 and no manual bootloader step: it went to its bootloader, mpftp picked the ROM port by MAC, esptool wrote and verified 5.1 MB, and the board came back on its native USB running the same build with its files in place. New unit tests (
cli/tests/test_flash_native_usb.py) cover the port matching, the fallbacks, a failed bootloader, and the option passthrough; they fail without the change. Not checked: an ESP32-S2 on native USB through this path, and the extension, which has its own handoff and doesn't go through this code.Closes #208
Closes #209