ESP32 C3 Development Board wont print to serial monitor

CyBaart
Posts: 3
Joined: Mon Apr 26, 2021 8:07 am

ESP32 C3 Development Board wont print to serial monitor

Postby CyBaart » Mon Mar 13, 2023 8:40 pm

Hello, I've just received a few of these boards to try out and my first attempts have failed. I have googled but not found any solution. Basically, when the board is connected to my PC (Windows 10) via the USB cable, and I have successfully uploaded a sketch to it using the correct COM port, I would normally expect to see something on the serial monitor but nothing. Yes, it is set to the correct baud rate. I have downloaded and installed the enhanced CH343 driver too. So I decided to connect a serial to USB adapter to pins IO21, IO20 (TX0 and RX0) and GND - yes I have TX connected to RX - and open a putty window connected to that adapters COM port but still nothing. Next, I connected the same adapter to IO0 and IO1 (TX1 & RX1) and altered the sketch to Serial1.begin and Serial1.print() as appropriate and still nothing comes through. I don't even get any of the normal preamble messages via USB when I press RST as you get with say ESP32 WROOM modules. I have tried both the latest Arduino IDE 2.0.5 and 1.8.19 and have made sure flash mode was DIO although I have tried DOUT too.

I want to be able to print out to the monitor messages such as BMP180 found or LoRa module found etc so I know the code and the module are working but I simply cant get anything to display on the serial monitor.

Now, I have two of the classic boards with the CH343 chip on board and two without and I get the same problems with all four boards. They are all made by LUATOS.COM who do have a decent wiki once google translates it from Chinese.

Please don't complain that I haven't included my code because its not just one sketch, its every one I try where Serial.begin() and Serial.print() are used - including code would not help.

Is there something I am missing?

debut@bluewin.ch
Posts: 1
Joined: Thu Mar 16, 2023 6:53 pm

Re: ESP32 C3 Development Board wont print to serial monitor

Postby debut@bluewin.ch » Thu Mar 16, 2023 7:05 pm

Hi,

Did you recently upgrade your Arduino Environment and (as I did) forget some of the settings required to get the burning and transcript processes over the serial USB connection running:
- set cdc enabled
- eventually connect pin 9 of the esp32-c3 to ground
Following the FAQ information in
https://wiki.dfrobot.com/SKU_DFR0868_Be ... 3#target_9

Good luck!
Daniel

stillr
Posts: 1
Joined: Fri Mar 31, 2023 8:18 am

Re: ESP32 C3 Development Board wont print to serial monitor

Postby stillr » Fri Mar 31, 2023 8:54 am

I had the same problem when I tried my first luatos ESP32C3 board yesterday. But at first I was not even sure if code was uploaded correctly to the board. I didn't see any indications of problems in the Arduino IDE (using v. 2.0.4, on Win11 PC). I was expecting to use response on Serial Monitor to confirm that things were working. I'm not sure exactly what made it suddenly function as expected. But when I searched for pin numbers for onboard LEDs, I noticed from a review of the luatos board, is that Flash Mode should be set to "DIO" (under tools in Arduino IDE). It was "QIO" in my default Arduino IDE setup.
When I connected my second luatos board today, it immediately started blinking the onboard LEDs. I noticed that I got response on the serial monitor when set to 921600 baud. So the board was shipped with a demo with WIFI soft-AP with option to control one of the onboard LEDs from a client. But everything worked as I'm used to from other ESP32 boards I have used, including serial monitor, when I uploaded another example that included Serial.begin(115200)

Slonni
Posts: 5
Joined: Sat Dec 30, 2023 10:13 pm

Re: ESP32 C3 Development Board wont print to serial monitor

Postby Slonni » Sat Dec 30, 2023 10:48 pm

I have the same issue and no clue how to solve. I can upload my code and see code is running (LED is blinking), but don't see any output from "Serial.println"
I have a custom board ESP32 C3 Super Mini (from Ali Express) and I am trying to get this board running. As usual before writing "real code" I am testing with Blinky and some Serial Prints to the Terminal. I am using PlatformIO as this is "normally" the better platform for writing applications.
The code I am successfully downloading is the following:

Code: Select all

#include <Arduino.h>

#define LED 8 // LED_BUILTIN for ESP32C Super Mini

void setup() {
  Serial.begin(460800);
  
  // Set pin mode
  pinMode(LED,OUTPUT);
  Serial.println("setup: Led set to Output");
}

void loop() {
  digitalWrite(LED,HIGH);
  delay(1000);
  Serial.println("loop: Led set HIGH");

  digitalWrite(LED,LOW);
  delay(1000);
  Serial.println("loop: Led set LOW");
}
In PlatformIO, I am using a project using the following "platformio.ini":

Code: Select all

[env:esp32c3_supermini]
platform_packages = toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
platform = espressif32
board = esp32-c3-devkitm-1
; change microcontroller
board_build.mcu = esp32c3
; change MCU frequency
board_build.f_cpu = 160000000L
framework = arduino
build_flags = 
    -DARDUINO_USB_MODE=1 
    -DDARDUINO_USB_CDC_ON_BOOT=1
    -DARDUINO_ESP32C3_DEV=1
monitor_speed = 460800
The result of this:
Terminal window connects with ESP32C but no output shown:
* Executing task in folder ESP32C3 Super Mini: C:\Users\Bernd\.platformio\penv\Scripts\platformio.exe device monitor --environment esp32c3_supermini

