Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

unsafe_disable_usb_drive() cannot be undone

未关闭
#11,394 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
c
领域
embedded-iot

调研方向

Start with the implementations of storage.unsafe_disable_usb_drive(), storage.enable_usb_drive(), and storage.remount(); trace how USB visibility and host write access are handled after disabling the drive. Reproduce the reported sequence on the stated RP2040 board. Done means the drive can be restored to its prior host access mode and remounting does not fail when the drive is no longer visible over USB.

由索引模型根据 Issue 内容生成。

描述

advanced api bug circuitpython api
CircuitPython version and board name
Adafruit CircuitPython 10.3.1 on 2026-09-14; Raspberry Pi Pico with rp2040
Code/REPL
>>> import storage
>>> storage.unsafe_disable_usb_drive()
>>> storage.remount("/", readonly=True, disable_concurrent_write_protection=True)
Zurückverfolgung (jüngste Aufforderung zuletzt):
  Datei "<stdin>", Zeile 1, in <module>
RuntimeError: Der Pfad kann nicht neu gemountet werden, wenn er über USB sichtbar ist.
Behavior

I fail to enable the usb-drive again in normal read-write mode for the host. After disabling the drive, I can re-enable it with storage.enable_usb_drive(), but it is read-only for the host. The docs say:

If you call enable_usb_drive() after code.py starts or in the REPL, you can reverse the effect of a previous unsafe_disable_usb_drive(). The CIRCUITPY drive will reappear to the host, and become read-only again if it was previously read-only.

Before storage.unsafe_disable_usb_drive() it was read-write for the host, so I expect it to be read-write again?!

The RunTime error above is also an error: after storage.unsafe_disable_usb_drive() the drive is not visible via USB, so no need to bail out.

Description

No response

Additional information

Detected with 10.3.0 already, but nothing changed with 10.3.1.

主要语言
C
星标
4.6k
派生
1.4k
平均合并
1 天 6 小时
30 天内合并 PR
145

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

adafruit/circuitpython 的其他 Issue

查看 adafruit/circuitpython 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。