zephyr-cp: CIRCUITPY_USB_MSC is off, so storage USB drive control is missing
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- c
- Lĩnh vực
- backend, embedded-iot
Hướng nghiên cứu
Start with ports/zephyr-cp/supervisor/usb.c and the USB MSC implementation in subsys/usb/device_next/class/usbd_msc_scsi.c; compare the needed lock and remount behavior with supervisor/shared/usb/usb_msc_flash.c. Check how _zephyr_disk_status() reports a disabled drive and how the build enables USB. Done means MSC is enabled for zephyr-cp, storage enable/disable and remount behavior work, and the block-device lock is released appropriately; Zephyr's missing read-only and eject support are noted limitations.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Claude wrote this, with edits by @dhalbert. These are notes for whoever works on this later.
Problem
zephyr-cp presents CIRCUITPY over USB with its own MSC code in ports/zephyr-cp/supervisor/usb.c. Its build never defines CIRCUITPY_USB_MSC, so the USB parts of storage are compiled out. This causes several problems:
disable_usb_drive(),unsafe_disable_usb_drive(), andenable_usb_drive()always raiseRuntimeError: Cannot change USB devices now.remount()is allowed while the host has write access. It should raise "Cannot remount path when visible via USB." instead.remount()clears the block device lock that USB took. zephyr-cp'slocked[0]staystrue, so USB never takes the lock again.- Nothing releases
locked[], so the lock is not dropped on eject or unmount.
Seen on a Feather nRF52840 running zephyr-cp built from 314c0be79f.
What is needed
- Define
CIRCUITPY_USB_MSCfor zephyr-cp when USB is enabled. - Implement LUN enabling and disabling: report CIRCUITPY not ready when
storage_usb_enabled()is false. - Provide
usb_msc_release_circuitpy_lock(),usb_msc_holds_lock(), andusb_msc_remount(), assupervisor/shared/usb/usb_msc_flash.cdoes (the first two are added in #11530).
Zephyr USB MSC support
Unfortunately, some features are missing from Zephyr USB MSC that we need. Checked in adafruit/zephyr at a4d81519a1, subsys/usb/device_next/class/usbd_msc_scsi.c:
- LUN not ready: possible. There is no API for it. But TEST UNIT READY, READ, and WRITE all answer "medium not present" when the disk's status is not
DISK_STATUS_OK(L425, L749, L803). zephyr-cp's_zephyr_disk_status()can returnDISK_STATUS_NOMEDIAwhile the drive is disabled. - Read-only to the host: not supported. MODE SENSE always reports no write protection (L600).
DISK_STATUS_WR_PROTECTis treated as medium not present. So when CIRCUITPY is writable by Python, as afterremount("/", readonly=False)inboot.py, the drive disappears from the host instead of appearing read-only. This needs a Zephyr change. - Eject: no notification. START STOP UNIT is handled inside the class and does not call the disk driver (L610). zephyr-cp cannot release its lock when the host ejects the drive.
- Ngôn ngữ chính
- C
- Star
- 4.6k
- Fork
- 1.4k
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 155
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của adafruit/circuitpython
-
board breaks api
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
adafruit/circuitpython#11099 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Move silabs to ZephyrĐang mởsilabs
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
adafruit/circuitpython#11507 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Feature/API request: portable camera capture across ESP-IDF, Zephyr, and parallel interfacesCó thể đã có người làm @tannewt đã nhận hôm nay. Đang mởcircuitpython api displayio enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
adafruit/circuitpython#11505 · 5 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
adafruit/circuitpython#11472 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
adafruit/circuitpython#11467 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của adafruit/circuitpython
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Policy query leaks host primary block (BSL_PrimaryBlock_deinit skipped) on two early-exit pathsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NASA-AMMOS/BSL#355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
arancormonk/dsd-neo#660 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: remote-ls --updates reports up-to-date OCI refs because it ignores deployed Alt-idCó thể đã có người làm @Joao-kouznetz đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
#242 leftovers: dated narrative and shas in the social-features test planCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
EchoTools/nevr-runtime#264 ·
Maintainer thường phản hồi trong vòng 1 ngày