Ollie Hirst
Ollie Hirst

Reputation: 592

Arduino Clone CH340g osx issue (driver installed and apparently working)

I'd like to mention that the device I'm talking about in this question works fine using avrdude on a linux machine, the issue appears to be with the OSX driver for the CH340g

I've installed the latest CH34xx driver from www.wch.cn

The device appears to be recognised as /dev/tty.wchusbserial1420

I can connect to the device using avrdude and enter terminal mode, or try to upload, however working with the device seems very erratic.

When i enter terminal mode (using avrdude -t) the tx and rx lights flash indicating the device is connected and working, I get feedback from the UI

Reading | ################################################## | 100% 0.02s

and if I type 'dump flash' or some command during the connection stage (while tx and rx are flashing) and hit enter as soon as the prompt appears, the command will execute, giving output like this:

avrdude> dump flash

0000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

however very shortly after the prompt appears, the 'L' light comes back on. From this point no command gives any output except

avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

This gives me the impression that something happens after avrdude connects, which is resetting the connection, and taking the device out of the avrdude: AVR device initialized and ready to accept instructions state.

I can't upload to the device for a similar looking reason, the output from attempting to upload is:

avrdude: Version 6.0.1, compiled on Apr 14 2015 at 16:30:25
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/Ollie/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.wchusbserial1420
         Using Programmer              : arduino
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 2000
         StabDelay                     : 10
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     1     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256    10    25 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e950f
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (H:00, E:00, L:00)

avrdude done.  Thank you.

As you can see - the issue is not that the driver isn't installed or that avrdude can't see the device, but simply that the connection seems to die as soon as it is established.

I've been unable to find any reference to a similar error using google, and i've tried all the obvious stuff (re-installing drivers, different version of the driver etc)

Upvotes: 1

Views: 936

Answers (1)

Vladimir T
Vladimir T

Reputation: 866

You may have a hardware issue. On OSX it may not be resetting in a proper way, so bootloader not started and you receive "programmer is not responding" error. To fix you need improve your hardware by changing reset circuit. With CH340 reset is driven by RTS and DTR pins.

This also mean that you may try to look at your serial port settings and enable flow control.

Upvotes: 3

Related Questions