Bluetooth Hacking?
Linux Installation Process of Microchip development environment

From OpenBeacon

Jump to: navigation, search
Spurnik tag as used on the 25C3 CCC congress

Contents


Getting the OpenBeacon Tag firmware

OpenBeacon Tag related firmware source may be found on our server for occasional browsing (pic16tag Firmware) and for development purposes in our git repository:

 git clone http://www.openbeacon.org/openbeacon.git

Compiler Installation

PIC16F684 Microcontroller from Microchip on the OpenBeacon Tag

Download the HI-TECH C for the PIC10/12/16 MCU Family compiler at http://www.microchip.com. Registration at Microchip seems to be mandatory for that.


Unpack the download archive:

mkdir -p ~/Install
cd ~/Install
unzip ~/Downloads/HCPIC-pro_9_80-linux.zip


You now should have the installation file in that directory which you can execute using sh.

ls -l              # verify if file is there
-rwxr-xr-x. 1 meri meri 8691338 13. Aug 01:25 picc-pro_9.80.6738-linux.run
su                 # switch to root user for further installation
sh ./picc-pro_*.run  # run setup as root


Please setup as follows:

==> Do you accept the terms of the licence agreement? [y/n] y
==> Please enter the installation directory [/usr/hitech/picc/9.80]: 
==> Please enter Serial Number, demo or lite: HCPICP-demo

Leave root mode:

exit

Add path to your startup scripts

gedit ~/.bashrc

Add the following line at the end - make sure to adjust to your actual compiler version:

export PATH=$PATH:/usr/hitech/picc/9.80/bin

To make the changes effective you need to close your current terminal and open a new one.

exit

Programmer installation

PICkit2 USB programmer with six pin 2.54mm header attached
Cut your own six pin 2.54 header and insert into PICkit2 programmer to re-flash tags

At PICkit 2 Development Programmer/Debugger please scroll down to Linux & Mac OS X Software (Unsupported) and download PK2CMD V1.20 Linux Kernel 2.6 Executable Binary.


Example installation process:

mkdir -p ~/Install
cd ~/Install
wget http://ww1.microchip.com/downloads/en/DeviceDoc/pk2cmdv1-20Linux2-6.tar.gz
tar -xvzf pk2cmdv1-20Linux2-6.tar.gz
cd pk2cmdv1-20Linux2-6
su                 # switch to root user for further installation
install *.dat pk2cmd /usr/local/binexit               # switch back to normal user

If you get a No PICkit 2 found. error message, you need to allow access to the programmer to non-root users. Please create a file called pickit.rules at /etc/udev/rules.d/ as root user.

Verify first if the programmer is connected:

lsusb -d 04d8:Bus 002 Device 039: ID 04d8:0033 Microchip Technology, Inc.

Now create /etc/udev/rules.d/pickit.rules :

echo 'SYSFS{idVendor}=="04d8", SYSFS{idProduct}=="0033", MODE="0666"' >> /etc/udev/rules.d/pickit.rules


Please unplug and re-plug your programmer before running pk2cmd again.