Ch340 Driver For Mac Catalina

The CH340G USB-to-UART chip is used by a number of inexpensive development boards (e.g. WEMOS and LOLIN branded boards) and USB-to-serial adapters. It is manufactured by a Chinese company called WinChipHead or WCH (International web site, Chinese web site). Unfortunately, it often causes problems on macOS. This guide helps you resolve any problems you might have with the boards and adapters.

Latest macOS Sierra/High Sierra-compatible driver for devices using the CH340G, CH34G or CH34X chipset.This chipset is used in several Arduino-compatible clones and serial-to-USB cables. Windows V3.5; Mac OSX V1.5; © Copyright 2019, wemos.cc Revision 786118bd. After some days of random Google researches and several driver installations without fixing the problem, I finally found out that there are two main USB to UART converter chips used which need different drivers. Official boards use FT232 some chinese boards use a CH340 Chip. CH340 is very cheap, and some people seem to have problems with the drivers, especially on MacOS. CP2012 CP2102 seems to be more reliable - I haven't seen many people reporting problems anyway. If the difference in price isn't too much it's probably sensible to go with CP2012 CP2102. MAC OS 32/64bit (version: 1.5 – 2018/07/05) This driver is for MacOS Sierra/High Sierra. Do not install the drivers for the Mojave, because it seems that the latest versions are equipped with the built CH340/CH341 support.

Like many USB-to-serial solutions, it requires a driver that creates the serial port when the board or adapter is plugged into a USB port of your Mac. Starting with macOS 10.14 Mojave, macOS provides suitable drivers out of the box, implemented by Apple itself. So no additional software is needed.

Main issues

There are three main issues:

  1. Most boards only work for upload speeds / data rates up to 460,800 bps.
  2. Many users have additional drivers from WCH or Repleo installed, either from earlier macOS versions or because of obsolete tips and instructions on the internet. With the additional drivers, two serial ports will be created and one of them will be non-functional. Furthermore PlatformIO will no longer be able to automatically select the port.
  3. There are many forums and web pages with instructions how to install the WCH driver. Unfortunately, they are obsolete. While they were helpful back then, they now cause additional trouble.

Setup

Do not install any additional software for the CH340G if you are using the macOS 10.14 Mojave or later (including macOS Big Sur). macOS includes all the required components. Additional software will cause additional problems.

In your PlatformIO project, add the below line to platformio.ini and you should be ready to upload your sketch:

If you have an older macOS version and cannot upgrade to the latest version, you can download the driver from here.

How to check for Apple drivers

macOS Catalina, macOS Big Sur and later:

should result in something like:

For macOS Mojave, check with ls -l /System/Library/Extensions.

How to check for other drivers

You can check for additional drivers by executing (in a terminal):

Mac

The output will look something like this:

The last entry usbserial.kext is the WCH driver. You should uninstall it (see below). The same would apply to the driver from Repleo. It’s called osx-ch341.kext.

If you can’t see any of these drivers, also check ls -l /System/Library/Extensions.

How to uninstall the WCH driver

To uninstall the driver:

  1. Unplug all boards/adapters with a CH340G chip
  2. Execute the following commands to first unload and then uninstall the driver:

If you remove the driver without first unloading it, you will have to reboot your Mac. If you stick to the order, no reboot is required.

If you want to remove a different driver or a driver in a different location, modify the command line, e.g.:

How to limit the upload speed

The CH340G and/or its driver do not reliably work with speeds of 921,600, yet that’s the default in PlatformIO for many boards. So the below line is required in platformio.ini:

Ch340 Usb To Serial Driver

Monitor speed is usually 115,200 and therefore does not need to be changed.

Checking for the serial port

When you plug in your board, the serial port should appear in /dev and have a name starting with ‘cu.’:

Ch340 Driver Mac

This is the list of all serial ports. /dev/cu.usbserial-1410 is the serial port created by Apple’s driver.

If the output however looks like so, there is a problem:

Two entries have been created for the same board because two drivers for the CH340G chip are installed. One of the ports will work, the other one will cause an error when a connection is attempted. The solution is to uninstall all non-Apple drivers (see above).

Troubleshooting

The general approach for troubleshooting is:

  1. Uninstall the WCH driver
  2. Limit the upload speed
  3. Reboot

Specific problems

Resource busy: ‘/dev/cu.usbserial-1410’

If a resource busy error, occurs, the selected serial port is most likely blocked by a second driver. Uninstalling the WCH driver or other non-Apple drivers (see above) should fix it.

Timed out waiting for packet content*

Linux Ch340 Driver

If a Timed out waiting for packet content error occurs, the upload speed is likely too high. Limit the upload speed (see above) to fix the issue.