aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os/hal/ports/STM32/LLD/USBHv1/hal_stm32_otg.h4
-rw-r--r--os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_stm32_otg.h b/os/hal/ports/STM32/LLD/USBHv1/hal_stm32_otg.h
index a0594a3..3322e51 100644
--- a/os/hal/ports/STM32/LLD/USBHv1/hal_stm32_otg.h
+++ b/os/hal/ports/STM32/LLD/USBHv1/hal_stm32_otg.h
@@ -430,12 +430,16 @@ typedef struct {
* @name GCCFG register bit definitions
* @{
*/
+/* Definitions for stepping 1.*/
#define GCCFG_NOVBUSSENS (1U<<21) /**< VBUS sensing disable. */
#define GCCFG_SOFOUTEN (1U<<20) /**< SOF output enable. */
#define GCCFG_VBUSBSEN (1U<<19) /**< Enable the VBUS sensing "B"
device. */
#define GCCFG_VBUSASEN (1U<<18) /**< Enable the VBUS sensing "A"
device. */
+
+/* Definitions for stepping 2.*/
+#define GCCFG_VBDEN (1U<<21) /**< VBUS sensing enable. */
#define GCCFG_PWRDWN (1U<<16) /**< Power down. */
/** @} */
diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
index 0618d83..523f14d 100644
--- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
+++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
@@ -1386,12 +1386,20 @@ static void _usbh_start(USBHDriver *usbh) {
otgp->PCGCCTL = 0;
/* Internal FS PHY activation.*/
+#if STM32_OTG_STEPPING == 1
#if defined(BOARD_OTG_NOVBUSSENS)
otgp->GCCFG = GCCFG_NOVBUSSENS | GCCFG_PWRDWN;
#else
otgp->GCCFG = GCCFG_PWRDWN;
#endif
+#elif STM32_OTG_STEPPING == 2
+#if defined(BOARD_OTG_NOVBUSSENS)
+ otgp->GCCFG = GCCFG_PWRDWN;
+#else
+ otgp->GCCFG = (GCCFG_VBDEN | GCCFG_PWRDWN);
+#endif
+#endif
/* 48MHz 1.1 PHY.*/
otgp->HCFG = HCFG_FSLSS | HCFG_FSLSPCS_48;