Compile the Bus Pirate firmware

From DP

Revision as of 15:50, 9 September 2016 by Mikeb (Talk | contribs)
Jump to: navigation , search

There is also generic guide to compiling PIC projects.


Get the code of Community Firmware v7.0 from Github

First, download and install Microchip's IDE called MPLAB X, and the free demonstration MPLAB XC16 compiler (which seems to have succeeded Microchip C30 compiler, according to [ this page])

Next, download a Bus Pirate source code archive, or get the latest development version from GitHub repository of the Community Firmware v7.0 project

Feedback and patches are welcome!

MPLAB X (Win, Linux, Mac)

First of all, see the general MPLABX page how to install MPLABX. Then you open MPLAB X, load busPirate.X project, then clean and build it. If everything is correct, you will get a new .hex file in your build directory

You don't need a Microchip programmer to develop firmware for the Bus Pirate. You can use Microchip's free development tools and upload code through the USB bootloader. It's a mini PIC 24F development board!


  1. Open the Bus Pirate project in MPLAB.
  2. Uncomment the correct Bus Pirate hardware version and language in base.h.
  3. Compile the project. You may need to modify the compiler location when prompted, but MPLAB X is getting better about making these changes automatically.

Export for bootloader

Mplab-export 001.png

Updated for v4 bootloader, see Compiling PIC projects for more: The compiled firmware must be exported in order to work with the bootloader.

  1. In MPLAB, go to File->Export...
  2. Make sure that the Program Memory box is checked and the range 0 to 0xa7fa is selected.
  3. Uncheck the Configuration Bits box.
  4. Make sure INHX32 (Intel 32bit HEX) is selected on the File Format tab.
  5. Click OK to export the firmware.

Bootload the firmware following your normal upgrade process.