Sunday, December 30, 2007

PICDEM FS USB Demo Board under Linux

PICDEM FS-USB demo board is the demonstration and evaluation board for the PIC18F4550 family of Flash microcontrollers with full speed USB 2.0 interface

Back in 2005, people have developed application based on libusb to get it work under Linux. I have since patched them to work under Windows as well using libusb-win32.

Bootloader under Linux:
My latest patches:

Demo mode which includes my patches for libusb-win32:
My latest patches to detach kernel ldusb driver for later Linux kernels.

Interesting discussion about the ldusb driver issue.
Thread: [PATCH 70/78] USB: add picdem device to ldusb:

To me I think it is better to do this in user space using libusb. But the original submitter wants to keep it as he did not know the existence of the libusb based application and has already an in-house application based on the kernel driver.

CDC-ACM demo works fine under Linux. The HID mouse demo also works fine under Linux.

Interestingly, again someone wants to add the bootloader to the kernel. Hopefully this time it will not be included. The libusb based application should still work but why adding so many things to the kernel space when the user space libusb based application works fine.

One FAQ is how to run the libusb based application as a normal user (without root credential). This is a moving target under Linux. Hotplug, udev, udev with PAM and HAL rules are the methods to achieve the goal. You need to choose the right one for the Linux distro you are using.

The following is a good summary.

An older document which does not cover HAL:

Some examples (not really for PICDEM FS-USB but for PICkit 1/2 and ICD2) you can use as the starting point:


Arun Prabhakar said...

where can i find the linux drivers ?
Cant find it on

rgb led project

Xiaofan Chen said...

The program is based on libusb and you can consider it as a user mode driver if you want. libusb is included in most Linux distributions.

Sandeep Senan said...

hi Xionfan,

I have been doing some work on PIC18f4550 and have successfully used your code to get my PIC bootloaded in windows using libusb...

I am now trying to use USB communication with PC and PIC.
How do i use the application PICDEM FS USB demo appliation,found at( ),..I want to know if there is any SDCC port of the firmware side available..The ones i found at forums have lost links.

I am using SDCC for compiling the C code.

So i would be great full,If u could suggest me probable links on SDCC port of C Based firmware for the USB application..

Thanks for the help,
with warm regards

Xiaofan Chen said...

Microchip USB C18 Firmware framework ported to SDCC

I have not tried it yet.