Mac upload fails to /dev/tty.usbmodem52D60049421

I’ve got two identical-looking esp32 boards.

One uploads to /dev/cu.usbserial-02425DA3 fine

The other fails to upload to /dev/cu.usbmodem52D60049421

CURRENT: upload_protocol = esptool
Looking for upload port…
Auto-detected: /dev/cu.usbmodem52D60049421
Uploading .pio/build/esp32dev/firmware.bin
esptool.py v3.1
Serial port /dev/cu.usbmodem52D60049421
Connecting…_
Chip is ESP32-D0WD-V3 (revision 3)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: b8:f0:09:92:2d:70
Uploading stub…
fatal error occurred: Failed to write to target RAM (result was 01070000)
*** [upload] Error 2

Any idea what I should try?

Since the device names are different (/dev/cu.usbserial… vs /dev/cu.usbmodem…), the two boards clearly use different USB-to-serial converter chips.

What USB-to-serial converter chip is on the board that fails? You can look it up by connecting it to your Mac, starting System Information and selecting Hardware / USB. It should display something like “CP2102 USB to UART Bridge Controller”, “USB2.0-Serial” etc. Please provide the shown Product ID and Vendor ID.

Even better would be the chip marking of the actual chip.

BTW: The title mentions “/dev/tty.usb…”. Do not use /dev/tty… devices for serial communication. Always use the /dev/cu… devices.

Unfortunately, I can’t see any information about the connected USB in System Information.

If your device appears as /dev/cu.usbmodem…, it must also appear in the System Information. Please check again.

Success! The non-working board has these details
USB Single Serial:
Product ID: 0x55d4
Vendor ID: 0x1a86
Version: 4.43

THE FIX!
To get the upload working (on the Lilygo T5-4.7 inch e-paper board):

The problem was the CH9102 is missing its driver (in OSX 12.2.1). Thanks, tech at wch.cn

1 Like

You don’t have a CH340 chip. You have a CH9102F (from the same manufacturer).

This chip has both a vendor specific interface and a standardized USB CDC interface. The latter one is supported out-of-the-box on macOS. But for reasons unknown, it works for the serial monitor but does not work for uploading firmware.

The solution is the one you have described, to install the drivers from WCH. The name of the zip file (“CH34XSER_MAC.ZIP”) is strange as it supports many chips incl. CH9102F.

The driver also supports the CH9102 as well as CH340 according to the documentation:

This installation guide document shows the procedure of installing the macOS driver for the WCH USB-to-SERIAL devices. The driver can be downloaded from the website:
Link: CH34XSER_MAC.ZIP - 南京沁恒微电子股份有限公司

System Requirement

  •  OS X 10.9 to OS X 10.15

  •  OS X 11.0(Big Sur) and above Chip Model Support

  •  CH340/CH341/CH343/CH9101/CH9102/CH9143 (USB to Single Serial Port)

  •  CH342/CH344/ CH347/CH9103 (USB to Multi Serial Ports)

Hi, i would like to ask for a general information about your Lilygo T5-4.7 inch e-paper board:
how do you managed to add its library in Platformio? I can’t find it in Platformio libraries section…