Adafruit Feather-S2 using ESP-IDF USB Issue


I’m having issues getting USB and serial to work correctly on an Adafruit Feather-S2 using PlatformIO and ESP-IDF framework. With Arduino IDE, and with the Arduino framework on PlatformIO, I can upload a sketch and monitor serial output without issue. However with ESP-IDF on PlatformIO the serial port /dev/ttyACM0 disappears after uploading.

To upload the first time, I have to hold boot + reset after which the serial port appears and I can upload. The programmer complains that it cannot autoreset because I manually put it in boot mode which is fair enough. However, when I restart the chip the serial port never reappears and to re-upload I have to hold the buttons again. Is there something I need to add to platformio.ini to enable USB serial to work properly?

The sketch is just the hello world ESP-IDF example. I’m running PIO core 6.1.4, Espressif 32 5.1.1, VSCodium 1.70.2 on Manjaro Linux.

Any suggestions welcome!

I have tried setting Component config → ESP32S2-specific → Keep USB peripheral enabled at start up via pio -t menuconfig to no avail.

dmesg does not show anything, nor does lsusb.

It seems like the ESP32S2 is not enabling the USB CDC ADM device at all unless I force it by pushing Boot and Reset buttons.

Can anyone help?

Solved it.

Using pio -t menuconfig you need to set Component config → ESP System Settings → Channel for console output to USB CDC.

Is there any way this can be set as a default option for this board in PlatformIO so new users don’t fall into the same trap?

1 Like

Thank you so much for the info !!! I felt into the trap, but hopefully I read your post !

But Sadly, as I’m using a multicore ESP32-S3, I get the following error :
"… error: static assertion failed: “usb_osglue_*_int is not multicore capable …”

Hopefully, this issue is supposed to soon be fixed : esp32s3 IDF-2048 multicore usb_osglue review (IDFGH-7291) · Issue #8879 · espressif/esp-idf · GitHub

Short update: For multicore, today unfortunately still does not work in esp-idf 5.0.3. Hopefully, they integrated the fix it in the latest esp-idf 5.1.1. However that is not yet incorporated into platformio. Because of that I am really considering to drop platformio for the esp-idf extension in VSCode for quicker access to releases.

Tested, it is fixed in esp-idf 5.1.1. So, we just need to wait for the integration of 5.1.1 into pio.