Build RFIDLer with MPLAB X v2.2 and MPLAB XC32 Compiler v1.33


My RFIDler came in the mail not too long ago and I've been looking forward to firing it up! I noticed that I had to make a couple of modifications to get the PIC project to compile.

References

 

The RFIDler github page indicates that they used MPLAB XC32 v1.21 for the compiler in Mplab-X IDE V1.41. When I went to the microchip website I noticed that the compiler was up to version 1.33 and the IDE was version 2.2. I decided to try and get the project to compile using these newer versions.

Note: I run a Lubuntu 14.04 VM on my Windows 8 laptop. These instructions are geared around getting things working on L/Ubuntu.

 

Download and Install the Microchip components

I downloaded and installed the necessasry components (as referenced by the github page for RFIDler):

When I first tried to install I didn't install the USB and Peripheral support to the correct location and had to make a symlink in order to get the project to build those components correctly.

 

Clone the RFIDLer git repo

Make sure you have git installed (sudo apt-get install git) and pull down the RFIDLer git hub to a location of your choosing (I picked ~/Repos as a place to store my repos for this project)

git clone https://github.com/ApertureLabsLtd/RFIDler.git

This repo contains almost all of the necessary stuff to actually 'do' something with your RFIDler

 

Get the other stuff you'll need

There is a utility that is used when actuallly flashing the RFIDLer firmware that does not come with the repository called mphidflash. I found the necessary steps for getting that working in Ubuntu here:

Download and install mphidflash dependencies

These dependencies are no longer maintained so they aren't available using apt-get:

  • wget http://mirrors.kernel.org/ubuntu/pool/universe/libh/libhid/libhid-dev_0.2.15+20060325-2.2ubuntu1_i386.deb

  • wget http://mirrors.kernel.org/ubuntu/pool/universe/libh/libhid/libhid0_0.2.15+20060325-2.2ubuntu1_i386.deb

  • sudo dpkg -i libhid0_0.2.15+20060325-2.2ubuntu1_i386.deb
  • sudo dpkg -i libhid-dev_0.2.15+20060325-2.2ubuntu1_i386.deb

 

Download and install mphidflash

Now that you have the necessary dependencies to run mphidflash you can download and install it from the google code page. I just picked up the binary package.

  • Unpack the tar.gz file: tar xvzf mphidflash-1.6-bin.tar.gz
  • Since I'm on a 64 bit system I ran this command to make the 64 bit version of mphidflash available for use:
    • sudo cp mphid-flash-1.6-bin/binaries/mphidflash-1.6-linux-64 /usr/sbin

 

Compile & Build the RFIDler.x project

Now that you have the dependencies installed you should be able to compile the Microchip PIC project:

  • Open the MPLAB X IDE
  • Select File -> Open and browse to RFIDler/firmware/Pic32/RFIDler.X
  • Click on Run -> Clean and Build Project

If things don't build you may see errors like this:

"/opt/microchip/xc32/v1.33/bin/xc32-gcc" -g -x c -c -mprocessor=32MX795F512L -DRFIDLER_DEBUG -DVERSION=61 -D_SUPPRESS_PLIB_WARNING=1 -I/microchip_solutions_v2013-06-15/Microchip/Include -I/microchip_solutions_v2013-06-15/Microchip/Include/USB -I/opt/microchip/xc32/v1.21/pic32-libs/include -I./include -MMD -MF build/debug/production/src/select.o.d -o build/debug/production/src/select.o src/select.c
make[2]: *** No rule to make target '/opt/microchip/xc32/v1.32/pic32mx/lib/libmchp_peripheral_32MX795F512L.a', needed by 'dist/debug/production/RFIDler.X.production.hex'.  Stop.
make[2]: *** Waiting for unfinished jobs....


Resolve possible build error

When I scrutinized the above set of messages I noticed that it failed looking for /opt/microchip/xc32/v1.32/pic32mx/lib/libmchp_peripheral_32MX795F512L.a which did not exist on my box. Upon further investigation I found that I had a v1.33 folder, not a v1.32 folder. I was able to get things to build by making a symlink to v1.33 like this:

  • cd /opt/microchip/xc32
  • ln -s v1.33 v1.32

Once I did that the project could compile and build without errors.

 

What's next?

I'll have to try plugging in my RFIDler and fire it up. :)