How to perform a control IN endpoint transfer with the USB OTG FS core?
I'm attempting to write myself a USB stack on the STM32L476RG, and the reference manual has been pretty subpar so far, which is nothing new apparently. I've gotten to the point where I can receive a SETUP packet request from the host (GetDescriptor for the Device descriptor), but I seemingly cannot find a way then to respond back with more than one packet. The first packet (of eight bytes) is sent successfully and can be seen in WireShark, but the transfer then stops there even after filling the TX-FIFO again for the second packet. Obviously, I'm doing something wrong, and perhaps it'd be clearer if I had a hardware analyzer to decode the raw signals, but alas, I'm empty handed.
I haven't tried increasing the size of the default endpoint beyond 8 bytes (maybe 64 bytes, so thus only one packet is only ever needed to be sent), but even if that did solve the issue, I feel like that'd be ignoring the actual underlying problem.
Here is a simplified sample of the current state of the code.
Any gurus have any ideas?
PS. The reference manual really need to be updated; it makes mention of a "B2BSTUP" bit in "OTG_DOEPINTx" but no such bit exists (but is defined in CMSIS).
