23-04-2021



The CH340 chip is used by a number of Arduino compatible boards to provide USB connectivity, you may need to install a driver, don’t panic, it’s easier than falling off a log, and much less painful.

What worked for me was to use a spare official Arduino Uno that I have to burn the bootloader on the faulty nanos using the ICSP headers on the nano. For this all I did was to follow the instructions here: chinese-clone-of-arduino-nano-with-chip-ch340g-how-to-fix-it. The ONLY thing I did differently was to always set the 'Old Bootloader' option. Macbook Pro under macOS 10.14.2. It hand Blink example installed and the port wasn't visible in the list. I was trying to figured out, whats wrong and connected my Arduino Due through the programming port. MacOS 10.15 (Catalina): To run ArduinoBlocks-Connector on macOs 10.15 (Catalina) you need to follow these steps: Disable application 'security policies', you can follow this tutorial; Run (only the first time) pressing CTRL key to assign file permissions to: python and abconnector (files inside the extracted folder). Stm32f103 usb驱动电脑无法识别的解决办法- STM32F系列属于中低端的32位ARM微控制器,该系列芯片是意法半导体(ST)公司出品,其内核是Cortex-M3。.


Windows

(Manufacturer’s Chinese Info Link)

  1. Download the Windows CH340 Driver
  2. Unzip the file
  3. Run the installer which you unzipped
  4. In the Arduino IDE when the CH340 is connected you will see a COM Port in the Tools > Serial Port menu, the COM number for your device may vary depending on your system.

Older Windows Driver Version and Instructions

  1. Download the Windows CH340 Driver
  2. Unzip the folder.
  3. If you are running a 64Bit Windows: – run the SETUP_64.EXE installer.
  4. If you are running a 32Bit Windows: – run the SETUP_32.EXE installer.
  5. If you don’t know, try the 64 bit and if it doesn’t work, the 32 bit.
  6. In the Arduino IDE when the CH340 is connected you will see a COM Port in the Tools > Serial Port menu, the COM number for your device may vary depending on your system.

Macintosh

(Manufacturer’s Chinese Info Link)

The following github has up to day pkg files for 1.3, 1.4 and 1.5 at time of writing, thanks to Joshua Wallis for bringing this to my attention…

Direct Download Links (from the github repo above):

See the github link above for installation instructions if you need them.

Previous macinstosh downloads if the above doesn’t work for you…

(V1.3) Download the CH340 Macintosh Signed Driver for Mavericks (10.9), Yosemite (10.10) and El Capitan (10.11) and Sierra (10.12)

Inside the zip file you will find a PDF and a “pkg” file, short version, double click the pkg file, the PDF has some extra information.

OSX Sierra (10.12) Note

A kindly user, Maarten Segers reports

FYI, the driver documented here WILL crash on OSX Sierra.

Make sure to use this one instead: https://github.com/MPParsley/ch340g-ch34g-ch34x-mac-os-x-driver

I can personally not test on MacOS and can not vouch for the above drivers at github, but there you go.

See uninstalling information at the bottom of the page if the driver causes problems for you.

Here is an older version of the Mac driver, NOT FOR 10.12 Sierra

(V1.0) Download the CH340 Macintosh Signed Driver for Mavericks (10.9), Yosemite (10.10) and El Capitan (10.11)

Linux

(Manufacturer’s Chinese Info Link)

Drivers are almost certainly built into your Linux kernel already and it will probably just work as soon as you plug it in. If not you can download the Linux CH340 Driver (but I’d recommend just upgrading your Linux install so that you get the “built in” one).

Uninstalling From Macinstosh

A couple of Mac users have said “the driver crashes my mac Sierra how do I uninstall”.

Ch340g Macos Operating System

Firstly regards the crash make sure you installed the 1.3 version of the driver, not the old one. You could download it directly from the Manufacturers Website in case they have issued an update since I wrote this page.

