An Interesting ESP32C3 Development Board

I bought an open-source ESP32C3 development board from Xianyu, and it’s quite interesting.I won’t provide the Xianyu link, but here is the open-source address:https://oshwhub.com/wanfang/esp32c3.An Interesting ESP32C3 Development BoardUpon receiving it, I first flashed a Hello World program to test it, and everything was fine, so I confirmed the receipt. However, after flashing MicroPython, Thonny did not recognize the device. After communicating with the developer of this board and testing repeatedly, he asked me to try reversing the connection. That’s when I realized that the effects of the normal and reverse connections are different. When I reversed the connection, I found that /dev/ttyUSB0 was gone, and I thought I had broken it. He reminded me that the reverse connection was actually the device /dev/ttyACM0.This piqued my interest. I originally bought this board because it can be directly plugged into a breadboard with an LCD screen without wiring, but this interesting dual serial port was an extra surprise.First, some background: The ESP32C3’s pins 18 and 19 can directly serve as USB CDC devices, and connecting to a computer will create a driver-free serial port, appearing as ttyACMx devices on Linux. There are also several UART devices; for example, this board uses CH340 to connect to the computer, which will also create a serial port device. On Windows 10/11, this serial port can have drivers installed via Windows Update, while the Linux kernel has built-in drivers for the CH34x series, with device names as ttyUSBx on Linux. The x in ttyACMx and ttyUSBx is a sequentially assigned number, starting from 0. Besides the ESP32C3, newer chips like the ESP32S3 also come with this USB CDC device. Generally, ESP32C3 or ESP32S3 development boards either choose CH34x series chips or omit the CH34x, but none support both types of serial ports simultaneously.First, I experimented with flashing Hello World using both serial ports and monitored the log output from each serial port. Then I flashed the latest MicroPython 1.26.0 for testing. The conclusions are as follows:1. The flashing effect is the same for both serial ports, whether for Hello World or MicroPython.2. The output for Hello World is the same, but the output from ttyACM0 has error messages, which seem to originate from the first stage of the bootloader after startup; the second stage is the same and has no errors. I suspect some settings are needed, but I am not yet clear on what specific settings are required. The previous image is from ttyUSB0, and the latter is from ttyACM0.An Interesting ESP32C3 Development BoardAn Interesting ESP32C3 Development Board3. MicroPython can enable REPL on both serial ports. However, Thonny can only connect to ttyACM0. The following image is a screenshot of using the idf_monitor tool to connect to the MicroPython REPL.An Interesting ESP32C3 Development BoardSince MicroPython uses the serial port for REPL interaction as well as for file transfer and other functions, I suspect that MicroPython may not support performing all these operations simultaneously on all serial ports, which is why Thonny can only connect to ttyACM0. As for whether it can switch this serial port by compiling MicroPython myself, I am still uncertain.

Leave a Comment