You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SETUPEND bit in the PERI_CSR0 seems to do _exactly_ what it says.
The bit gets set if a control transaction ends (either by receiving
a new SETUP token, or by completing the status phase with an ACK)
before the DATAEND bit is set.
However, clearing RXPKTRDY seems to be the only flag needed before the
MUSB IP moves on to automatically allowing the status phase to complete.
The datasheet hints at this by saying:
> The interval between setting SERV_RXPKTRDY bit and DATAEND bit
> should be very small to avoid getting a SetupEnd error condition.
By setting the bits separately like we were doing before, if the host
controller completed the status phase while we were still running
through the IRQ handler, the USB IP would detect SetupEnd,
we would interpret it as an error, and then we would fail to
act on, in particular, the SET_ADDRESS command. This manifested in
the device suddenly no longer responding to subsequent GET_DESCRIPTORs.
We now set the bits at the exact same time, so this race window is closed.
This race window does not apply to requests with a data stage
due to the extra packets which are expected.
0 commit comments