Secondly a quick google search reveals that this is how you uninstall:

  1. Open a terminal and type: cd /Library/Extensions/
  2. Verify that the .kext file is present: ls | grep usbserial.kext
  3. Output should be: usbserial.kext
  4. Then type: sudo rm -R usbserial.kext
  5. Verify that the .kext file has been removed: ls | grep usbserial.kext
  6. Output should be empty.
  7. After you should remove the files stored in receipts folder: cd /private/var/db/receipts/
  8. Find the enties: ls | grep usbserial*
  9. Output should be: codebender.cc.ch34xinstaller.usbserial.pkg.bom codebender.cc.ch34xinstaller.usbserial.pkg.plist
  10. Remove each one of the files of the above list: sudo rm -r filename`
Ch340g Macos

×You're looking at the old version of the wiki! As of January 2020, all pages have been migrated to the new site at: http://wiki.speeduino.com

With the goal of maximum simplicity in mind, the process of compiling and installing the firmware is reasonably straightforward.

  • 3Manually Compiling
    • 3.2Downloading the firmware
    • 3.3Compiling the firmware
    • 3.6Troubleshooting

Latest Stable Firmware

  • Date: April 4th 2019
  • Details: See https://speeduino.com/forum/viewtopic.php?f=13&t=2701

Installation - Easy Method

The simplest method of installing the Speeduino firmware onto a standard Arduino Mega 2560 is with the SpeedyLoader utility. SpeedyLoader takes care of downloading the firmware and installing it onto an Arduino without the need to manually compile any of the code yourself. You can choose the newest firmware that has been released, or select from one of the older ones if preferred. SpeedyLoader will also download the INI file for the firmware you choose so it can be loaded into your TunerStudio project.

  • Windows:32-bit / 64-bit
  • Mac:SpeedyLoader.dmg
  • Linux:SpeedyLoader.AppImage (Will need to be made executable after downloading)
  • Raspberry PiSpeedyLoader.AppImage
    • Linux / RaspberryPi versions require libusb libraries to be installed. EG if on Debian/Ubuntu:
Ch340g

Once the firmware is installed on the board, see Connecting to TunerStudio for more details on how to configure TunerStudio

Manually Compiling

If you want to compile the firmware yourself, or make any code changes, then the source of both the releases and the current development version is freely available. Note that manually compiling the firmware is NOT required to install Speeduino, the easiest (and recommended for most users) method is using SpeedyLoader as described above.

Requirements

  • A Windows, Mac or linux PC
  • One of the following:
    • The Arduino IDE. Current minimum version required is 1.6.7, although a newer version is recommended.
    • PlatformIO. Can be downloaded from http://platformio.org/platformio-ide
  • A copy of the latest Speeduino codebase. See below.
  • A copy of TunerStudio to test that the firmware has uploaded successfully

Downloading the firmware

There are two methods for obtaining the Speeduino firmware:

  1. Regular, stable code drops are produced and made as releases on Github. These can be found at: https://github.com/noisymime/speeduino/releases
  2. If you want the latest and greatest (And occasionally flakiest) code, the git repository can be cloned and updated. See https://github.com/noisymime/speeduino

Older firmware releases

If required, older firmware releases and details can be found at Firmware History

Ch340g Macos Versions

Compiling the firmware

  • Start the IDE, select File > Open, navigate to the location you downloaded Speeduino to and open the speeduino.ino file.
  • Set the board type: Tools > Board > Arduino Mega 2560 or Mega ADK (This is the only board currently supported)
  • Click the Verify icon in the top left corner (Looks like a tick)

At this point you should have a compiled firmware! If you experienced a problem during the compile, see the Troubleshooting section below.

This video walks through the whole process of installing the firmware on your Arduino from scratch:

Optional (But recommended)

There is an option available for changing the compiler optimization level, which can improve . By default, the IDE uses the -Os compile option, which focuses on producing small binaries. As the size of the Speeduino code is not an issue but speed is a consideration, changing this to -O3 produces better results (Approximately 20% faster, with a 40% larger sketch size)To do this, you need to edit the platform.txt file:

Was Ist Macos Catalina

  • Make sure the Arduino IDE isn't running
  • Open the platform.txt file which is in the following locations:
    • On Windows: c:Program FilesArduinohardwarearduinoavr
    • On Mac: /Applications/Arduino/Contents/Resources/Java/hardware/arduino/avr/
    • On Linux:
  • On the following 3 entries, change the Os to be O3:
    • compiler.c.flags
    • compiler.c.elf.flags
    • compiler.cpp.flags
  • Save the file and restart the Arduino IDE

Note: This is NOT required if using PlatformIO, the above optimisation is applied automatically there

Ch340g Macos Linux

Installing

Once you've successfully compiled the firmware, installation on the board is trivial.

  • Plug in your Mega 2560 to a free USB port
  • If you're running an older version of Windows and this is the first time you've used an Arduino, you may need to install drivers for the Arduino serial chip (USB-UART or 'USB adapter chip').

Most official boards and many non-official versions use the ATMega16U2 or 8U2, whereas many of the Mega2560 clone boards utilize the CH340G IC. Both types work well. The serial chips can generally be identified by appearance:

ATMega16U (square IC) - drivers included in Windows, MacOS and Linux:

or

WCH CH340G (Rectangular IC) - uses 'CH341' drivers from WCH for Windows:

WCH-original CH340/CH341 drivers for other systems (Mac, Linux, Android, etc) may be found here.


  • In Arduino IDE; select the Mega2560: Tools > Board
  • Select your system's serial port to upload: Tools > Serial Port
  • Hit the Upload button from the top left corner (Looks like an arrow point to the right)

Assuming all goes well, you should see the IDE message that avrdude is done, similar to this:

Verifying Firmware

The firmware is now loaded onto your board and you are now able to move onto Connecting to TunerStudio.

Optionally, you may perform a verification of the firmware by using the Arduino IDE's Serial Monitor. This can be started by selecting 'Serial Monitor' from the Tools menu.

In the window that appears, enter a capital 'S' (no quotes) and press Enter. The Mega should respond with the year and month of the code version installed (xxxx.xx):

NOTE: Ensure the baud rate is set to 115200


You can also enter '?' for a list of queries from your Mega.

Troubleshooting

Incorrect Arduino board selected

If you see the following (or similar) errors when trying to compile the firmware and the solutions:

You may have the wrong kind of Arduino board selected. Set the board type by selecting Tools > Board > Arduino Mega 2560 or Mega ADK

Entire Speeduino project is not opened

The following can occur if you have only opened the speeduino.ino file rather than the whole project.

speeduino.ino:27:21: fatal error: globals.h: No such file or directory

Make sure all the files are contained within the same directory, then select File->Open and find the speeduino.ino file. If you have opened the project correctly, you should have multiple tabs along the top:

Macos
Retrieved from 'http://speeduino.com/wiki/index.php?title=Compiling_and_Installing_Firmware&oldid=14668'