How to display Serial.print

Hello,

I’m using platformio on wsl / vs code. I formerly used Arduino IDE.
”Build” and “upload” work fine with pio. But I don’t succeed to monitor what I display using Serial.print.

Here’s an extract of my platform.ini:

build_flags =
    -D ARDUINO_USB_CDC_ON_BOOT=1
    -D ARDUINO_USB_MODE=1
monitor_speed = 115200

and my main.cpp:

void setup() {
  Serial.begin(115200);
  delay(500);
  led.begin();
  led.setBrightness(50);
  led.clear();
  led.show();
}
void loop() {
  led.setPixelColor(0, led.Color(0, 0, 255));
  led.show();
  delay(500);
  led.clear();
  led.show();
  delay(500);
  Serial.print("It blinks!\n");
}

When I hit “Upload and monitor” (and then click on the reset button of the board), I get:

Hard resetting via RTS pin…
— Terminal on /dev/ttyACM0 | 115200 8-N-1
— Available filters and text transformations: debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting...
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3808,len:0x4bc
load:0x403c9700,len:0xbd8
load:0x403cc700,len:0x2a0c
entry 0x403c98d0

I expected to find the “It blinks” text looping in the terminal of vs code?

Thanks for the help

Most ESP32S3 have two ports the serial output can come out of: The UART port (which is then connected to a USB-to-UART converter on the board) or the native USB port.

Which board you have exactly? If the board has two USB ports, which one do you use?

Thanks, my board is an esp32-s3-devkitc-1.

There are 2 usb c ports, one is called “COM” and the other one is called “USB”. I’m using “COM” to upload the firmware, which succeeds, I can see the led blink.

Now for debugging, I’d like to see the “Serial.print” as I did when using Arduino IDE. Thus I was trying the “upload and monitor” button.

This redirects it to the “USB” port not the “COM” port. Remove it.

Thanks a lot, it outputs “it blinks!”.