usb_dw: Clear device address on USB Reset

During USB device reset, the controller must have its device address
cleared (set to 0). This is not really taken into account by most host
side stacks, which is the reason why this bug didn't show up before.
It was found when we were trying to run the USB20CV [1] compliance test
suite on Windows.

Without this fix the device doesn't show up on the targets list, which
means device enumeration failed. With this patch in place the bug is
fixed and the device gets listed.

Tested with the CDC ACM sample application.

Jira: ZEP-950

[1] http://www.usb.org/developers/tools/usb20_tools/

Change-Id: I0b78f7ce043fa29dde0fb7f3b3aecee9844f4d11
Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com>
This commit is contained in:
Jesus Sanchez-Palencia 2016-09-20 16:15:12 -03:00 committed by Anas Nashif
commit 8108aa8990

View file

@ -465,6 +465,9 @@ static void usb_dw_handle_reset(void)
usb_dw_ctrl.status_cb(USB_DC_RESET); usb_dw_ctrl.status_cb(USB_DC_RESET);
} }
/* Clear device address during reset. */
USB_DW->dcfg &= ~USB_DW_DCFG_DEV_ADDR_MASK;
/* enable global EP interrupts */ /* enable global EP interrupts */
USB_DW->doepmsk = 0; USB_DW->doepmsk = 0;
USB_DW->gintmsk |= USB_DW_GINTSTS_RX_FLVL; USB_DW->gintmsk |= USB_DW_GINTSTS_RX_FLVL;