fix(stm32c5): do not freeze _boot.py (boot hang, REPL unreachable) - #29
Open
cumin777 wants to merge 1 commit into
Open
fix(stm32c5): do not freeze _boot.py (boot hang, REPL unreachable)#29cumin777 wants to merge 1 commit into
cumin777 wants to merge 1 commit into
Conversation
v1.27.0 auto-runs the frozen _boot.py on boot (ports/zephyr/main.c:
pyexec_frozen_module). Its storage init hangs on this board, so the
REPL never starts and Thonny times out ('Backend did not respond' /
'Write timeout'). Stop freezing _boot.py so the board boots straight
to the REPL. Storage auto-mount is deferred until the underlying
storage path is fixed.
Co-Authored-By: Claude <noreply@anthropic.com>
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.
Problem
The STM32C5 firmware (merged in #26) hangs at boot: the REPL never comes up, and Thonny errors with
Backend did not respond in time/Write timeout.Root cause
MicroPython v1.27.0 auto-runs the frozen
_boot.pyon every boot (inports/zephyr/main.c:pyexec_frozen_module("_boot.py", false)). Upstream_boot.pydoes storage mount/format (mount_filesystem_flash/create_flash_partition), and that storage init hangs on this board (external XSPI NOR path), so the board never reaches the REPL. (paullbuth's earlier fork didn't hang because his_boot.pywas try/except-guarded and only run after an erased-probe.)Fix
Stop freezing
_boot.pyinboards/xiao_stm32c5_manifest.py. With it not frozen,main.ccannot find it, skips it, and the board boots straight to the REPL — Thonny connects and runs again.Trade-off / follow-up
Storage (LittleFS) is not auto-mounted on boot until the underlying storage hang is investigated and fixed (then we can either re-freeze a safe
_boot.pyor fix the storage/XSPI config). This PR prioritises unblocking the REPL.Official MicroPython
v1.27.0; no fork, no upstream patch.