espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
460 stars 154 forks source link

Switch example OUTPUT_GPIO overlaps with USB on ESP32-C3 (MEGH-3037) #103

Open igrr opened 2 years ago

igrr commented 2 years ago

The issue was originally reported in https://github.com/espressif/openocd-esp32/issues/192 — after uploading switch example to ESP32-C3 over the built-in USB-SERIAL-JTAG port, USB stops working.

This is probably caused by the fact that OUTPUT_GPIO is set to 19, which is the USB D- pin on ESP32-C3 (and USB D+ pin on ESP32-S3). https://github.com/espressif/esp-rainmaker/blob/722635985e2b99cdade949e611f0079208f360b0/examples/switch/main/app_driver.c#L25

Recommend choosing another pin when building this example for ESP32-C3 and ESP32-S3, e.g. by adding a Kconfig option.

xuniuer commented 2 years ago

C3 is not supported, S2 instead.