WeAct Esp32-C3 Core Serial Monitor doesn't work

I’m trying to get the serial monitor to work with the WeAct Esp32-C3 Core but i don’t get any output.

This is the sketch:

#include <Arduino.h>

void setup() {
    Serial.begin(115200);
    pinMode(8, OUTPUT);
}

void loop() {
    Serial.println("test");

    digitalWrite(8, HIGH);
    delay(1000);
    digitalWrite(8, LOW);
    delay(1000);
}

and platformio.ini:

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
build_unflags = -std=gnu++11
build_flags = 
    -std=gnu++17
monitor_speed = 115200

The led blinks, but there is no output on the serial monitor.

adding

monitor_rts = 0
monitor_dtr = 0

prints this to the serial monitor:

Saved PC:0x420140fa
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd5810,len:0x438
load:0x403cc710,len:0x90c
load:0x403ce710,len:0x2624
entry 0x403cc710

but nothing else and adding:

-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1

does nothing.

I found this thread: ESP-IDF monitor READ only WeAct Studio board [SOLVED] - Golioth Device Help - Golioth Forums

but i can’t set the menuconfig when using the arduino framework because it uses a precompiled version of esp-idf

Any ideas?

ARDUINO_CDC_ON_BOOT must be set to 0 to use the UART interface.
See ESP32-S3 native USB interface and Serial Monitor missing first messages - #10 by sivar2311

Otherwise you have to use Serial0 object.

Still not printing anything

Does your board have a USB to SERIAL chip on it?

Why does the board need a USB to SERIAL chip? Doesn’t the esp32c3 do that?

This is the repo for the board:

under ESP-IDF Use precautions they write:

Software engineering needs to set UART printing to USB Serial/Debug

Ok, then it was a misunderstanding on my side.

To use the builtin USB CDC

-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1

is correct.

If you hover over Serial you should see “HWCDC Serial”:

image

Yes, it says that. ⠀ ⠀

It now works with

-DARDUINO_USB_MODE=1
-DARDUINO_USB_CDC_ON_BOOT=1

and I don’t know why. Maybe I didn’t restart the serial monitor even once while testing with only these two flags?

These flags have no influence on the PlatformIO serial monitor.
They control the build process and define which class is used for the Serial object: HardwareSerial, USBCDC, HWCDC.