allow storage.disable_usb_drive() and .enable_usb_drive() after boot.py#11124
Open
dhalbert wants to merge 2 commits into
Open
allow storage.disable_usb_drive() and .enable_usb_drive() after boot.py#11124dhalbert wants to merge 2 commits into
dhalbert wants to merge 2 commits into
Conversation
tannewt
requested changes
Jul 16, 2026
tannewt
left a comment
Member
There was a problem hiding this comment.
Could we add a kwarg to emphasize the risk of data corruption?
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.
Allows
storage.disable_usb_drive()and.enable_usb_drive()to be called fromcode.pyor from the REPL.Disabling the USB drive at that time makes the LUN for CIRCUITPY be "not ready", and makes CIRCUITPY read/write to code or to the REPL. This allows user-code file writes, or file writes from the REPL. REPL access will be useful for serial-based code editors and file uploaders.
Re-enabling the USB drive makes the LUN ready again, and makes it read-only again, assuming it was mounted that way. The host computer will find it.
Tested on Linux, Windows 11, and macOS 26.6 beta 5.
Tagging @urfdvw and @makermelissa for interest for code editors.