GD32VF103 usb-device peripheral driver developement

I've been trying to implement a usb-device peripheral driver crate and run into the roadblock of being able to read and write from the usb bus but the usb-device code won't send a more than 12 bytes of the device descriptor. After hacking a bit around in the usb-device code to send all 18 bytes in one packet (in EP packet size = 32 bytes) enumeration still fails with "Timeout while waiting for setup device command" without a request packet having been send from the host (i've been using wireshark to read the packets from the bus).

My current guess is that the poll function isn't correct (and the reset function since i'm not entirely sure what it means for an endpoint to be in a state suitable for enumeration besides EP 0 being allocated,enabled and not having NAK set)

That being said im not really familiar with usb's inner workings. My code is on github gd32vf103xx-usbd. Any hints and resources for learning more about the usb enumeration process are greatly appreciated.

EDIT: Whats also weird is, that the first packet i receive from the host isn't SET_ADDRESS but GET_DESCRIPTOR which should be the other way round if i interpreted the USB 2.0 spec correctly.

Ok it turns out reading the datasheet with a clear mind helps. The first word in the RxFIFO is the transfer status which has to be popped before reading the packet, and it's contents are simmilar enough to be interpretet as a malformed GET_DESCRIPTOR packet.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.