From 7b2e7ba8cccd28f57b2e1422db0a63bf10f39273 Mon Sep 17 00:00:00 2001 From: David Konsumer Date: Fri, 27 Mar 2026 03:51:44 -0700 Subject: [PATCH] fix: set bDeviceClass/SubClass/Protocol to 0x00 in USB MSC device descriptor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per the USB MSC spec, class/subclass/protocol must be defined at the interface level, not the device level. Setting them at the device level (TUSB_CLASS_MSC / MSC_SUBCLASS_SCSI / MSC_PROTOCOL_BOT) causes macOS to reject enumeration of the mass storage interface entirely — the device shows in System Information as 'Removable' but never appears in Finder or Disk Utility. Setting bDeviceClass=0x00, bDeviceSubClass=0x00, bDeviceProtocol=0x00 tells the host to look at the interface descriptor for class info, which TUD_MSC_DESCRIPTOR already sets correctly. This matches the behavior of CircuitPython and other correct USB MSC implementations, and fixes macOS compatibility without affecting Windows or Linux. --- src/massStorage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/massStorage.cpp b/src/massStorage.cpp index d2b4cd6a..46cabd37 100644 --- a/src/massStorage.cpp +++ b/src/massStorage.cpp @@ -37,9 +37,9 @@ constexpr tusb_desc_device_t kDeviceDescriptor = { sizeof(tusb_desc_device_t), TUSB_DESC_DEVICE, 0x0200, - TUSB_CLASS_MSC, - MSC_SUBCLASS_SCSI, - MSC_PROTOCOL_BOT, + 0x00, // bDeviceClass - defined at interface level (fixes macOS MSC enumeration) + 0x00, // bDeviceSubClass - defined at interface level + 0x00, // bDeviceProtocol - defined at interface level CFG_TUD_ENDOINT0_SIZE, 0x303A, 0x1001,