From 851416ea9cb814044005167a1cfefb5704bc33d8 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 19 Aug 2012 06:03:23 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4584 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/OTGv1/usb_lld.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c index 189cb1636..876c982cd 100644 --- a/os/hal/platforms/STM32/OTGv1/usb_lld.c +++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c @@ -103,6 +103,7 @@ static void otg_core_reset(stm32_otg_t *otgp) { /* Wait AHB idle condition.*/ while ((otgp->GRSTCTL & GRSTCTL_AHBIDL) == 0) ; + halPolledDelay(12); /* Core reset and delay of at least 3 PHY cycles.*/ otgp->GRSTCTL = GRSTCTL_CSRST; while ((otgp->GRSTCTL & GRSTCTL_CSRST) != 0) @@ -864,7 +865,7 @@ void usb_lld_start(USBDriver *usbp) { otgp->PCGCCTL = 0; /* Internal FS PHY activation.*/ - otgp->GCCFG = GCCFG_PWRDWN; + otgp->GCCFG = GCCFG_VBUSASEN | GCCFG_VBUSBSEN | GCCFG_PWRDWN; /* Soft core reset.*/ otg_core_reset(otgp);