Saturday, January 2, 2021

Install PICkit 2 Development Programmer / Debugger on Raspberry Pi OS.

To install PICkit 2 Development Programmer / Debugger on Raspberry Pi OS, we are gonna first prepare our system by installing dependencies, download source code for PICkit 2 command-line application, compile it, and at the end verify test installation.

So for that, we are gonna use these commands as follows:

Update and Install dependencies:

sudo apt update
sudo apt install build-essential libusb-dev

Download and unpack the source files:

wget https://ww1.microchip.com/downloads/en/DeviceDoc/pk2cmdv1.20LinuxMacSource.tar.gz
tar xzvf pk2cmdv1.20LinuxMacSource.tar.gz
cd pk2cmdv1.20LinuxMacSource

Building the application:

make linux

Installing the application:

make install

Adding device file location to PATH:

echo 'export PATH="$PATH:/usr/share/pk2"' >> ~/.bashrc

Reboot system and test installation:

pk2cmd -?v

# PICki2 not connected
Executable Version:    1.20.00
Device File Version:   1.55.00
OS Firmware Version:   PICkit 2 not found

# PICkit2 connected
Executable Version:    1.20.00
Device File Version:   1.55.00
OS Firmware Version:   2.32.00

Uninstall pk2cmd:

Remove file pk2cmd from /usr/local/bin:
sudo rm -R /usr/local/bin/pk2cmd

Remove all files from /usr/share/pk2/:
sudo rm /usr/share/pk2/*

Remove folder /usr/share/pk2/:
sudo rm -R /usr/share/pk2

Edit file .bashrc:
sudo nano ~/.bashrc

Find and Remove line :
export PATH="$PATH:/usr/share/pk2"

Stay healthy and safe till the next time!

1 comment:


  1. Excellent post, DIY Electronics for retail thankful to all your team for sharing such best information.

    ReplyDelete