From c8f6698050c3499fbe9089320f57f06adf49a574 Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Tue, 15 Feb 2022 13:26:52 +0200 Subject: [PATCH] Fix CDC+JTAG is disabled when WiFi is used on ESP32-C3 Fixes: https://github.com/espressif/arduino-esp32/issues/6264 Thanks @Spritetm --- libraries/WiFi/src/WiFiGeneric.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/WiFi/src/WiFiGeneric.cpp b/libraries/WiFi/src/WiFiGeneric.cpp index 5dfdacdc05d..7ca57a95299 100644 --- a/libraries/WiFi/src/WiFiGeneric.cpp +++ b/libraries/WiFi/src/WiFiGeneric.cpp @@ -555,6 +555,10 @@ void WiFiGenericClass::useStaticBuffers(bool bufferMode){ _wifiUseStaticBuffers = bufferMode; } +// Temporary fix to ensure that CDC+JTAG stay on on ESP32-C3 +#if CONFIG_IDF_TARGET_ESP32C3 +extern "C" void phy_bbpll_en_usb(bool en); +#endif bool wifiLowLevelInit(bool persistent){ if(!lowLevelInitDone){ @@ -587,6 +591,10 @@ bool wifiLowLevelInit(bool persistent){ lowLevelInitDone = false; return lowLevelInitDone; } +// Temporary fix to ensure that CDC+JTAG stay on on ESP32-C3 +#if CONFIG_IDF_TARGET_ESP32C3 + phy_bbpll_en_usb(true); +#endif if(!persistent){ lowLevelInitDone = esp_wifi_set_storage(WIFI_STORAGE_RAM) == ESP_OK; }