On Mon, Dec 7, 2015 at 8:19 PM, Mickael Torres <cont...@mtorres.fr> wrote:
>
> Actually the device attaches as uhid. I don't know which kind of transfer
> is used, I'll have to look into this, but the soft (pk2cmd) uses libusb
> and only works when the device is attached as ugen.

pk2cmd is only for PICkit 2 which is an HID device for the default
configuration. It actually has two configurations and the alternative
configuration is a generic USB device. I have not tried it under OpenBSD
and not so sure if it can use the alternative configuration.

Not so sure if there is a port of hidapi under OpenBSD.
Ref: http://www.signal11.us/oss/hidapi/

We at the libusb project now recommend HIDAPI for generic USB
HID device like PICKit 2.
https://github.com/libusb/libusb/wiki/FAQ#Does_libusb_support_HID_devices

When Jeff Post worked with Microchip developer to get pk2cmd to
work under Linux, there was no HIDAPI, only libusb-0.1.

I was involved heavily at that time to get pk2cmd to work under
Linux and I actually got pk2cmd to work under FreeBSD last time.
https://github.com/psmay/pk2cmd/blob/master/pk2cmd/ReadmeMakefile.txt

> And another soft (pic32prog) which also uses libusb seems to only detect
> the device when it is attached as uhid.
> I'll try to take a look into libusb.

pic32prog seems to supports different USB interface but many of them
uses HID interface.

pk2cmd code github mirror (license not considered to be open source).
https://github.com/psmay/pk2cmd

The Linux backend for pk2cmd is this one.
https://github.com/psmay/pk2cmd/blob/master/pk2cmd/pk2usb.cpp

I have submitted kernel patch to Linux kernel to blacklist PICkit 2 under
Linux so it is not attached to the kernel HID driver.
Ref: 
http://mcuee.blogspot.sg/2008/08/two-trivial-patches-now-in-linux-kernel.html

pic32prog seems to be here.
https://github.com/sergev/pic32prog


-- 
Xiaofan

Reply via email to