pico-feedback
pico-feedback copied to clipboard
Datasheet: USB device mode OUT handling
Some clarification in the the datasheet would be appreciated for the handling of USB OUT packets while in device mode.
For the buffer control register section 4.1.2.5.4
:
- Are bits 13 and 29 (the PID / data toggle bits), ever set by the peripheral? Or is it only set by the CPU, and used by the peripheral to determine if a sequence error happened?
For the description of OUT transfers 4.1.2.6.3
:
- If the endpoint is not enabled, does the device send a status token back to the host?
- If a
DATA_SEQ_ERROR
happens, the USB spec says that the peripheral should ACK the packet and discard the transferred data. Does the peripheral discard the data? Or transfer it into the user buffer and set the PID in the control register? (I believe that TinyUSB has a bug if it is transferred, as it never checks the PID bits of the buffer control register after a transfer happens.) - What happens if
ENABLED && !(AVAILABLE && !FULL) && !STALL
? The peripheral should NAK the packet.
Perhaps it should also be made clear that the peripheral should always enter the data phase... but only store the data in the buffer if (AVAILABLE && !FULL)
.
(This issue was prompted by discussion in https://github.com/hathach/tinyusb/issues/1572)