Bluetooth Hacking?
Building OpenPCD on Fedora

From OpenPCD

(Redirected from BuildOnFedora)
Jump to: navigation, search

How to build firmware & host tools for OpenPCD in your Fedora Box

Please use Fedora 10 or later for the latest SVN code

The library you mainly require is libusb. So you can give (as a superuser)

#yum install libusb libusb-devel readline-devel

And you will need gnuarm-4.0.2, dfu-programmer.

First you need to get the source of librfid. So, give the following command

$svn co

After this you will get a directory named librfid in your current directory. Now make two copies of that folder, one for the host computer & another for the firmware as & librfid.firm

$cp -r librfid
$mv librfid librfid.firm

Now you are ready to compile librfid. First we will do for the host computer. So, get inside of the host folder.


Now you need to make some changes in the src/, open it in an editor and change line "LDFLAGS_OPENCT=-lopenct" to "LDFLAGS_OPENCT=" and save it. Next,

$./configure --without-openct --prefix=/usr/local/openpcd
$su -c "make install"

Your host box is ready :) Next step is to ready the librfid for the firmware, so get the latest firmware source.

$svn co

Then, make the librfid

$cd librfid.firm/
$export CFLAGS="-I/usr/include -DLIBRFID_FIRMWARE"
$export CC=arm-elf-gcc
$export PATH=/usr/local/gnuarm-4.0.2/bin:$PATH
$./configure --without-openct --host=arm-elf --with-firmware=$HOME/build/openpcd/firmware

Next you need to fix the Makefile in the firmware directory, so that it should point to the correct librfid.

$cd firmware
$vi Makefile
$make DEBUG=1 BOARD=PCD TARGET=main_reqa

In the above example I built the main_reqa firmware, you can change the value according to the firmware you need. At the end you need to upload the firmware on the board

su -c "/usr/local/openpcd/bin/dfu-programmer openpcd dfu_dnload main_reqa.bin"
su -c "/usr/local/openpcd/bin/dfu-programmer openpcd dfu_dnload main_reqa.bin"

Remember you have give the above command twice, due to some bug in the dfu-programmer''!

OpenPCD is ready to ROCK!!