Skip to content

PICKit 4, SNAP, Atmel ICE and Power Debugger only work with hidapi but not libusb #1221

@mcuee

Description

@mcuee

From here:

For this test, I build avrdude without hidapi support. And I make sure the hid drver is already detached and then libusb is used.

hidapi version works fine (with hidapi-libusb backend). So there is a bug here in git main.

mcuee@UbuntuSwift3:~/build/avr/avrdude_main$ cat build_nohidapi.sh 
#!/bin/sh
cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D HAVE_LIBHIDAPI=OFF  -B build_linux
cmake --build build_linux

mcuee@UbuntuSwift3:~/build/avr/avrdude_bin$ ldd ./avrdude_git_nohidapi 
	linux-vdso.so.1 (0x00007ffc52b2f000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa6169f6000)
	libelf.so.1 => /lib/x86_64-linux-gnu/libelf.so.1 (0x00007fa6169da000)
	libusb-0.1.so.4 => /usr/local/lib/libusb-0.1.so.4 (0x00007fa6169d2000)
	libusb-1.0.so.0 => /usr/local/lib/libusb-1.0.so.0 (0x00007fa6169b2000)
	libftdi.so.1 => /lib/x86_64-linux-gnu/libftdi.so.1 (0x00007fa6169a8000)
	libftdi1.so.2 => /usr/local/lib/libftdi1.so.2 (0x00007fa616995000)
	libreadline.so.8 => /lib/x86_64-linux-gnu/libreadline.so.8 (0x00007fa616945000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa616753000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fa616c5f000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fa616737000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa616714000)
	libudev.so.1 => /lib/x86_64-linux-gnu/libudev.so.1 (0x00007fa6166e7000)
	libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fa6166b5000)

mcuee@UbuntuSwift3:~/build/avr/avrdude_bin$ ./avrdude_git_nohidapi -c pickit4_updi -p m4808 -v

avrdude_git_nohidapi: Version 7.0-20221214 (159d126)
                      Copyright the AVRDUDE authors;
                      see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

                      System wide configuration file is /home/mcuee/build/avr/avrdude_bin/avrdude.conf
                      User configuration file is /home/mcuee/.avrduderc
                      User configuration file does not exist or is not a regular file, skipping

                      Using Port                    : usb
                      Using Programmer              : pickit4_updi
avrdude_git_nohidapi: usbdev_open(): found MPLAB PICkit 4 CMSIS-DAP, serno: BUR2009xxxxx
avrdude_git_nohidapi usbdev_open() warning: unable to set configuration 1: Device or resource busy
avrdude_git_nohidapi: found CMSIS-DAP compliant device, using EDBG protocol
avrdude_git_nohidapi usbdev_send() error: wrote -5 out of 912 bytes, err = Input/output error
avrdude_git_nohidapi jtag3_edbg_prepare() error: unable to send command to serial port
avrdude_git_nohidapi main() error: unable to open programmer pickit4_updi on port usb

avrdude_git_nohidapi done.  Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions