Porting Microchip MCHPFSUSB v1.3 CDC to use sdcc on Linux

Getting Microchip to work on Linux took a bit of head banging but it all seems to work well once you get all of the kinks worked out. Here are the steps:

Do the following to convert the code. Expand the code on a windows box and copy the directory to a Linux box. c:\MCHPFSUSB to ~/MCHPFSUSB for example. Note that if you want to use the PIC18F87J50 then you'll have to get the svn version of sdcc and gputils and add in support fo the PIC18F87J50. See this for more info Make Snapshot. You'll also need inc2h-pic16.pl to convert a header for the PIC18F87J50. If you want to use the 2550 or 4550 you'll need to tweak the perl script (remove PIC18F87J50_FS_USB_PIM, replace 87f50 -> 2550/4550), the Makefile (delete PATH, change MY_BASE=/usr, change SDCC_HOME=$(MY_BASE)/share/sdcc, replace 87f50 -> 2550/4550) and use the correct linker script. Then do:

cd ~
cp -prd MCHPFSUSB MCHPFSUSB.orig
cd ~/where_ever_your_file_are
cp *.lkr crt0iz-rloc.c Makefile mplab2sdcc.pl ~/MCHPFSUSB/fw/Cdc
cd ~/MCHPFSUSB/fw/Cdc
make convert
make crt0iz-rloc.o
make
© Rick Bronson