Showing posts with label Debian. Show all posts
Showing posts with label Debian. Show all posts

Monday, 2 March 2015

How to use Kal software to workout the PPM frequency offset of a RTL-SDR

The basic idea behind the Kalibrate software is that a GSM mobile phone base station has an expensive very high precision atomic clock (0.01ppb), where as a RTL-SDR stick has a cheap low  precision 28.8MHz quartz crystal (+/-100ppm). This cheap low  precision oscillator is used to derive all frequencies when you tune the RTL-SDR, so the bigger the errors the more you are offset from the correct frequency. There are two pieces of good news the offset is linear and once the cheap crystal has warmed up it generally does not drift very much. Because the error is linear across the whole frequency range, only one correction value is required.

When you buy a 28.8MHz quartz crystal in a can, they are generally not 28,800,000Hz. There are two problems that need to be compensated for by the PPM offset in SDR receiver software. The first is manufacturing tolerance, generally about 100 PPM (0.01%) is the range to keep costs down, so the frequency of a new quartz crystal could be anywhere between 28,797,120Hz and 28,802,880Hz at 20 degrees Celsius. The second problem is that the frequency will change slightly as the device warms up. But the good news is once the device has warmed up it will not drift much, unless the ambient room temperature varies.

So basically you scan the local area for active GSM base station channels with a large amount of power (good signal strength, which will probably be from the base station that is physically closest to your current location). Then kal uses this channels GSM frequency correction bursts to workout the PPM (part per million) offset of the RTL-SDR that you are currently calibrating.


Download, compile and install the kal software

$ sudo apt-get install libtool autoconf automake libfftw3-dev
$ git clone https://github.com/steve-m/kalibrate-rtl
$ cd kalibrate-rtl
$ ./bootstrap && CXXFLAGS='-W -Wall -O3'
$ ./configure 
$ make 
$ sudo make install


Use the kal software to scan GSM base stations for channels with high power

My RTL-SDR only goes from 24MHz to 1750MHz, so I can not use the DCS or PCS GSM system, even if they were active in my area. I know that EGSM is active where I am, but I'll test all the frequencies to time and show how long a scans takes when no GSM is present, as well as how long it takes when GSM base stations are present (about 2-10 minutes). This will also provide the warm up time of about 10 minutes for my RTL-SDR to reach its steady state operating temperature. Some of the GSM down link frequencies are used to send the frequency correction bursts, to calibrate mobile phone handsets, so that the phones know the correction offset to use when TX'ing on the up link frequencies. This allows mobile phone makers to use cheaper hardware in their handsets, and if you are making a few billion of them small savings quickly add up to more profit..
  • GSM850  UPLINK:   824.2-  849.2MHz DOWNLINK:   869.2-  894.2MHz
  • GSM-R     UPLINK:   876.0-  915.0MHz DOWNLINK:   921.0-  960.0MHz
  • GSM900  UPLINK:   890.0-  915.0MHz DOWNLINK:   935.0-  960.0MHz
  • EGSM      UPLINK:   880.0-  915.0MHz DOWNLINK:   925.0-  960.0MHz
  • DCS         UPLINK: 1710.2-1784.8MHz DOWNLINK: 1805.2-1879.8MHz
  • PCS         UPLINK: 1850.2-1909.8MHz DOWNLINK: 1930.2-1989.8MHz
