-
Notifications
You must be signed in to change notification settings - Fork 284
Description
Greetings, we are implementing a project that leverages the circle framework and I believe I have identified some issues with the dwgadget implementation within Circle.
I know this functionality works fine with the Linux based mass storage driver, so I have reason to believe this is specific to Circle.
I altered the HandleSCSI function to include additional debug logging to help identify what commands may be causing issues.
in the file lib/usb/gadget/usbmsdgadget.cpp
I uncommented the #define MLOGNOTE(From,...) logging command
and added the following line under the class definition
void CUSBMSDGadget::HandleSCSICommand()
MLOGNOTE("HandleSCSICommand","CBWCB[0]=0x%x, CBWCB[1]=0x%x, CBWCB[2]=0x%x, CBWCB[3]=0x%x", m_CBW.CBWCB[0],m_CBW.CBWCB[1],m_CBW.CBWCB[2],m_CBW.CBWCB[3]);
I also enabled the USB_GADGET_DEBUG logs.
To test this, I imaged an SDcard with the file win98qi_v0.9.6_ALL_usb.img and then copied over the required files and output of the sample kernel of test/usb-msd-gadget (specifically in my case, kernel7.img). I am testing on Raspberry Pi Zero 2 W.
Issue 1: Many computer systems will not detect the USB Mass Storage during BIOS detection.
(higher priority)
Here are the logs from 3 boot sessions after I enabled the USB_GADGET_DEBUG logs.
I did have HandleSCSI additional logging enabled, but as the logs reveal the BIOS didn't get that far.
My cmdline.txt was logdev=ttyS1 loglevel=5 usbboost=true sounddev=sndi2s fast=true
I also tried with cmdline.txt as logdev=ttyS1 loglevel=5 sounddev=sndi2s and no difference was found in the logs.
logger: Circle 49.0.1 started on Raspberry Pi Zero 2 W 512MB
logger: Revision code is 902120, compiler has been GCC 14.2.1
00:00:00.66 timer: SpeedFactor is 1.51
00:00:00.68 sdhost: emmc1: sdhost-bcm2835 loaded
00:00:02.20 emmc: Capacity is 15193 MBytes
00:00:02.20 emmc: Found a valid version 3.0x SD card
00:00:02.90 kernel: Compile time: Jun 27 2025 11:43:11
00:00:07.24 dwgadget: IRQ (status 0x00001000)
00:00:07.24 dwgadget: USB reset
00:00:07.24 dwgadget: Set device address to 0
00:00:07.24 dwgadgetep: First in next EP sequence is 0
00:00:07.24 dwgadgetep: Dumping 0x10 bytes starting at 0x22FA8
00:00:07.24 dwgadgetep: 2FA8: 01 00 FF FF FF FF FF FF-FF FF FF FF FF FF FF FF
00:00:09.92 dwgadget: IRQ (status 0x00002000)
00:00:09.92 dwgadget: Enumeration done
00:00:09.92 dwgadget: IRQ (status 0x00000800)
00:00:09.92 dwgadget: USB suspend
00:00:17.07 dwgadget: IRQ (status 0x00001000)
00:00:17.07 dwgadget: USB reset
00:00:17.07 dwgadget: Set device address to 0
00:00:17.07 dwgadgetep: First in next EP sequence is 0
00:00:17.07 dwgadgetep: Dumping 0x10 bytes starting at 0x22FA8
00:00:17.07 dwgadgetep: 2FA8: 01 00 FF FF FF FF FF FF-FF FF FF FF FF FF FF FF
00:00:19.75 dwgadget: IRQ (status 0x00002000)
00:00:19.75 dwgadget: Enumeration done
00:00:19.75 dwgadget: IRQ (status 0x00000800)
00:00:19.75 dwgadget: USB suspend
00:00:25.33 dwgadget: IRQ (status 0x00001000)
00:00:25.33 dwgadget: USB reset
00:00:25.33 dwgadget: Set device address to 0
00:00:25.33 dwgadgetep: First in next EP sequence is 0
00:00:25.33 dwgadgetep: Dumping 0x10 bytes starting at 0x22FA8
00:00:25.33 dwgadgetep: 2FA8: 01 00 FF FF FF FF FF FF-FF FF FF FF FF FF FF FF
00:00:28.01 dwgadget: IRQ (status 0x00002000)
00:00:28.01 dwgadget: Enumeration done
00:00:28.01 dwgadget: IRQ (status 0x00000800)
00:00:28.01 dwgadget: USB suspend