2019-01-23 09:27 PM
Hi All
Can anyone explain this?
I have a USB FS device driver which works as USB-MSD class but when I try to use the same driver for USB-CDC class it fails when the USB host sends a specific control transfer consisting of a SETUP token followed by a non-zero DATA packet. (Specifically when it is informing of the configuration and baud rate).
What I find is that (with a USB analser) the STM32F103's FS USB device is ACKing the DATA but it is not interrupting, nor saving the received data to the buffer. I can see in memory that the SETUP data is still in the buffer and the Rx count value is 0.
All other control transfers (which return DATA in response to a SETUP and then receive a ZERO DATA packet) operate as expected.
What could cause the USB FS device controller to accept the DATA but not store it or interrupt?
Note that if the receiver is not set back to the valid state (for some time) the controller NAKs the DATA, which is what is expected.
Finally note that when the host gives up on this control transfer and sends a following SETUP this is received normally.
Thanks
Mark
2019-01-23 10:10 PM
Update:
I do however wonder - who on earth came up with the rx and tx state bit toggling idea because it makes coding a nightmare and requires more code that simply masking the fields?
Anyhow things are looking good again.
Regards
Mark