USB experts help needed

Wojciech Puchar wojtek at puchar.net
Wed Aug 26 08:16:37 UTC 2020


i am implementing my own "mass storage device" (actually fake but doesn't 
matter) on microcontroller.

I already finished implementing control endpoint part so it is properly 
detected configured itp.

But i have no idea why i'm getting USB reset after successful reply to 
"get max lun" control endpoint command  (0xFE). i reply with one byte of 
zero according to USB mass storage specs.

below is log from my microcontroller's program

USB: RESET
USB: Setting USB address 6
USB: Host received response from control interface.
USB: Sending config descriptor 0100:8 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0100:18 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0300:2 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0300:4 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0301:2 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0301:32 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0302:2 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0302:12 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0200:9 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0200:32 bytes.
USB: Host received response from control interface.
USB: Set configuration 1 received.
USB: Host received response from control interface.
USB: Mass storage get MAX LUN received.
USB: Host received response from control interface.
USB: RESET
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
USB: Setting USB address 6
USB: Host received response from control interface.
USB: Sending config descriptor 0100:8 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0100:18 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0200:9 bytes.
USB: Host received response from control interface.
USB: Sending config descriptor 0200:32 bytes.
USB: Host received response from control interface.
USB: Set configuration 1 received.
USB: Host received response from control interface.
USB: Mass storage reset received.
USB: Host received response from control interface.
USB: Clear endpoint 1 received.
USB: Host received response from control interface.

.
.
.

after reset FreeBSD seems to again perform initialization without asking 
for amount of LUN again

the last "clear endpoint 1" is because i don't have endpoint 1 implemented 
yet


More information about the freebsd-hackers mailing list