--- Terminal on COM5 | 460800 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
I tried it with two different boards - both same behavior?
I used Google to identify possible solutions, but didn't find any, although mentioned as a problem quite often. The potential solutions I found, I tried and implemented as described in platfromio.ini, but not working.
Maybe someone in this forum is able to come up with a good idea what else I can do.
Any help is highly appreciated.


Slonni
Posts: 5
Joined: Sat Dec 30, 2023 10:13 pm

Re: ESP32 C3 Development Board wont print to serial monitor

Postby Slonni » Mon Jan 01, 2024 1:21 pm

Thanks for the link ... but this is not solving the issue or I am still doing something wrong :(
"... If you use the USB connector, you should have that enabled (-D ARDUINO_USB_CDC_ON_BOOT=1) and set USB Mode to “Hardware CDC and JTAG” (-D ARDUINO_USB_MODE=0). ..."
I put the build_flags as described in the article into platformio.ini:
build_flags =
-D ARDUINO_USB_MODE=0
-D DARDUINO_USB_CDC_ON_BOOT=1
Still no Serial output.
I played around and searched I-Net for other ideas how to solve ...
I finally found an idea to use "USBSerial" instead of "Serial" ... this does the trick :) (USBSerial.println(str))
To be honest - I am still not sure why this solves the problem.
I would like to continue using Serial instead of USBSerial to be able to exchange easily code between Arduino-boards and different ESP32-boards - but it looks not possible until I find a solution for ESP32C3 Super Mini.
If anyone has another solution in mind ... I would highly appreciate.

HEkat0N
Posts: 1
Joined: Fri Jan 26, 2024 10:41 pm

Re: ESP32 C3 Development Board wont print to serial monitor

Postby HEkat0N » Fri Jan 26, 2024 10:59 pm

Hi Slonni,

I have/had the same problem.
I have set the compiler flag "ARDUINO_USB_MODE" to 1. This way I can generate serial output. But somehow the setup function is very fast and I can only print in the loop function. With a delay in setup I can print there too.

My .ini for PlatformIO looks like this:
  1. [env:esp32-c3-devkitm-1]
  2. platform = espressif32
  3. board = esp32-c3-devkitm-1
  4. framework = arduino
  5. monitor_speed = 1152000
  6. build_flags =
  7.     -D ARDUINO_USB_MODE=1
  8.     -D ARDUINO_USB_CDC_ON_BOOT=1

The following test programm works this way.
  1. #include <Arduino.h>
  2.  
  3. #define BUILTIN_LED 8
  4.  
  5. void setup() {
  6.   Serial.begin(115200);
  7.   pinMode(BUILTIN_LED, OUTPUT);
  8.  
  9.   delay(1000);
  10.  
  11.   Serial.println("-------------------------");
  12.   Serial.println("Setup");
  13.   Serial.println("-------------------------");
  14.  
  15. }
  16.  
  17. void loop() {  
  18.   digitalWrite(BUILTIN_LED, HIGH);
  19.   Serial.println("Loop.");
  20.  
  21.   delay(500);
  22.  
  23.   digitalWrite(BUILTIN_LED, LOW);
  24.  
  25.   delay(500);
  26. }

divyang.mm
Posts: 1
Joined: Fri Mar 15, 2024 8:33 am

Re: ESP32 C3 Development Board wont print to serial monitor

Postby divyang.mm » Fri Mar 15, 2024 8:42 am

I had the same issue. Whatever I did, it didn't print in a serial monitor.

I tried the Blink code with "Serial.println" and "USBSerial.println" but didn't work.

It finally worked using Serial.println only. I just changed the following setting in Tools.

- USB CDC On Boot: "Enabled"

lbernstone
Posts: 828
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32 C3 Development Board wont print to serial monitor

Postby lbernstone » Tue Mar 19, 2024 4:55 pm

USBSerial is used by devices with a full USB hardware device (S2 & S3 atm).
It should not be used by devices with a hardware USB aka HWCDC (the -C and -H series).
For those devices, enable "USB CDC on boot" and the "Integrated USB JTAG" output.
This will assign the Serial object to use the HWCDC.
This is equivalent to "-DARDUINO_USB_MODE=1 -DARDUINO_USB_CDC_ON_BOOT=1"
The HWCDC takes some time to initialize, so if you have a device in a reboot loop, you will often not see anything in the serial monitor, not even the boot log.

User avatar
jgustavoam
Posts: 165
Joined: Thu Feb 01, 2018 2:43 pm
Location: Belo Horizonte , Brazil
Contact:

Re: ESP32 C3 Development Board wont print to serial monitor

Postby jgustavoam » Fri Apr 05, 2024 3:05 am

HardwareSerial.h 2.0.6 not work with code 2.0.5
https://github.com/espressif/arduino-esp32/issues/7706

https://github.com/espressif/arduino-es ... 1430601741

I achieve serial communication using the Coolterm program.
https://learn.sparkfun.com/tutorials/te ... -mac-linux

Serial port Setup :
Initial Line States when Port opens:
DTR OFF and RTS OFF (both must be OFF)

These lines were resetting the board. And blocking communication.

In Arduino IDE V2.0.3, I looked for my board's setup - AI-Thinker ESP32-C3-32S and I didn't find it. Maybe that's why the console doesn't work. CH340 chip configuration must be incompatible.
https://docs.ai-thinker.com/en/esp32c3
Retired IBM Brasil
Electronic hobbyist since 1976.

Who is online

Users browsing this forum: No registered users and 136 guests