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:

Connecting....
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: https://github.com/espressif/esptool/issues/280

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: https://github.com/Xinyuan-LilyGO/LilyGo-T-Call-SIM800/issues/139#issuecomment-904390716

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 squix78

Leave a Reply