diff --git a/src/portable/espressif/esp32s2/dcd_esp32s2.c b/src/portable/espressif/esp32s2/dcd_esp32s2.c index d1e670358..de9ef6b6d 100644 --- a/src/portable/espressif/esp32s2/dcd_esp32s2.c +++ b/src/portable/espressif/esp32s2/dcd_esp32s2.c @@ -168,27 +168,8 @@ void dcd_init(uint8_t rhport) USB0.gahbcfg |= USB_NPTXFEMPLVL_M | USB_GLBLLNTRMSK_M; // Global interruptions ON 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 - // 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 - ets_delay_us(20); - USB0.gotgctl = (0 << USB_BVALIDOVVAL_S) | (1 << USB_BVALIDOVEN_S); //B override value & enable - ets_delay_us(20); -#endif - // C. Setting SNAKs, then connect for (int n = 0; n < USB_OUT_EP_NUM; n++) { USB0.out_ep_reg[n].doepctl |= USB_DO_SNAK0_M; // DOEPCTL0_SNAK