Can this UNO R3 board be rescued?

I have a somewhat odd problem with an UNO R3 board. The symptom is that when I connect it to the computer, it is not recognised. I work on Linux, so lsusb does not enumerate the board when it is plugged in.

An examination of the USB connector does not reveal anything untoward. The conductors inside the connector look good and the solder joints appear solid.

I know my USB cable is sound because it works with other boards. The board is receiving power as the ON LED light up. For some reason the L LED also lights up a bit dimly but then starts blinking as the uploaded blink sketch kicks in.

The 328P chip on board also works because I can program it with a USBASP programmer via the ICSP header and I have also been able to upload the blink sketch via serial using an auxiliary FTDI board connected appropriately to Rx/Tx, GND and RESET.

The four resistors in the resistor array all read 22ohms.

By process of elimination is seems the problem might be with the 16u2, yet if I connect a USBASP programmer to the ICSP header for the 16u2 , I do get a response from it:

avrdude error: cannot set sck period; please check for usbasp firmware update
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9489 (probably m16u2)

avrdude done.  Thank you.

So might this be a firmware issue? Is there a version of the 16u2 firmware for the R3 board (I found something for earlier boards but not the R3)? If so, can I upload it via the ICSP header? I have not programmed the 16u2 before so this is a little new to me and is why I am asking these questions before attempting anything.

You have messed with the firmware. Maybe do a factory reset?

Not sure but maybe dmesg can shine some light on the problem

  1. Disconnect the board.
  2. Run dmesg - w; the application will not close.
  3. Connect the board.
  4. Observe changes (if any).
  5. Close dmesg.

I'm not familiar with usbasp but may not every firmware version of usbasp supports the 16U2. I found a list (I do not know how up-to-date it is) of supported processors at USBASP Pinout - USBASP AVR Programmer and the 16U2 is not in it.

Yes, it's in the Arduino15 directory under packages\arduino\hardware\avr\1.8.6\firmwares.

1 Like

Its an understandable assumption, but not me, although it seems that perhaps someone has. All I did was attempt to read the signature to see whether the IC was able to respond, which it does. I have not written anything to it yet.

That was a good thought. Unfortunately, dmesg -wH (to show live messages) shows nothing at all when I plug it in. Its like it isn't being plugged in at all, yet there is power, which suggests there is no data being sent.

Its a fair point, but I did check did check prior to attempting to read the signature of the chip. The output from the version of avrdude that I have shows the m16u2 listed:

type or paste code h$ avrdude -c usbasp

avrdude error: no AVR part has been specified; use -p part

