CH9102 Serial-To-USB Driver for Mac OS X

Recently more and more ESP32 hardware is appearing with the WCH CH9102 Serial-To-USB chip. I assume lower costs and higher availability are the reason for this. Lower costs compared to FTDI chips, to the Silicon Labs CP2102 or CP2104. But when I recently started working for the first time with such a device I ran into big problems.

For the latest version of the LilyGO TTGO T-Camera ESP32 the manufacturer made a couple of significant changes. The switched the ESP32-WROVER module with the ESP32 chip, flash and PSRAM are also separately soldered and the module got a “3D antenna”. But I had to deal with a bigger problem at first. LilyGO also replaced the CP2102 chip with the WCH CH9102 UART chip. My Mac OS X 11.5.2 Big Sur installation recognized the chip immediately as

crw-rw-rw-  1 root  wheel   22,  14 Aug 29 08:24 /dev/tty.usbmodemXXXXXXXXXX
crw-rw-rw-  1 root  wheel   22,  15 Aug 29 08:24 /dev/cu.usbmodemXXXXXXXXXX

I changed the lines in my platformio.ini file and used the cu.usbmodemXXXXXXXXXX (actual numbers replaced with XXX). Monitoring seemed to work since I could see the output from the stock firmware.

But every time I tried to flash the chip I got the following output:

Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 3c:71:bf:xx:xx:xx
Uploading stub...

A fatal error occurred: Failed to write to target RAM (result was 01070000)

I first suspected that the esptool needed adaptation for the new chip. There were also a couple of issues on github in the esptool repository:

The Solution

Or might the driver be the problem? The website of the CP2102 manufacturer also did not show a new driver for the chip. After more digging, I finally came across this github issue and genotix’ post:

Genotix links a zip file containing a driver aptly named CH34xVCPDriver_signed.pkg The CH34x driver seems also to work for the CH9102 chip. Now you have to be brave and install the driver by ignoring all Max OS X security warnings and by clicking through installation dialogs in Chinese.

After the installation two new serial devices showed up:

crw-rw-rw-  1 root  wheel   22,  12 Aug 29 08:24 /dev/tty.wchusbseriaXXXX
crw-rw-rw-  1 root  wheel   22,  14 Aug 29 08:24 /dev/tty.usbmodemXXXX
crw-rw-rw-  1 root  wheel   22,  15 Aug 29 08:24 /dev/cu.usbmodemXXXX
crw-rw-rw-  1 root  wheel   22,  13 Aug 29 08:34 /dev/cu.wchusbserialXXXX<--correct

By using the cu.wchusberialXXXX I finally could program the T-Camera module.

Posted by Daniel Eichhorn

Daniel Eichhorn is a software engineer and an enthusiastic maker. He loves working on projects related to the Internet of Things, electronics, and embedded software. He owns two 3D printers: a Creality Ender 3 V2 and an Elegoo Mars 3. In 2018, he co-founded ThingPulse along with Marcel Stör. Together, they develop IoT hardware and distribute it to various locations around the world.

Leave a Reply