From 25d731ed0b6a4beb1a3b01c20f8e150dc12a8848 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 13 Jun 2012 17:07:30 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4274 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/OTGv1/usb_lld.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c index 5dc5a1052..d8e0f138d 100644 --- a/os/hal/platforms/STM32/OTGv1/usb_lld.c +++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c @@ -775,6 +775,9 @@ void usb_lld_reset(USBDriver *usbp) { OTG->GRXFSIZ = STM32_USB_OTG1_RX_FIFO_SIZE / 4; otg_rxfifo_flush(); + /* Resets the device address to zero.*/ + OTG->DCFG = (OTG->DCFG & ~DCFG_DAD_MASK) | DCFG_DAD(0); + /* Enables also EP-related interrupt sources.*/ OTG->GINTMSK |= GINTMSK_RXFLVLM | GINTMSK_OEPM | GINTMSK_IEPM; OTG->DIEPMSK = DIEPMSK_TOCM | DIEPMSK_XFRCM;