Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework PICKit2 programmer to use libhidapi instead of libhid (which will make it work under macOS) #883

Closed
mariusgreuel opened this issue Feb 18, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@mariusgreuel
Copy link
Contributor

Assuming the PicKit2 programmer is a HID device, I suggest to rework the code to use libhidapi, which is available on all platforms. Then we can drop the remaining libhid support for Windows, including the CMake/Automake support.

#882 already removed libhid support for ser_avrdoper, so the pickit.c code is the last one to reference libhid.

@mariusgreuel mariusgreuel added enhancement New feature or request help wanted Extra attention is needed labels Feb 18, 2022
@mcuee
Copy link
Collaborator

mcuee commented May 8, 2022

This will be great.

We at libusb project recommend to use hidapi for HID device.

Impact of this issue -- PICKit 2 is not supported under macOS, as there is no easy way to detach the kernel HID driver.

@mcuee
Copy link
Collaborator

mcuee commented May 9, 2022

PICKit 2 is an HID device and for sure hidapi is the right cross-platform library to use.
Unfortunately I am not not programmer, but at least I can help testing if someone works on this.

@mcuee
Copy link
Collaborator

mcuee commented Jun 22, 2022

Not so sure if the following enhancement patch can be of some reference value here.

mcprog uses the MCP2210 USB-to-SPI interface.
This code was successfully tested on Linux and MAC.

The patch started as a copy of the pickit2 code already shipped with avrdude, but as the libusb backend seems to be dysfunctional on MAC for quite some time, I replaced libusb by libhidapi.

@MCUdude
Copy link
Collaborator

MCUdude commented Jul 7, 2022

+1!

I was thinking I could help out with #1004, but my PICkit2 doesn't work with MacOS + Avrdude:

$ sudo ./avrdude -cpickit2 -patmega328p
Password:
Could not claim interface. Error code -13, Permission denied
You may need to run avrdude as root or set up correct usb port permissions.
pickit2_write_report failed (ec -2). No such file or directory
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

I'm not capable of doing this job by myself, but I can help out with testing if somebody is ready for a task like this!

@mcuee mcuee changed the title Rework PicKit2 programmer to use libhidapi instead of libhid Rework PICKit2 programmer to use libhidapi instead of libhid Jan 7, 2023
@mcuee
Copy link
Collaborator

mcuee commented Mar 11, 2023

Related request after this is done.

@mcuee mcuee removed the help wanted Extra attention is needed label Jun 27, 2023
@mcuee mcuee added the help wanted Extra attention is needed label Dec 18, 2023
@mcuee mcuee changed the title Rework PICKit2 programmer to use libhidapi instead of libhid Rework PICKit2 programmer to use libhidapi instead of libhid (which will make it work under macOS) Feb 2, 2024
@mcuee mcuee removed the help wanted Extra attention is needed label Feb 8, 2024
@mcuee
Copy link
Collaborator

mcuee commented Mar 3, 2024

Close this one as not planned until someone is actibely working on this issue.

This issue is also linked here.
#1710

@mcuee mcuee closed this as not planned Won't fix, can't repro, duplicate, stale Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants