From 220919370d9676ca7cb32d8f4d0c3dcfd0f2e54e Mon Sep 17 00:00:00 2001 From: Roman Leonov Date: Mon, 29 Jan 2024 16:37:13 +0100 Subject: [PATCH] fix(dcd_dwc2): Changed OTG Bvalid override configuration for ESP32 Closes https://github.com/espressif/esp-idf/issues/12360 --- src/portable/synopsys/dwc2/dcd_dwc2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/portable/synopsys/dwc2/dcd_dwc2.c b/src/portable/synopsys/dwc2/dcd_dwc2.c index 8cfa00c832..676af237c8 100644 --- a/src/portable/synopsys/dwc2/dcd_dwc2.c +++ b/src/portable/synopsys/dwc2/dcd_dwc2.c @@ -521,8 +521,9 @@ void dcd_init (uint8_t rhport) // Force device mode dwc2->gusbcfg = (dwc2->gusbcfg & ~GUSBCFG_FHMOD) | GUSBCFG_FDMOD; - // Clear A override, force B Valid - dwc2->gotgctl = (dwc2->gotgctl & ~GOTGCTL_AVALOEN) | GOTGCTL_BVALOEN | GOTGCTL_BVALOVAL; + // No overrides + dwc2->gotgctl &= ~(GOTGCTL_BVALOEN | GOTGCTL_BVALOVAL | GOTGCTL_VBVALOVAL); + // If USB host misbehaves during status portion of control xfer // (non zero-length packet), send STALL back and discard.