Valid parts are:
  uc3a0512   = AT32UC3A0512
  c128       = AT90CAN128
  c32        = AT90CAN32
  c64        = AT90CAN64
  pwm2       = AT90PWM2
  pwm216     = AT90PWM216
  pwm2b      = AT90PWM2B
  pwm3       = AT90PWM3
  pwm316     = AT90PWM316
  pwm3b      = AT90PWM3B
  1200       = AT90S1200
  2313       = AT90S2313
  2333       = AT90S2333
  2343       = AT90S2343
  4414       = AT90S4414
  4433       = AT90S4433
  4434       = AT90S4434
  8515       = AT90S8515
  8535       = AT90S8535
  usb1286    = AT90USB1286
  usb1287    = AT90USB1287
  usb162     = AT90USB162
  usb646     = AT90USB646
  usb647     = AT90USB647
  usb82      = AT90USB82
  m103       = ATmega103
  m128       = ATmega128
  m1280      = ATmega1280
  m1281      = ATmega1281
  m1284      = ATmega1284
  m1284p     = ATmega1284P
  m1284rfr2  = ATmega1284RFR2
  m128a      = ATmega128A
  m128rfa1   = ATmega128RFA1
  m128rfr2   = ATmega128RFR2
  m16        = ATmega16
  m1608      = ATmega1608
  m1609      = ATmega1609
  m161       = ATmega161
  m162       = ATmega162
  m163       = ATmega163
  m164a      = ATmega164A
  m164p      = ATmega164P
  m164pa     = ATmega164PA
  m165       = ATmega165
  m165a      = ATmega165A
  m165p      = ATmega165P
  m165pa     = ATmega165PA
  m168       = ATmega168
  m168a      = ATmega168A
  m168p      = ATmega168P
  m168pa     = ATmega168PA
  m168pb     = ATmega168PB
  m169       = ATmega169
  m169a      = ATmega169A
  m169p      = ATmega169P
  m169pa     = ATmega169PA
  m16a       = ATmega16A
  m16u2      = ATmega16U2
  m16u4      = ATmega16U4
  m2560      = ATmega2560
  m2561      = ATmega2561
  m2564rfr2  = ATmega2564RFR2
  m256rfr2   = ATmega256RFR2
  m32        = ATmega32
  m3208      = ATmega3208
  m3209      = ATmega3209
  m324a      = ATmega324A
  m324p      = ATmega324P
  m324pa     = ATmega324PA
  m324pb     = ATmega324PB
  m325       = ATmega325
  m3250      = ATmega3250
  m3250a     = ATmega3250A
  m3250p     = ATmega3250P
  m3250pa    = ATmega3250PA
  m325a      = ATmega325A
  m325p      = ATmega325P
  m325pa     = ATmega325PA
  m328       = ATmega328
  m328p      = ATmega328P
  m328pb     = ATmega328PB
  m329       = ATmega329
  m3290      = ATmega3290
  m3290a     = ATmega3290A
  m3290p     = ATmega3290P
  m3290pa    = ATmega3290PA
  m329a      = ATmega329A
  m329p      = ATmega329P
  m329pa     = ATmega329PA
  m32a       = ATmega32A
  m32m1      = ATmega32M1
  m32u2      = ATmega32U2
  m32u4      = ATmega32U4
  m406       = ATmega406
  m48        = ATmega48
  m4808      = ATmega4808
  m4809      = ATmega4809
  m48a       = ATmega48A
  m48p       = ATmega48P
  m48pa      = ATmega48PA
  m48pb      = ATmega48PB
  m64        = ATmega64
  m640       = ATmega640
  m644       = ATmega644
  m644a      = ATmega644A
  m644p      = ATmega644P
  m644pa     = ATmega644PA
  m644rfr2   = ATmega644RFR2
  m645       = ATmega645
  m6450      = ATmega6450
  m6450a     = ATmega6450A
  m6450p     = ATmega6450P
  m645a      = ATmega645A
  m645p      = ATmega645P
  m649       = ATmega649
  m6490      = ATmega6490
  m6490a     = ATmega6490A
  m6490p     = ATmega6490P
  m649a      = ATmega649A
  m649p      = ATmega649P
  m64a       = ATmega64A
  m64m1      = ATmega64M1
  m64rfr2    = ATmega64RFR2
  m8         = ATmega8
  m808       = ATmega808
  m809       = ATmega809
  m8515      = ATmega8515
  m8535      = ATmega8535
  m88        = ATmega88
  m88a       = ATmega88A
  m88p       = ATmega88P
  m88pa      = ATmega88PA
  m88pb      = ATmega88PB
  m8a        = ATmega8A
  m8u2       = ATmega8U2
  t10        = ATtiny10
  t102       = ATtiny102
  t104       = ATtiny104
  t11        = ATtiny11
  t12        = ATtiny12
  t13        = ATtiny13
  t13a       = ATtiny13A
  t15        = ATtiny15
  t1604      = ATtiny1604
  t1606      = ATtiny1606
  t1607      = ATtiny1607
  t1614      = ATtiny1614
  t1616      = ATtiny1616
  t1617      = ATtiny1617
  t1624      = ATtiny1624
  t1626      = ATtiny1626
  t1627      = ATtiny1627
  t1634      = ATtiny1634
  t1634r     = ATtiny1634R
  t167       = ATtiny167
  t20        = ATtiny20
  t202       = ATtiny202
  t204       = ATtiny204
  t212       = ATtiny212
  t214       = ATtiny214
  t2313      = ATtiny2313
  t2313a     = ATtiny2313A
  t24        = ATtiny24
  t24a       = ATtiny24A
  t25        = ATtiny25
  t26        = ATtiny26
  t261       = ATtiny261
  t261a      = ATtiny261A
  t28        = ATtiny28
  t3216      = ATtiny3216
  t3217      = ATtiny3217
  t3224      = ATtiny3224
  t3226      = ATtiny3226
  t3227      = ATtiny3227
  t4         = ATtiny4
  t40        = ATtiny40
  t402       = ATtiny402
  t404       = ATtiny404
  t406       = ATtiny406
  t412       = ATtiny412
  t414       = ATtiny414
  t416       = ATtiny416
  t417       = ATtiny417
  t424       = ATtiny424
  t426       = ATtiny426
  t427       = ATtiny427
  t4313      = ATtiny4313
  t43u       = ATtiny43U
  t44        = ATtiny44
  t441       = ATtiny441
  t44a       = ATtiny44A
  t45        = ATtiny45
  t461       = ATtiny461
  t461a      = ATtiny461A
  t48        = ATtiny48
  t5         = ATtiny5
  t804       = ATtiny804
  t806       = ATtiny806
  t807       = ATtiny807
  t814       = ATtiny814
  t816       = ATtiny816
  t817       = ATtiny817
  t824       = ATtiny824
  t826       = ATtiny826
  t827       = ATtiny827
  t828       = ATtiny828
  t828r      = ATtiny828R
  t84        = ATtiny84
  t841       = ATtiny841
  t84a       = ATtiny84A
  t85        = ATtiny85
  t861       = ATtiny861
  t861a      = ATtiny861A
  t87        = ATtiny87
  t88        = ATtiny88
  t9         = ATtiny9
  x128a1     = ATxmega128A1
  x128a1d    = ATxmega128A1revD
  x128a1u    = ATxmega128A1U
  x128a3     = ATxmega128A3
  x128a3u    = ATxmega128A3U
  x128a4     = ATxmega128A4
  x128a4u    = ATxmega128A4U
  x128b1     = ATxmega128B1
  x128b3     = ATxmega128B3
  x128c3     = ATxmega128C3
  x128d3     = ATxmega128D3
  x128d4     = ATxmega128D4
  x16a4      = ATxmega16A4
  x16a4u     = ATxmega16A4U
  x16c4      = ATxmega16C4
  x16d4      = ATxmega16D4
  x16e5      = ATxmega16E5
  x192a1     = ATxmega192A1
  x192a3     = ATxmega192A3
  x192a3u    = ATxmega192A3U
  x192c3     = ATxmega192C3
  x192d3     = ATxmega192D3
  x256a1     = ATxmega256A1
  x256a3     = ATxmega256A3
  x256a3b    = ATxmega256A3B
  x256a3bu   = ATxmega256A3BU
  x256a3u    = ATxmega256A3U
  x256c3     = ATxmega256C3
  x256d3     = ATxmega256D3
  x32a4      = ATxmega32A4
  x32a4u     = ATxmega32A4U
  x32c4      = ATxmega32C4
  x32d4      = ATxmega32D4
  x32e5      = ATxmega32E5
  x384c3     = ATxmega384C3
  x384d3     = ATxmega384D3
  x64a1      = ATxmega64A1
  x64a1u     = ATxmega64A1U
  x64a3      = ATxmega64A3
  x64a3u     = ATxmega64A3U
  x64a4      = ATxmega64A4
  x64a4u     = ATxmega64A4U
  x64b1      = ATxmega64B1
  x64b3      = ATxmega64B3
  x64c3      = ATxmega64C3
  x64d3      = ATxmega64D3
  x64d4      = ATxmega64D4
  x8e5       = ATxmega8E5
  avr128da28 = AVR128DA28
  avr128da32 = AVR128DA32
  avr128da48 = AVR128DA48
  avr128da64 = AVR128DA64
  avr128db28 = AVR128DB28
  avr128db32 = AVR128DB32
  avr128db48 = AVR128DB48
  avr128db64 = AVR128DB64
  avr16dd14  = AVR16DD14
  avr16dd20  = AVR16DD20
  avr16dd28  = AVR16DD28
  avr16dd32  = AVR16DD32
  avr16ea28  = AVR16EA28
  avr16ea32  = AVR16EA32
  avr16ea48  = AVR16EA48
  avr32da28  = AVR32DA28
  avr32da32  = AVR32DA32
  avr32da48  = AVR32DA48
  avr32db28  = AVR32DB28
  avr32db32  = AVR32DB32
  avr32db48  = AVR32DB48
  avr32dd14  = AVR32DD14
  avr32dd20  = AVR32DD20
  avr32dd28  = AVR32DD28
  avr32dd32  = AVR32DD32
  avr32ea28  = AVR32EA28
  avr32ea32  = AVR32EA32
  avr32ea48  = AVR32EA48
  avr64da28  = AVR64DA28
  avr64da32  = AVR64DA32
  avr64da48  = AVR64DA48
  avr64da64  = AVR64DA64
  avr64db28  = AVR64DB28
  avr64db32  = AVR64DB32
  avr64db48  = AVR64DB48
  avr64db64  = AVR64DB64
  avr64dd14  = AVR64DD14
  avr64dd20  = AVR64DD20
  avr64dd28  = AVR64DD28
  avr64dd32  = AVR64DD32
  avr64ea28  = AVR64EA28
  avr64ea32  = AVR64EA32
  avr64ea48  = AVR64EA48
  avr8ea28   = AVR8EA28
  avr8ea32   = AVR8EA32
  ucr2       = deprecated, use 'uc3a0512'
  lgt8f168p  = LGT8F168P
  lgt8f328p  = LGT8F328P
  lgt8f88p   = LGT8F88P


