Hi,
I'm working on the Mbed-OS USB HAL implementation for the nRF52840. I'm having a bit of difficulty getting the expectations of the USB stack to match up with the event information the hardware gives me.
Specifically, I'm wondering when exactly the events EPDATA and EP0DATADONE occur. The datasheet gives some figures and descriptions but leaves some ambiguity.
For example, the status stage of a control transfer is handled by the hardware by triggering the EP0STATUS task. The Mbed-OS stack needs to know when the status stage transfer has been ACK'd. From the diagram in the datasheet for control transfers, it doesn't look like an EP0DATADONE event will be generated for a DATA token ACK during the status stage. However, the description in the USBD registers section makes it sound like it will:
nRF52840 Product Specification V1.0, 6.35.13 Registers, EVENTS_EP0DATADONE description:
An acknowledged data transfer has taken place on the control endpoint
Under what circumstances will EPDATA and EP0DATADONE events be generated? Is an EP0DATADONE event generated when the DATA token of the hardware-handled status stage ACK'd?
Similarly, is an EP0DATADONE event generated during the setup stage of a control transfer after the DATA token is ACK'd?
