diff --git a/src/portable/espressif/esp32s2/dcd_esp32s2.c b/src/portable/espressif/esp32s2/dcd_esp32s2.c index 099f3af3..d1e67035 100644 --- a/src/portable/espressif/esp32s2/dcd_esp32s2.c +++ b/src/portable/espressif/esp32s2/dcd_esp32s2.c @@ -170,7 +170,17 @@ void dcd_init(uint8_t rhport) USB0.gusbcfg |= USB_FORCEDEVMODE_M; // force devmode USB0.gotgctl &= ~(USB_BVALIDOVVAL_M | USB_BVALIDOVEN_M | USB_VBVALIDOVVAL_M); //no overrides -#ifdef CONFIG_IDF_TARGET_ESP32S2BETA // needed for beta chip only + +#ifdef CONFIG_IDF_TARGET_ESP32S2BETA + // needed for beta chip only + // there was a bug in the phy logic that made the chip reset as soon as it transmitted anything. + // Setting the B override value made it ignore resets (any resets, generated by the faulty logic or not), + // which 'fixed' the problem well enough to test usb with it. + // Also, do note that the beta silicon run was very small and software support for it is not in mainstream esp-idf, + // as such you may consider phasing out support for it alltogether somewhere in the future + + // TODO we could safely remove this later (maybe after 2020) + //C. chip 7.2.2 hack ESP_LOGV(TAG, "DCD init - chip ESP32-S2 beta hack"); USB0.gotgctl = (0 << USB_BVALIDOVVAL_S); //B override value