LautOS esp32c3 USB not working

I tried the following code but nothing is shown up in serial monitor. Rest of the code did work:

#include <Arduino.h>

#define PIN_LED1 12
#define PIN_LED2 13

void setup() {
Serial.begin(115200);
Serial.println(“Hello ESP32C3!!”);
pinMode(PIN_LED1, OUTPUT);
pinMode(PIN_LED2, OUTPUT);

}

void loop() {
digitalWrite(PIN_LED1, HIGH);
digitalWrite(PIN_LED2, LOW);
delay(1000);
digitalWrite(PIN_LED2, HIGH);
digitalWrite(PIN_LED1, LOW);
delay(1000);
}

After that I changed the following code still nothing is shown up in serial monitor:

Serial0.begin(115200);
Serial0.println(“Hello ESP32C3!!”);

Lastly I changed
Serial1.begin(115200);
Serial1.println(“Hello ESP32C3!!”);

After then, windows keeps reporting “USB is not recognized” and hence no COM port is detected. I tried unistalling driver, still not working. What can I do?

Here is platformio.ini config:

[env:lolin_c3_mini]

platform = espressif32

board = lolin_c3_mini

framework = arduino

board_build.mcu = esp32c3

board_build.flash_mode = dio

monitor_speed = 115200

How can you use these pins? There is no GPIO12 or GPIO12 on an ESP32C3 chip or the board…

The board also has no dedicated USB-to-serial adapter, so the ESP32C3 chip handles everything. THere has to be a regular Serial.begin() to initialize USB communication. The hardware UART (“TX”, “RX” label) is then either Serial0 or Serial1.

The board I’m using is this.

Now whenever I connect the board, windows cannot recognize it. I cannot upload or open serial monitor.

To put the ESP32-C3 into upload mode

  • press and hold the BOOT button,
  • press the RST button
  • release the BOOT button

Also please change your platform version to 6.8.1 to use the latest Arduno Core 2.0.17 which has a fix for HWCDC fw uploading

platform = espressif32 @ 6.8.1

Then upload your sketch again

You might also add a small delay into your setup to see the hello message.
It takes some time if the ESP boots up to establish the USB Serial connection.

Also put an “alive” message into your loop() function to see if your ESP hangs.

#include <Arduino.h>

#define PIN_LED1 12
#define PIN_LED2 13

void setup() {
  Serial.begin(115200);
  delay(3000); // wait 3 seconds
  Serial.println("Hello ESP32C3!!");
  pinMode(PIN_LED1, OUTPUT);
  pinMode(PIN_LED2, OUTPUT);
}

void loop() {
  Serial.println("alive");
  digitalWrite(PIN_LED1, HIGH);
  digitalWrite(PIN_LED2, LOW);
  delay(1000);
  digitalWrite(PIN_LED2, HIGH);
  digitalWrite(PIN_LED1, LOW);
  delay(1000);
}