Description
Board
Lolin S2 Mini
Device Description
Default
Hardware Configuration
Default
Version
v2.0.14
IDE Name
ESP IDF 4.4.6
Operating System
Macos 13, Windows 10
Flash frequency
40Mhz
PSRAM enabled
no
Upload speed
115200
Description
I enable USB CDC On Boot for a project building as ESP IDF component but it is not working.
The steps to enable the project here: https://docs.espressif.com/projects/arduino-esp32/en/latest/esp-idf_component.html
The way I use to enable it mention here: https://esp32.com/viewtopic.php?t=30926#p115761.
I have tried both with release 2.0.14 and latest 2.x branch with the same result .
sdkconfig i use here: https://github.com/espressif/arduino-esp32/blob/2.0.14/tools/sdk/esp32s2/sdkconfig
I add a definition in root project CMakeLists.txt:
add_definitions(
-DARDUINO_USB_MODE
-DARDUINO_USB_CDC_ON_BOOT
)
It can build and flash to the chip, but no output console like when I build the sketch with Arduino with option : "USB CDC On Boot: Enabled"
Sketch
#include <Arduino.h>
static void test_taskfunc(void * p)
{
uint32_t tasknum = (uint32_t)p;
while (true) {
log_i("This is task instance %u running...", tasknum);
delay(10 * random(1, 10));
}
}
void setup()
{
Serial0.begin(115200);
Serial0.setDebugOutput(true);
delay(2000);
Serial0.println("\n==============\nStarting...\n");
log_e("Starting with LOGs.");
Serial0.println("==============\n\n");
delay(750);
for (auto i = 0; i < 5; i++) {
TaskHandle_t th;
// Created tasks all need to have different priorities in order to trigger lockup
UBaseType_t taskPrio = 1 + 2 + i;
if (pdPASS == xTaskCreate(test_taskfunc, "test_taskfunc", 4096, (void *)(i + 1), taskPrio, &th)) {
log_i("Task instance %u created with priority %u", i+1, 3 + i);
} else {
log_e("Task instance %u creation FAILED", i+1);
}
}
}
void loop()
{
log_i("This is the main loop running...");
delay(1000);
}
Debug Message
No output because it is not working
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.