avrdudes / avrdude

AVRDUDE is a utility to program AVR microcontrollers
GNU General Public License v2.0
667 stars 131 forks source link

Mute missing USB device warning when programmer is present with another USB PID #1398

Closed MCUdude closed 1 year ago

MCUdude commented 1 year ago

Some programmers, especially older Atmel ones, tend to have changed their USB PID during their lifespan. The JTAGICE3 for instance, started out with PID 0x2110 but was later changed to 0x2140 when the never CMCIS-DSP firmware was released.

However, the way usb_hidapi.c works, Avrdude prints a warning for every possible USB PID that's not present. Here's an example of a JTAGICE3 that's running the latest firmware.

$ ./avrdude -cjtag3updi -patmega4808
avrdude warning: USB device with VID: 0x03eb and PID: 0x2110 not found
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9650 (probably m4808)

avrdude done.  Thank you.

Perhaps we should remove the "USB device with VID" warning completely, or only show it in -vv, -vvv or -vvvv mode? If no programmer is connected, we'll get a "no device found matching VID" error anyways, which is just as useful.

$ ./avrdude -cjtag3updi -patmega4808
avrdude warning: USB device with VID: 0x03eb and PID: 0x2110 not found
avrdude warning: USB device with VID: 0x03eb and PID: 0x2140 not found
avrdude error: no device found matching VID 0x03eb and PID list: 0x2110, 0x2140
avrdude error: unable to open programmer jtag3updi on port usb

avrdude done.  Thank you.
stefanrueger commented 1 year ago

Good idea. Perhaps still print with -vv?

MCUdude commented 1 year ago

Perhaps still print with -vv?

I'm file with this! I'll create a PR this evening