Serial vs printf?
Hello! I'm new to Arduino and working with an ESP32-S3-Matrix board. I'm confused about how Serial output works on this board.
Problem:
When I use this code:
void setup() {
Serial.begin(9600);
Serial.println("Setup done");
}
void loop() {
Serial.println("Hello");
delay(1000);
}
—I see nothing in the Serial Monitor (baud rate is set correctly to 9600).
But when I use this code:
void setup() {}
void loop() {
printf("Hello");
delay(1000);
}
—I do see the output in the Serial Monitor.
Question:
Why does printf() work but Serial.println() doesn’t?
Am I missing something about how Serial works on ESP32-S3 boards?
Thanks a lot for any help!2 Replies
It could be one is using UART and the other is using USB CDC.
If your USB cable is connected to the ESP32-S3 rather than a USB to TTL converter on the board, then you have to enable the USB_CDC_ON_BOOT setting in the Arduino IDE. Otherwise,
Serial is using UART but there is nothing connected to the UART.@Maverick Many thanks! enabling USB_CDC_ON_BOOT fixed it and now I see data from Serial.