Using the PICKIT 1 USB programmer under Linux

The Pickit 1 USB programmer is nice and simple. It ships with a Windows based program to operate it. Under linux, you have to use something else.

On recent versions of Ubuntu, the program needs to be tweaked to work properly. I followed the instructions outlined by Chen Xiao Fan:
You can try to patch usb_pickit.c under Linux.

if (d){
/* add the following to detach the kernel HID driver under Linux */
    int retval;
    char dname[32] = {0};
    retval = usb_get_driver_np(d, 0, dname, 31);
    if (!retval)
    usb_detach_kernel_driver_np(d, 0);
/* End of added code */

/* This is our device-- claim it */
byte retData[reqLen];
if (usb_set_configuration(d,pickit_configuration)) {
    bad("Error setting USB configuration.\n");
} </pre></code>

This worked perfectly for me. It’s function is to basically disconnect the pickit from the USB HID driver so that the programming software can control it.

Comments

Thanks!

Thanks a bunch for this! I’m so glad I can play with my new toy without having to suffer through windows. Especially now that hitech has a new ide that plays nice with ubuntu (via eclipse)

woohoo!

usb_set_configuration failed from non-root user

I created a DS2490 driver in user space by using lusb, but it can only run from “root”. The function usbsetconfiguration() always fails from non-root user. Can anyone please help?
Thanks, James

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
6 + 11 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Back to top