drivers: usb_dc_nrfx: Reset dtoggle when stall is cleared

USB Host expects dtoggle to be cleared after ClearFeature(Halt):

"[...] clearing the Halt feature via a ClearFeature(ENDPOINT_HALT)
request results in the endpoint no longer returning a STALL.
For endpoints using data toggle, regardless of whether an endpoint
has the Halt feature set, a ClearFeature(ENDPOINT_HALT) request always
results in the data toggle being reinitialized to DATA0."
- Subsection 9.4.5 of usb 2.0 spec (usb_20.pdf)

Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
This commit is contained in:
Audun Korneliussen 2020-03-02 10:52:25 +01:00 committed by Johan Hedberg
commit 388c6ea01f

View file

@ -1526,6 +1526,7 @@ int usb_dc_ep_clear_stall(const u8_t ep)
return -EINVAL; return -EINVAL;
} }
nrfx_usbd_ep_dtoggle_clear(ep_addr_to_nrfx(ep));
nrfx_usbd_ep_stall_clear(ep_addr_to_nrfx(ep)); nrfx_usbd_ep_stall_clear(ep_addr_to_nrfx(ep));
LOG_DBG("Unstall on EP 0x%02x", ep); LOG_DBG("Unstall on EP 0x%02x", ep);