ESP32C3 Serial.print not working

Hi,
I have a ESP32C3-mini board from waveshare (https://www.waveshare.com/esp32-c3-zero.htm)
RGB LED on board is working as expected but Serial.print() is not working, not printing anything. What is the problem?

#define PIN1 8
#define LED1 10
#define onDelay 500
#define RGB_BRIGHTNESS 10

void setup() {
  Serial.begin(9600);
 
  pinMode(LED1, OUTPUT);
  digitalWrite(LED1, HIGH);
  delay(onDelay);
  digitalWrite(LED1, LOW);
  delay(onDelay); 
}

void loop() {

  delay(onDelay);
  Serial.println("loop()");

 delay(onDelay);
  neopixelWrite(LED1,RGB_BRIGHTNESS,RGB_BRIGHTNESS,RGB_BRIGHTNESS); // Red
  delay(onDelay);
  digitalWrite(LED1, LOW);    // Turn the RGB LED off
  neopixelWrite(LED1,0,0,0); // Red
  delay(onDelay);

  neopixelWrite(LED1,RGB_BRIGHTNESS,0,0); // Red
  delay(onDelay);
  neopixelWrite(LED1,0,RGB_BRIGHTNESS,0); // Green
  delay(onDelay);
  neopixelWrite(LED1,0,0,RGB_BRIGHTNESS); // Blue
  delay(onDelay);
  neopixelWrite(LED1,0,0,0); // Off / black
  delay(onDelay);
}

I also removed all LED code and left only Serial... lines, still not printing at all.
I tried serial console with Putty as well.
I am using Ardino 2.3.2 on Windows 11 Home 64bit

Serial Monitor:

What is value of onDelay?
You did not check that the Serial port was ready.

Hi @kahlenberg. A fairly unique thing about the boards that use the microcontrollers of the ESP32 family with native USB capability (as is the case with your board) is that they are typically configured to disable the use of their USB CDC serial port in the sketch by default.

That default disabled configuration is appropriate when your sketch doesn't use the serial port, but in cases where you do need it (such as when your sketch calls Serial.println, etc.), then it is necessary to configure the board so that the port will be enabled. Fortunately this is quite easy since the ESP32 boards platform developers configured the board definition to produce a custom board options menu you can use to enable or disable the port as needed via the Arduino IDE user interface.

Please try this:

  1. Select Tools > USB CDC On Boot > Enabled from the Arduino IDE menus.
  2. Upload the sketch to your board again, just as you did before.

Now check the Serial Monitor. Hopefully you will now see the expected output from the board there.

2 Likes

Where?

The instructions were intended for the OP who has a specific version of the ESP32-C3, a single core processor. Since you have selected a completely different board you don't see the option referred to above.

1 Like

Ok, I changed to that board and now I see it.

OMG :open_mouth: it worked! I was dealing with it since yesterday. Thank you soo much.

You are welcome. I'm glad it is working now.

Regards,
Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.