m5-onboard: cap esptool < 5; document PEP 668 / Homebrew Python - #3
Open
lisabee123 wants to merge 1 commit into
Open
m5-onboard: cap esptool < 5; document PEP 668 / Homebrew Python#3lisabee123 wants to merge 1 commit into
lisabee123 wants to merge 1 commit into
Conversation
esptool 5.2.0 crashes mid-write_flash on Cardputer-Adv (native-USB ESP32-S3) with "Serial data stream stopped" followed by a StopIteration in the SLIP reader during --after watchdog_reset teardown. 4.11.0 flashes the same firmware to the same device cleanly. Cap esptool < 5 in requirements.txt and enforce the same bound in onboard.py's preflight (new _MAX_ESPTOOL_EXCLUSIVE constant, checked both pre- and post-install) so attendees with a pre-installed 5.x are told to downgrade before the 4-minute flash rather than crashing mid-write. Also document the PEP 668 / Homebrew Python failure mode in SKILL.md: on macOS with Homebrew-installed python3, `pip install --user ...` fails with "externally-managed-environment" and the preflight reports "pip install failed (exit 1)". The recovery is a venv -- the preflight already detects venvs and drops --user, so once inside, the auto-install path works again. Apple's /usr/bin/python3 is unaffected.
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.
Summary
Two fixes hit while provisioning a Cardputer-Adv with
m5-onboard go:write_flashon Cardputer-Adv —Serial data stream stoppedfollowed byStopIterationin the SLIP reader during the--after watchdog_resetteardown. 4.11.0 flashes the same firmware to the same device cleanly.requirements.txtwas previouslyesptool>=4.11(no upper bound), so a fresh install pulled 5.2.0 and burned ~4 minutes per attempt before failing. Now pinned>=4.11,<5, with a new_MAX_ESPTOOL_EXCLUSIVEconstant inonboard.pyso the preflight enforces the cap before the button dance rather than crashing mid-flash.pip install --user -r requirements.txtfails witherror: externally-managed-environmentwhenpython3resolves to a Homebrew install (most current macOS dev setups). The preflight then printspip install failed (exit 1)and bails. Documented the venv recovery path in SKILL.md (the preflight already detects venvs and drops--user, so once you're inside it the auto-install works again). Apple's/usr/bin/python3is unaffected.What changed
requirements.txt—esptool>=4.11,<5, with rationale comments and the macOS venv recipe inline..claude/skills/m5-onboard/scripts/onboard.py— new_MAX_ESPTOOL_EXCLUSIVE = (5, 0). Wired into the preflight version gate (both pre- and post-install). New error message tells the user to downgrade with the exact pip spec..claude/skills/m5-onboard/SKILL.md— Dependencies section notes the cap and why; auto-install command lines updated to'esptool>=4.11,<5'; new PEP 668 paragraph in the macOS Platform notes.Repro of the underlying esptool 5.x failure
Cardputer-Adv (ESP32-S3, native USB), esptool 5.2.0, fresh
m5-onboard go. After ~4:15 ofwrite_flashat 115200 baud no-stub:Downgrading to 4.11.0 with no other changes flashes the same
uiflow2_*.binto the same physical device cleanly (Wrote 8384512 bytes at 0x00000000 in 86.6 seconds; Hash of data verified).Test plan
python -c "import py_compile; py_compile.compile('.claude/skills/m5-onboard/scripts/onboard.py', doraise=True)"passesm5-onboard goon a Cardputer-Adv with esptool 4.11.0 reaches==== DONE ====and the device boots into the launcher_MAX_ESPTOOL_EXCLUSIVEbranch but worth a manual smoke testflash.py'sHash of data verifiedparser is re-confirmed against 5.x stdout wording, lift the cap🤖 Generated with Claude Code