(Source of above info https://en.wikipedia.org/wiki/GSM_frequency_bands#Bands)

(confirm that the RTL-SDR is actually plugged into the Linux machine)
$ lsusb | grep -i RTL
Bus 004 Device 015: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T

(print the help for the kal software to see what arguments should be used)
$ kal
error: must enter channel or frequency
kalibrate v0.4.1-rtl, Copyright (c) 2010, Joshua Lackey
modified for use with rtl-sdr devices, Copyright (c) 2012, Steve Markgraf
Usage:
        GSM Base Station Scan:
                kal <-s band indicator> [options]

        Clock Offset Calculation:
                kal <-f frequency | -c channel> [options]

Where options are:
        -s      band to scan (GSM850, GSM-R, GSM900, EGSM, DCS, PCS)
        -f      frequency of nearby GSM base station
        -c      channel of nearby GSM base station
        -b      band indicator (GSM850, GSM-R, GSM900, EGSM, DCS, PCS)
        -g      gain in dB
        -d      rtl-sdr device index
        -e      initial frequency error in ppm
        -v      verbose
        -D      enable debug messages
        -h      help
$


$ date ; kal -s GSM850 ; date
Mon Mar  2 16:05:26 CET 2015
Found 1 device(s):
  0:  Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Exact sample rate is: 270833.002142 Hz
kal: Scanning for GSM-850 base stations.
GSM-850:
Mon Mar  2 16:08:44 CET 2015
$ date ; kal -s GSM-R ; date
Mon Mar  2 16:16:37 CET 2015
Found 1 device(s):
  0:  Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Exact sample rate is: 270833.002142 Hz
kal: Scanning for GSM-R-900 base stations.
GSM-R-900:
Mon Mar  2 16:17:09 CET 2015
$ date ; kal -s GSM900 ; date
Mon Mar  2 16:19:42 CET2015
Found 1 device(s):
  0:  Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Exact sample rate is: 270833.002142 Hz
kal: Scanning for GSM-900 base stations.
GSM-900:
        chan: 9 (936.8MHz + 22.294kHz)  power: 52744.70
        chan: 11 (937.2MHz + 22.198kHz) power: 148897.40
        chan: 48 (944.6MHz + 21.298kHz) power: 64839.80
        chan: 50 (945.0MHz + 21.360kHz) power: 76421.47
        chan: 66 (948.2MHz + 21.020kHz) power: 100342.53
        chan: 68 (948.6MHz + 21.109kHz) power: 148650.05
        chan: 74 (949.8MHz + 21.369kHz) power: 57399.97
Mon Mar  2 16:23:30 CET 2015
$ date ; kal -s EGSM ; date
Mon Mar  2 16:24:36 CET 2015
Found 1 device(s):
  0:  Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Exact sample rate is: 270833.002142 Hz
kal: Scanning for E-GSM-900 base stations.
E-GSM-900:
        chan: 9 (936.8MHz + 22.059kHz)  power: 55782.16
        chan: 11 (937.2MHz + 22.136kHz) power: 141612.90
        chan: 48 (944.6MHz + 21.194kHz) power: 60347.62
        chan: 49 (944.8MHz + 20.859kHz) power: 52131.68
        chan: 50 (945.0MHz + 21.268kHz) power: 79892.10
        chan: 66 (948.2MHz + 21.026kHz) power: 95478.05
        chan: 68 (948.6MHz + 21.074kHz) power: 142679.30
        chan: 74 (949.8MHz + 21.314kHz) power: 73531.29
        chan: 985 (927.2MHz + 23.002kHz)        power: 79791.55
        chan: 988 (927.8MHz + 22.555kHz)        power: 64283.53
        chan: 992 (928.6MHz + 21.866kHz)        power: 57287.97
        chan: 1000 (930.2MHz + 22.159kHz)       power: 192336.94
Mon Mar  2 16:29:38 CET 2015

$

Use the kal software to calculate the PPM clock offset of a RTL-SDR.

So  now that I have at least one channel number, with a high broadcast power in my region,  I can calculate the PPM offset with the kal software (best if the RTL-SDR has had a chance to warm up, the cheap 28.8MHz quartz crystal probably drifts most with temperature).


$ date ; kal -c 1000 ; date
Mon Mar  2 16:37:01 CET 2015
Found 1 device(s):
  0:  Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Exact sample rate is: 270833.002142 Hz
kal: Calculating clock frequency offset.
Using E-GSM-900 channel 1000 (930.2MHz)
average         [min, max]      (range, stddev)
+ 22.137kHz             [22112, 22160]  (49, 13.404841)
overruns: 0
not found: 0
average absolute error: -23.798 ppm
Mon Mar  2 16:37:23 CET 2015
$

Since there where no overruns and the signal was found every time I know that this is a good result, that I can confidently use this value with this particular RTL-SDR hardware in GRC or SDRSharp. I would round this number and use a PPM offset of -24 (0.0024%), since none of the software supports PPB corrections (yet). Even if there were 1 to 2 overruns or 1 to 5 not-found the PPM value would still probably be valid, it just meant that there was interference during the test or the signal strength of the channel used was not high enough, maybe try the test again using a different channel, that has more power (or less interference).


The Kalibrate software actually uses the GSM signals own inbuilt frequency correction bursts, that are used by mobile phone handsets (which also have cheap quartz crystals inside them) to calculate their ppm frequency correction. The original open source software was written for the Ettus Research USRP hardware and was ported work with the RTL-SDR.

Monday, 1 September 2014

Part Two: HackRF One - Howto use a Raspberry Pi to upgrade the Firmware on a HackRF One

Update: September 2014. There is now a temporary way to perform a HackRF One firmware upgrade in Windows: using a special modified firmware https://homes.cs.washington.edu/~supersat/hackrf-tools-cpld-update-hack.zip 1. Install ARM firmware, 2. power cycle hackrf, 3. flash CPLD firmware, 4. power cycle hackrf.


Since currently there is no way to upgrade the firmware on a HackRF One from Microsoft Windows, I though these commands may be useful for others, who have a Raspberry Pi and want to update their firmware. These instructions are generic enough that they should work with most other Debian based Linux distributions as well (you may need to type "sudo apt-get install pkg-config" in addition to the commands below).

The RPi is good enough to upgrade the firmware on the HackRF One with no issues, but it would not be easy to use the HackRF One for anything else. It does not have enough CPU power for DSP (no NEON instruction set), it does not have enough USB bandwidth for more than about 6MSPS, and writing IQ data to anywhere but a RAM disk will fail with USB timeouts. It is really not a great platform to use a H1 on. Although with some custom niche software that used the GPU for FFT's it may be possible to just about do something useful, but it would take a lot of work.

Below are the commands I used to upgrade the ARM firmware and CPLD firmware from version git-44df9d1 to 2014.08.1. The RELEASENOTES for this binary firmware, downloaded from sourceforge said that the latest hackrf-tools and libhackrf must be used to install, and that is what I did below:

As usual, I have censored any identifying information about my personal hardware.

pi@raspberrypi ~ $ lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 1d50:6089 OpenMoko, Inc.
pi@raspberrypi ~ $ mkdir src
pi@raspberrypi ~ $ cd src
pi@raspberrypi ~/src $ git clone https://github.com/mossmann/hackrf.git
Cloning into 'hackrf'...
remote: Counting objects: 9045, done.
remote: Total 9045 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (9045/9045), 24.04 MiB | 1.04 MiB/s, done.
Resolving deltas: 100% (6329/6329), done.
pi@raspberrypi ~/src $ cd hackrf/host
pi@raspberrypi ~/src/hackrf/host $ mkdir build
pi@raspberrypi ~/src/hackrf/host $ cd build/
pi@raspberrypi ~/src/hackrf/host/build $ sudo apt-get install cmake
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  cmake-data emacsen-common libxmlrpc-core-c3
The following NEW packages will be installed:
  cmake cmake-data emacsen-common libxmlrpc-core-c3
0 upgraded, 4 newly installed, 0 to remove and 85 not upgraded.
Need to get 5,766 kB of archives.
After this operation, 13.6 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libxmlrpc-core-c3 armhf 1.16.33-3.2 [146 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ wheezy/main emacsen-common all 2.0.5 [20.9 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ wheezy/main cmake-data all 2.8.9-1 [1,359 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ wheezy/main cmake armhf 2.8.9-1 [4,240 kB]
Fetched 5,766 kB in 4s (1,328 kB/s)
Selecting previously unselected package libxmlrpc-core-c3.
(Reading database ... 69052 files and directories currently installed.)
Unpacking libxmlrpc-core-c3 (from .../libxmlrpc-core-c3_1.16.33-3.2_armhf.deb) ...
Selecting previously unselected package emacsen-common.
Unpacking emacsen-common (from .../emacsen-common_2.0.5_all.deb) ...
Selecting previously unselected package cmake-data.
Unpacking cmake-data (from .../cmake-data_2.8.9-1_all.deb) ...
Selecting previously unselected package cmake.
Unpacking cmake (from .../cmake_2.8.9-1_armhf.deb) ...
Processing triggers for man-db ...
Setting up libxmlrpc-core-c3 (1.16.33-3.2) ...
Setting up emacsen-common (2.0.5) ...
Setting up cmake-data (2.8.9-1) ...
Install cmake-data for emacs
Setting up cmake (2.8.9-1) ...
pi@raspberrypi ~/src/hackrf/host/build $ sudo apt-get install libusb-1.0-0-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  libusb-1.0-0-dev
0 upgraded, 1 newly installed, 0 to remove and 85 not upgraded.
Need to get 184 kB of archives.
After this operation, 962 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libusb-1.0-0-dev armhf 2:1.0.11-1 [184 kB]
Fetched 184 kB in 5s (32.3 kB/s)
Selecting previously unselected package libusb-1.0-0-dev.
(Reading database ... 69752 files and directories currently installed.)
Unpacking libusb-1.0-0-dev (from .../libusb-1.0-0-dev_2%3a1.0.11-1_armhf.deb) ...
Setting up libusb-1.0-0-dev (2:1.0.11-1) ...
pi@raspberrypi ~/src/hackrf/host/build $ cmake .. -DINSTALL_UDEV_RULES=ON
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- checking for module 'libusb-1.0'
--   found libusb-1.0, version 1.0.11
-- Found LIBUSB: /usr/lib/arm-linux-gnueabihf/libusb-1.0.so
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/src/hackrf/host/build
pi@raspberrypi ~/src/hackrf/host/build $ make
Scanning dependencies of target hackrf
[ 11%] Building C object libhackrf/src/CMakeFiles/hackrf.dir/hackrf.c.o
/home/pi/src/hackrf/host/libhackrf/src/hackrf.c: In function ‘hackrf_set_freq_explicit’:
/home/pi/src/hackrf/host/libhackrf/src/hackrf.c:783:2: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
/home/pi/src/hackrf/host/libhackrf/src/hackrf.c:783:2: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Linking C shared library libhackrf.so
[ 11%] Built target hackrf
Scanning dependencies of target hackrf-static
[ 22%] Building C object libhackrf/src/CMakeFiles/hackrf-static.dir/hackrf.c.o
/home/pi/src/hackrf/host/libhackrf/src/hackrf.c: In function ‘hackrf_set_freq_explicit’:
/home/pi/src/hackrf/host/libhackrf/src/hackrf.c:783:2: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
/home/pi/src/hackrf/host/libhackrf/src/hackrf.c:783:2: warning: this decimal constant is unsigned only in ISO C90 [enabled by default]
Linking C static library libhackrf.a
[ 22%] Built target hackrf-static
Scanning dependencies of target hackrf_cpldjtag
[ 33%] Building C object hackrf-tools/src/CMakeFiles/hackrf_cpldjtag.dir/hackrf_cpldjtag.c.o
Linking C executable hackrf_cpldjtag
[ 33%] Built target hackrf_cpldjtag
Scanning dependencies of target hackrf_info
[ 44%] Building C object hackrf-tools/src/CMakeFiles/hackrf_info.dir/hackrf_info.c.o
Linking C executable hackrf_info
[ 44%] Built target hackrf_info
Scanning dependencies of target hackrf_max2837
[ 55%] Building C object hackrf-tools/src/CMakeFiles/hackrf_max2837.dir/hackrf_max2837.c.o
Linking C executable hackrf_max2837
[ 55%] Built target hackrf_max2837
Scanning dependencies of target hackrf_rffc5071
[ 66%] Building C object hackrf-tools/src/CMakeFiles/hackrf_rffc5071.dir/hackrf_rffc5071.c.o
Linking C executable hackrf_rffc5071
[ 66%] Built target hackrf_rffc5071
Scanning dependencies of target hackrf_si5351c
[ 77%] Building C object hackrf-tools/src/CMakeFiles/hackrf_si5351c.dir/hackrf_si5351c.c.o
Linking C executable hackrf_si5351c
[ 77%] Built target hackrf_si5351c
Scanning dependencies of target hackrf_spiflash
[ 88%] Building C object hackrf-tools/src/CMakeFiles/hackrf_spiflash.dir/hackrf_spiflash.c.o
Linking C executable hackrf_spiflash
[ 88%] Built target hackrf_spiflash
Scanning dependencies of target hackrf_transfer
[100%] Building C object hackrf-tools/src/CMakeFiles/hackrf_transfer.dir/hackrf_transfer.c.o
Linking C executable hackrf_transfer
[100%] Built target hackrf_transfer
pi@raspberrypi ~/src/hackrf/host/build $ sudo make install
[ 11%] Built target hackrf
[ 22%] Built target hackrf-static
[ 33%] Built target hackrf_cpldjtag
[ 44%] Built target hackrf_info
[ 55%] Built target hackrf_max2837
[ 66%] Built target hackrf_rffc5071
[ 77%] Built target hackrf_si5351c
[ 88%] Built target hackrf_spiflash
[100%] Built target hackrf_transfer
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/pkgconfig/libhackrf.pc
-- Installing: /etc/udev/rules.d/53-hackrf.rules
-- Installing: /usr/local/lib/libhackrf.so.0.3.0
-- Installing: /usr/local/lib/libhackrf.so.0
-- Installing: /usr/local/lib/libhackrf.so
-- Installing: /usr/local/lib/libhackrf.a
-- Installing: /usr/local/include/libhackrf/hackrf.h
-- Installing: /usr/local/bin/hackrf_max2837
-- Removed runtime path from "/usr/local/bin/hackrf_max2837"
-- Installing: /usr/local/bin/hackrf_si5351c
-- Removed runtime path from "/usr/local/bin/hackrf_si5351c"
-- Installing: /usr/local/bin/hackrf_transfer
-- Removed runtime path from "/usr/local/bin/hackrf_transfer"
-- Installing: /usr/local/bin/hackrf_rffc5071
-- Removed runtime path from "/usr/local/bin/hackrf_rffc5071"
-- Installing: /usr/local/bin/hackrf_spiflash
-- Removed runtime path from "/usr/local/bin/hackrf_spiflash"
-- Installing: /usr/local/bin/hackrf_cpldjtag
-- Removed runtime path from "/usr/local/bin/hackrf_cpldjtag"
-- Installing: /usr/local/bin/hackrf_info
-- Removed runtime path from "/usr/local/bin/hackrf_info"
pi@raspberrypi ~/src/hackrf/host/build $ sudo ldconfig
pi@raspberrypi ~/src/hackrf/host/build $ sudo udevadm control --reload-rules
pi@raspberrypi ~/src/hackrf/host/build $ hackrf_info
hackrf_open() failed: HACKRF_ERROR_NOT_FOUND (-5)
(I pressed the blue reset button on the hackrf)
pi@raspberrypi ~/src/hackrf/host/build $ hackrf_info
Found HackRF board.
Board ID Number: 2 (HackRF One)
Firmware Version: git-44df9d1
Part ID Number: 0xa000cb3c 0x00724f45
Serial Number: 0x00000000 0x00000000
0x         0x        

pi@raspberrypi ~/src/hackrf/host/build $ cd
pi@raspberrypi ~ $ mkdir firmware
pi@raspberrypi ~ $ cd firmware
pi@raspberrypi ~/firmware $ wget http://sourceforge.net/projects/hackrf/files/hackrf-2014.08.1.tar.xz/download
--2014-09-01 22:05:58--  http://sourceforge.net/projects/hackrf/files/hackrf-2014.08.1.tar.xz/download
Resolving sourceforge.net (sourceforge.net)... 216.34.181.60
Connecting to sourceforge.net (sourceforge.net)|216.34.181.60|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://downloads.sourceforge.net/project/hackrf/hackrf-2014.08.1.tar.xz?r=&ts=1409605559&use_mirror=cznic [following]
--2014-09-01 22:05:59--  http://downloads.sourceforge.net/project/hackrf/hackrf-2014.08.1.tar.xz?r=&ts=1409605559&use_mirror=cznic
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.34.181.59
Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://cznic.dl.sourceforge.net/project/hackrf/hackrf-2014.08.1.tar.xz [following]
--2014-09-01 22:05:59--  http://cznic.dl.sourceforge.net/project/hackrf/hackrf-2014.08.1.tar.xz
Resolving cznic.dl.sourceforge.net (cznic.dl.sourceforge.net)... 217.31.202.30, 2001:1488:ffff::30
Connecting to cznic.dl.sourceforge.net (cznic.dl.sourceforge.net)|217.31.202.30|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14376904 (14M) [application/octet-stream]
Saving to: `download'

100%[=====================================================================================================================================================================>] 14,376,904  2.64M/s   in 7.0s

2014-09-01 22:06:07 (1.96 MB/s) - `download' saved [14376904/14376904]

pi@raspberrypi ~/firmware $ mv download hackrf-2014.08.1.tar.xz
pi@raspberrypi ~/firmware $ unxz hackrf-2014.08.1.tar.xz
pi@raspberrypi ~/firmware $ tar xf hackrf-2014.08.1.tar
pi@raspberrypi ~/firmware $ cd hackrf-2014.08.1/firmware-bin

(The next command will flash the firmware on the HackRF One, it would be good idea to make sure that it does not loose power)
pi@raspberrypi ~/firmware/hackrf-2014.08.1/firmware-bin $ hackrf_spiflash -w hackrf_one_usb_rom_to_ram.bin
File size 20292 bytes.
Erasing SPI flash.
Writing 256 bytes at 0x000000.
Writing 256 bytes at 0x000100.
Writing 256 bytes at 0x000200.
Writing 256 bytes at 0x000300.
Writing 256 bytes at 0x000400.
Writing 256 bytes at 0x000500.
Writing 256 bytes at 0x000600.
Writing 256 bytes at 0x000700.
Writing 256 bytes at 0x000800.
Writing 256 bytes at 0x000900.
Writing 256 bytes at 0x000a00.
Writing 256 bytes at 0x000b00.
Writing 256 bytes at 0x000c00.
Writing 256 bytes at 0x000d00.
Writing 256 bytes at 0x000e00.
Writing 256 bytes at 0x000f00.
Writing 256 bytes at 0x001000.
Writing 256 bytes at 0x001100.
Writing 256 bytes at 0x001200.
Writing 256 bytes at 0x001300.
Writing 256 bytes at 0x001400.
Writing 256 bytes at 0x001500.
Writing 256 bytes at 0x001600.
Writing 256 bytes at 0x001700.
Writing 256 bytes at 0x001800.
Writing 256 bytes at 0x001900.
Writing 256 bytes at 0x001a00.
Writing 256 bytes at 0x001b00.
Writing 256 bytes at 0x001c00.
Writing 256 bytes at 0x001d00.
Writing 256 bytes at 0x001e00.
Writing 256 bytes at 0x001f00.
Writing 256 bytes at 0x002000.
Writing 256 bytes at 0x002100.
Writing 256 bytes at 0x002200.
Writing 256 bytes at 0x002300.
Writing 256 bytes at 0x002400.
Writing 256 bytes at 0x002500.
Writing 256 bytes at 0x002600.
Writing 256 bytes at 0x002700.
Writing 256 bytes at 0x002800.
Writing 256 bytes at 0x002900.
Writing 256 bytes at 0x002a00.
Writing 256 bytes at 0x002b00.
Writing 256 bytes at 0x002c00.
Writing 256 bytes at 0x002d00.
Writing 256 bytes at 0x002e00.
Writing 256 bytes at 0x002f00.
Writing 256 bytes at 0x003000.
Writing 256 bytes at 0x003100.
Writing 256 bytes at 0x003200.
Writing 256 bytes at 0x003300.
Writing 256 bytes at 0x003400.
Writing 256 bytes at 0x003500.
Writing 256 bytes at 0x003600.
Writing 256 bytes at 0x003700.
Writing 256 bytes at 0x003800.
Writing 256 bytes at 0x003900.
Writing 256 bytes at 0x003a00.
Writing 256 bytes at 0x003b00.
Writing 256 bytes at 0x003c00.
Writing 256 bytes at 0x003d00.
Writing 256 bytes at 0x003e00.
Writing 256 bytes at 0x003f00.
Writing 256 bytes at 0x004000.
Writing 256 bytes at 0x004100.
Writing 256 bytes at 0x004200.
Writing 256 bytes at 0x004300.
Writing 256 bytes at 0x004400.
Writing 256 bytes at 0x004500.
Writing 256 bytes at 0x004600.
Writing 256 bytes at 0x004700.
Writing 256 bytes at 0x004800.
Writing 256 bytes at 0x004900.
Writing 256 bytes at 0x004a00.
Writing 256 bytes at 0x004b00.
Writing 256 bytes at 0x004c00.
Writing 256 bytes at 0x004d00.
Writing 256 bytes at 0x004e00.
Writing 68 bytes at 0x004f00.

(The next command flashs the CPLD in the HackRF One, it would be a good idea to make sure that it does not loose power) 
pi@raspberrypi ~/firmware/hackrf-2014.08.1/firmware-bin $ hackrf_cpldjtag -x hackrf_cpld_default.xsvf
File size 37629 bytes.
LED1/2/3 blinking means CPLD program success.
LED3/RED steady means error.

Wait message 'Write finished' or in case of LED3/RED steady, Power OFF/Disconnect the HackRF.
Write finished.
Please Power OFF/Disconnect the HackRF.
pi@raspberrypi ~/firmware/hackrf-2014.08.1/firmware-bin $
(LED1/2/3 are the three LED's starting at the antenna)
pi@raspberrypi ~/firmware/hackrf-2014.08.1/firmware-bin $ hackrf_info
Found HackRF board.
Board ID Number: 2 (HackRF One)
Firmware Version: 2014.08.1
Part ID Number: 0xa000cb3c 0x00724f45
Serial Number: 0x00000000 0x00000000 0x         0x       
pi@raspberrypi ~/firmware/hackrf-2014.08.1/firmware-bin $