Repository navigation
Make storage.disable_usb_drive() work on zephyr-cp - #11901
Conversation
Zephyr always registered the MSC class and always reported media, so storage.disable_usb_drive() had no effect. Skip MSC registration and report no media when storage_usb_enabled() is false, and pass the MSC flags from the build script. Add a tusb.h shim so shared storage code can ask whether USB is connected, and helpers for the CIRCUITPY lock. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
e2071c4 to
fd5ad8e
Compare
dhalbert
left a comment
There was a problem hiding this comment.
The PR has CH32V407 files in it which I think are extraneous. Was this stacked?
|
The Read the Docs failure is a cancelled build, not a docs error. |
This keeps coming up, not sure why. It may be because we are auto-cancelling builds that are unneeded when a later PR merges and can cancel this one. That is something we turned on recently. |
dhalbert
left a comment
There was a problem hiding this comment.
Thanks. There are printk()s in the code for various error conditions. Did you leave them there deliberately?
|
I'll look into the docs build issue and clean up those stray printk's. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Removed the four in this PR's diff. The other printk()s in usb.c were already in main, so I left them. |
What
storage.disable_usb_drive()inboot.pynow hides the CIRCUITPY drive on Zephyr boards.Why
Before, it raised
RuntimeError: Cannot change USB devices now, even inboot.py.So code could not get write access to CIRCUITPY.
Dependencies
Stacked on #11900 (the Metro CH32V4x7 boards). Only the last commit is new.
Fixes #11531.
Testing
boot.pycallsstorage.disable_usb_drive(), then the board is reset from the REPL.boot.py, REPL still upboot.pyCode and testing by Claude, reviewed by me.