Arduino UNO with atmega16u2 not detected in Raspberry pi 3

Hi all,

My 2 new Arduino UNO clones are not being detected in Raspberry pi 3.
The OS is Linux based.

uname -a gives the output:

Linux raspberrypi 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l GNU/Linux

The clones use atmega16u2 as the USB to Serial converter.
I have read a lot of posts in various blogs and forums (including forum.arduino.cc) which discuss similar problems but are not specific to my case, hence, finally the post.

I've tried the following:

  • Uploaded code to an atmega328p uc from a working freeduino(having CP2102 chip), placed the uc to the Clone's socket. this works except that I still cant use the Serial communication. I very much need that. :frowning:
  • hardware - My Arduino isn't showing up on my computer. What should I do? - Arduino Stack Exchange
    Still the same problem, coz I can't use the Serial Communication. no /dev/tty* or /dev/ttyACM* detected.
  • have installed dfu-programmer and gone through the steps in here Arduino - DFUProgramming8U2
    The problem here is that on resetting the 16u2 chip, the LEDs indications seem correct but sudo dfu-programer atmega16u2 erase outputs

dfu-programmer: no device present.

  • dmesg | tail outputs this:

[ 3221.981419] usb 1-1.5: new full-speed USB device number 14 using dwc_otg
[ 3222.081447] usb 1-1.5: device descriptor read/64, error -32
[ 3222.301420] usb 1-1.5: device descriptor read/64, error -32
[ 3222.521418] usb 1-1.5: new full-speed USB device number 15 using dwc_otg
[ 3222.621412] usb 1-1.5: device descriptor read/64, error -32
[ 3222.841443] usb 1-1.5: device descriptor read/64, error -32
[ 3222.961511] usb 1-1-port5: attempt power cycle
[ 3223.621424] usb 1-1.5: new full-speed USB device number 16 using dwc_otg
[ 3224.061479] usb 1-1.5: device not accepting address 16, error -32
[ 3224.161417] usb 1-1.5: new full-speed USB device number 17 using dwc_otg

So, it seems like the atmega16u2 is being detected, but not correctly

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00

Guess you all know the rest...

Please guide, any heplful links will be greatly appreciated

You may have a defective cable or pi. This is what I see on a Raspberry Pi 3.

Linux raspberrypi 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l GNU/Linux

usb 1-1.4: new full-speed USB device number 5 using dwc_otg
usb 1-1.4: New USB device found, idVendor=2341, idProduct=0043
usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=220
usb 1-1.4: Manufacturer: Arduino (www.arduino.cc)
usb 1-1.4: SerialNumber: xxxxxxxxxxxxxxxxxxxx
cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

have installed dfu-programmer and gone through the steps in here Arduino - DFUProgramming8U2
The problem here is that on resetting the 16u2 chip, the LEDs indications seem correct but sudo dfu-programer atmega16u2 erase outputs

I just updated an atmega16u2 on an Uno Clone using Linux Mint and IDE1.8.5.

$ locate atmegaxxu2

I then cd into:

 cd /home/kprims/ken/Downloads/arduino-1.8.5/hardware/arduino/avr/firmwares/atmegaxxu2

Check out the README.txt

I used the avrdude command for the Uno v3 and changed it to this.You may have to use the avrdude with the arduino IDE. Something like this:

/home/kprims/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/bin/avrdude -C/home/kprims/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino14/etc/avrdude.conf -v -p atmega16u2  -cstk500v1 -P/dev/ttyACM0 -b19200 -U flash:w:Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

Notice I changed the -p atmega16u2 , the -c usbasp and the Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex
If you are using arduino as isp you would use -cstk500v1 -P/dev/ttyACM0 -b19200

avrdude -p atmega16u2 -P usb -c usbasp -U flash:w:Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9489 (probably m16u2)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex"
avrdude: input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex auto detected as Intel Hex
avrdude: writing flash (15668 bytes):

Writing | ################################################## | 100% 1.19s

avrdude: 15668 bytes of flash written
avrdude: verifying flash memory against Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex:
avrdude: load data flash data from input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex:
avrdude: input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex auto detected as Intel Hex
avrdude: input file Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex contains 15668 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.08s

avrdude: verifying ...
avrdude: 15668 bytes of flash verified
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0xD9"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xD9:
avrdude: load data hfuse data from input file 0xD9:
avrdude: input file 0xD9 contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xF4"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xF4:
avrdude: load data efuse data from input file 0xF4:
avrdude: input file 0xF4 contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0x0F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x0F:
avrdude: load data lock data from input file 0x0F:
avrdude: input file 0x0F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude: safemode: Fuses OK (E:F4, H:D9, L:FF)

avrdude done.  Thank you.
kprims@mint ~/ken/Downloads/arduino-1.8.5/hardware/arduino/avr/firmwares/atmegaxxu2 $ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 2341:0043 Arduino SA Uno R3 (CDC ACM) 
Bus 003 Device 002: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 04f2:0833 Chicony Electronics Co., Ltd 
Bus 001 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


kprims@mint ~/ken/Downloads/arduino-1.8.5/hardware/arduino/avr/firmwares/atmegaxxu2 $ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 006: ID 03eb:2fef Atmel Corp.  ************************Put Uno into DFU *****************
Bus 003 Device 002: ID 1a40:0201 Terminus Technology Inc. FE 2.1 7-port Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 04f2:0833 Chicony Electronics Co., Ltd 
Bus 001 Device 003: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub