I'm using EP2 OUT with double buffering.
Both endpoints (EP2_OUT_BUF0, EP2_OUT_BUF1) are initialized with 2048 N-bytes and the endpoints are set to active.
Expectation: without further interaction 4096 bytes should be received, without a NYET response.
Observed behaviour: after Buf0 is full a NYET response is transmitted instead of an ACK response, despite Buf1 beeing completely empty and active.
This behaviour is especially detrimental to performance if you work with 512 byte buffers for Buf0 and Buf1, because in this case a NYET response is transmitted after every OUT transmission from the host, which requires an unnecessary USB-Ping and reduces throughput.
Is there a workaround or is this a hardware bug?
Hi @pettel,
This is by design of the USB stack implementation of the SDK. As you can see on a comment on "PERI_USBHSD.h":
DATA_PENDING - As long as this bit is set to one and LPM supported bit is set to one, HW will
* return a NYET handshake on every LPM token it receives. If LPM supported bit is set to one and
* this bit is zero, HW will return an ACK handshake on every LPM token it receives. If SW has
* still data pending and LPM is supported, it must set this bit to 1.