avrdude done.  Thank you.

Thank you. I found it as described in the atmegaxxu2 sub-directory. Given that dmesg shows nothing at all I did wonder whether there was something else going on. However, I found that if I short the 16u2 RESET to GND as per the instructions here:

https://docs.arduino.cc/retired/hacking/software/DFUProgramming8U2/

then the IC does switch into DFU mode and `lsusb' then enumerates it with:

type or paste Bus 003 Device 028: ID 03eb:2fef Atmel Corp. atmega16u2 DFU boo

and dmesg then reports:

[  +5.266758] usb 3-1: new full-speed USB device number 30 using xhci_hcd
[  +0.136721] usb 3-1: New USB device found, idVendor=03eb, idProduct=2fef, bcdDevice= 0.00
[  +0.000010] usb 3-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[  +0.000004] usb 3-1: Product: ATmega16U2 DFU     

So it does seem that the IC is working and data can be transmitted which seems to back up the point made by @sonofcy that is has been messed with.

I figured that I had nothing to loose so tried flashing the 16u2 with the dfu-programmer tool as discussed in that article, but it reports:

$ sudo dfu-programmer atmega16u2 erase
dfu-programmer: no device present.

I notice that in the directory where the firmware lives, there are three versions:

  • sources for arduino-usbdfu
  • sources for arduino-usbserial
  • binaries, including Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3 and another for the R3 with the Genuino name. This aside from other binaries for other boards.

This board is branded 'Arduino' rather than 'Genuino', has the top silkscreen for the R2, but a bottom silkscreen that states its a 'BOARD MODEL UNO R3'.

Since the board is not getting recognized as being present over USB, it would seem that I have little choice but to flash it using its ICSP header, but I am not sure what parameters I might need to specify to avrdude? I am not sure how much to trust the "other" sources out there including the AI regurgitated results that Google spouts out, although I haven't found an official Arduino source for that information yet.

Hurrah!

After a bit of research I found that I it is possible to flash the default firmware and reset the 16u2 to "factory" state with AVRDUDE by using the following command:

avrdude -c usbasp -p m16u2 -U flash:w:[filename.hex] -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m

I copied the firmware file called:

Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex

from .arduino15/packages/arduino/hardare/avr/... to my working directory, shortened its name to something manageable and then ran the above command. This completed successfully showing the firmware upload and fuse settings. After that I disconnected the USBASP programmer and reconnected the board to the USB port. On running lsusb I got:

Bus 003 Device 052: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)

Dmesg now reported some useful activity:

[  +3.782520] usb 3-1: new full-speed USB device number 53 using xhci_hcd
[  +0.138530] usb 3-1: New USB device found, idVendor=2341, idProduct=0043, bcdDevice= 0.01
[  +0.000011] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[  +0.000004] usb 3-1: Manufacturer: Arduino (www.arduino.cc)
[  +0.000004] usb 3-1: SerialNumber: 955303432353515151E2
[  +0.001529] cdc_acm 3-1:1.0: ttyACM0: USB ACM device

Yes! Now that the board was properly recognised, I uploaded the blink sketch and a second later the LED started flashing. I also then uploaded the ASCII table sketch to confirm that serial was working and that printed the table in Serial Monitor as hoped.

I suspect that @sonofcy was right. This had been messed with by someone before I had received the board. Its possible, I suppose, that it got corrupted somehow, but it seems rather more likely that someone had previously uploaded an alternative firmware to it, I dunno, perhaps for a HID project or something? The good news is that the board is now restored to factory state and can be considered "rescued" and in working order.

So post 2 was the solution? If so please mark it as so.