arduino / arduino/ArduinoCore-avr

Arduino Uno or Mega2560 ATmega16U2 DFU FW issue

Open
#490 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
1.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Ref: https://github.com/avrdudes/avrdude/issues/1043
Ref: https://support.arduino.cc/hc/en-us/articles/4408887452434-Flash-USB-to-serial-firmware-in-DFU-mode

There is a FW issue with the ATmega16U2 DFU firmware (or the combined DFU+USB serial FW) here. The issue is that it is not able to read the device signature properly.
https://github.com/arduino/ArduinoCore-avr/tree/master/firmwares/atmegaxxu2

Symptom -- using avrdude flip1 programmer.
```
PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git.exe -c usbasp -qqp m16u2
-U flash:r:read_16u2_usbasp.hex:i && echo OK
OK

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git.exe -c flip1 -qqp m16u2
-U flash:v:read_16u2_usbasp.hex:i && echo OK
avrdude_git.exe: Warning: Failed to read USB device string 1: Input/output error
avrdude_git.exe: Warning: USB bDeviceClass = 0 (expected 254)
avrdude_git.exe: Warning: USB bDeviceSubClass = 0 (expected 1)
avrdude_git.exe: Expected signature for ATmega16U2 is 1E 94 89
Double check chip, or use -F to override this check.

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git.exe -c flip1 -qqp m16u2
-F -U flash:v:read_16u2_usbasp.hex:i && echo OK
avrdude_git.exe: Warning: Failed to read USB device string 1: Input/output error
avrdude_git.exe: Warning: USB bDeviceClass = 0 (expected 254)
avrdude_git.exe: Warning: USB bDeviceSubClass = 0 (expected 1)
avrdude_git.exe: Expected signature for ATmega16U2 is 1E 94 89
OK

```

BTW, dfu-progammer works ok. I guess it does not really read the device signature.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the firmware files in firmwares/atmegaxxu2 and reproduce the issue using the avrdude flip1 command shown in the report. Compare its device-signature behavior with usbasp and dfu-programmer; done means the ATmega16U2 signature is read correctly without requiring -F.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, c
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.