Open agners opened 3 years ago
Does an Uno work? I dumped the .hex files, and I didn't see a board-type string in either one...
Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex: file format ihex
Contents of section .sec1:
:
00c0 10042402 06052406 00010705 82030800 ..$...$.........
00d0 ff090401 00020a00 00000705 04024000 ..............@.
00e0 01070583 02400001 04030904 32034100 .....@......2.A. // Here's the vendor string. But no "Uno" anywhere!
00f0 72006400 75006900 6e006f00 20002800 r.d.u.i.n.o. .(.
0100 77007700 77002e00 61007200 64007500 w.w.w...a.r.d.u.
0110 69006e00 6f002e00 63006300 29000000 i.n.o...c.c.)...
0120 00001124 1fbecfef d2e0debf cdbf11e0 ...$............
0130 a0e0b1e0 eceaffe0 02c00590 0d92a631 ...............1
0140 b107d9f7 12e0a6e1 b1e001c0 1d92af32 ...............2
0150 b107e1f7 f1d028c7 53cf9c01 dc01ae57 ......(.S......W
0160 bf4fed91 fc911197 41911196 fc93ee93 .O......A.......
0170 80589f4f e817f907 11f42d93 3c939fb7 .X.O......-.<...
@WestfW Uno should have the same issue. After all, they share the same 10-year old codes. https://github.com/arduino/ArduinoCore-avr/tree/master/firmwares/atmegaxxu2
There is one more issue with the DFU bootloader here. It seems not able to read the AVR chip signature.
When using an Arduino Mega 2560 R3 is connected to a Raspberry Pi running the U-Boot boot loader, it crashes the boot loader during USB enumeration:
Debugging the problem showed that Arduino (or rather the ATmega16U2) announces a product string but does not report one when trying to get the product string (string id 2). This seems to be reproducible on Linux, but Linux seems to recover from the problem:
Note the Product=2, but there is no
Product: ...
line. The device does not report a USB product stringThis can be seen in Wireshark nicely, the string request for
Descriptor Index: 0x02
does not get a properResponse STRING
back. Linux seems to retry 6 times and then giving up and continuing withDescriptor Index: 0x01
, which seems to work:Wireshark trace: ArduinoMega2560-NoProductString.tar.gz
Not sure if this is violating the USB spec or just not being nice, but I think a fix should be rather trivial.
I am not 100% sure where the firmware for the ATmega16U2 of the Arduino Mega R3 comes from, but I assume its from
firmwares/atmegaxxu2/arduino-usbserial/
? If so, then it seems that there is a preprocesssor define missing in the product string descriptor table: https://github.com/arduino/ArduinoCore-avr/blob/9f8d27f09f3bbd1da1374b5549a82bda55d45d44/firmwares/atmegaxxu2/arduino-usbserial/Descriptors.c#L215My device's product ID is
0x0042
butARDUINO_MEGA2560_PID
seems to be0x0010
....(this has been noticed when using Arduino Mega connected to systems running Home Assistant OS: https://github.com/home-assistant/operating-system/issues/1011)