zephyr-cp: CIRCUITPY_USB_MSC is off, so storage USB drive control is missing
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- c
- Bereich
- backend, embedded-iot
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- C
- Sterne
- 4.6k
- Forks
- 1.4k
- Ø Merge
- 1 T. 13 Std.
- Gemergte PRs (30 T.)
- 171
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus adafruit/circuitpython
-
documentation enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
adafruit/circuitpython#11689 ·
Maintainer antworten meist innerhalb von 1 Tag
-
analogio bug esp32-p4
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
adafruit/circuitpython#11685 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug sdcardio storage usb
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
adafruit/circuitpython#11715 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Hard faults and watchdog timeouts with combination of ESP32SPI or SPI WIZnet, and wifi monitorEvtl. vergeben @dhalbert hat das heute übernommen. Offenbug network
adafruit/circuitpython#11710 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Feather RP2350: MAX3421E instead of PIO USB host, or a second build?Evtl. vergeben @mikeysklar hat das vor 2 Tagen übernommen. Offenrp2 usb
adafruit/circuitpython#11697 · 4 Kommentare · 2 zugewiesene Personen ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in adafruit/circuitpython
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
pocoproject/poco#5626 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 78/100
VMAFx/vmafx#3260 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
FujiNetWIFI/fujinet-lib#272 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
facebookincubator/muse-gadget-sdk#301 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
luaebpf: the by-example page's intro names two outcomes of a lowering and omits the stop with the default verdictEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offendocumentation severity: low
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
luainkernel/lunatik#2231 ·
Maintainer antworten meist innerhalb von 1 Tag