Overview | Release Notes | Support | Documents | References | Porting to BB | To Do | Statistics
RTKLIB: BeagleBoard-based RTK-GPS reciver

Reference 10/3

T.Takasu and A.Yasuda, Development of the low-cost RTK-GPS receiver with an open source program package RTKLIB, International Symposium on GPS/GNSS, International Convention Center Jeju, Korea, November 4-6, 2009 (rev.A submitted)


Tuning of Positioning Options update 10/8

2009/10/06 15:00-10/07 15:00 (24H), Rover: NovAtel GPS-702-GG+u-blox LEA-4T, Base Station: GSI 0979 Yamanashi-Takane, Baseline Length=6.1km, Positioning Mode=Kinematic, Frequencies=L1, Solution Type=Forward, Iono/Tropos Est=OFF, Integer Ambiguity Resolution=Continuous, Validation Threshold to Fix Ambiguity=3.0, Rover Antenna Type=None, Base Antenna Type=TRM29659.00, RTKPOST ver.2.3.0b-20091008

No Interval Elev
Mask
(deg)
SNR
Mask
(dBHz)
Min
Elev to
Fix(deg)
Code/
Phase
ErrRatio
Phase
Error(m)
Phase Error/
sinEl(m)
Fixing Rate RMS Error *
EW
(cm)
NS
(cm)
UD
(cm)
1 1s 15 0 0 100 0.003 0.003 69.8% 4.6 3.5 9.9
2 5s 15 0 0 100 0.003 0.003 72.9% 2.8 3.4 3.0
3 10s 15 0 0 100 0.003 0.003 76.5% 1.4 0.9 3.5
4 30s 15 0 0 100 0.003 0.003 79.7% 2.8 2.9 6.4
5 60s 15 0 0 100 0.003 0.003 85.0% 1.2 0.9 2.3
6 30s 20 0 0 100 0.003 0.003 87.9% 4.6 1.4 4.1
7 30s 15 30 0 100 0.003 0.003 82.6% 1.8 2.2 2.2
8 30s 15 35 0 100 0.003 0.003 93.7% 1.2 0.8 2.0
9 30s 15 40 0 100 0.003 0.003 96.2% 1.1 0.8 2.0
10 30s 15 45 0 100 0.003 0.003 88.8% 3.8 5.9 17.6
11 30s 15 40 20 100 0.003 0.003 97.2% 1.1 0.8 2.0
12 30s 15 40 25 100 0.003 0.003 97.8% 1.1 0.8 2.0
13 30s 15 40 30 100 0.003 0.003 98.3% 1.1 0.9 2.2
14 30s 15 40 35 100 0.003 0.003 98.2% 1.1 0.9 2.4
15 30s 15 40 30 70 0.003 0.003 98.0% 1.1 0.9 2.2
16 30s 15 40 30 150 0.003 0.003 98.4% 1.1 0.9 2.2
17 30s 15 40 30 200 0.003 0.003 98.4% 1.1 1.0 2.9
18 30s 15 40 30 300 0.003 0.003 98.5% 1.1 1.1 3.8
19 30s 15 40 30 150 0.000 0.006 98.3% 1.1 0.9 2.2
20 30s 15 40 30 150 0.000 0.009 98.3% 1.1 0.9 2.2
21 30s 15 40 30 150 0.006 0.000 98.4% 1.1 0.9 2.3
22 1s 15 40 30 150 0.003 0.003 98.0% 1.1 1.0 2.4
Blue: Changed from Default, Red: Best Value, * Fixed Solutions Only

Solutions of Case No.22 1Hz 24H (FIX, FLOAT)


Receiver Hardware (3-receiver-module version) 7/17


Receiver Extension Card (3-receiver-module version) 6/27

(1) Schematic (PDF)

(2) Board Layout (PDF/PDF)


Breadboard Model

(1) Host: VMWare Workstation 6.5.2 on Windows Vista 64bit+Ubuntu 9.04 Desktop Edition
(2) Target: BB-RTK-receiver BBM
- Beagle Board Rev.B7 + SD card 2GB
- USB Hub 4P
- USB GPS receiver: u-blox AEK-4T
- USB HSPA Card: emobile D21HW (Huawei E220 HSDPA Modem/E270 HSDPA Modem)
- USB LAN Adapter: Corega CG-FEUSBTXCG (FEther USB-TXC)

(3) Connection: Host - USB-Serial Converter - Serial Cross Cable - Target (Beagle Board Reference Manual)


Install and Run Linux for Beagle Board from SD Card

($: Host Inputs, BB$: Target Inputs, Target Outputs, Setting/Edit, Comment)

(1) Format SD card at Host
Insert SD card to SD slot of the host
$ sudo apt-get install gparted
$ sudo gparted
device /dev/sdc
Partition
/dev/sdc1 : fat32 : /media/disk-1 : 62.72 MB
/dev/sdc2 : ext3 : /media/disk-2 : 1.80 GB

(2) Download prebuilt Linux kernel and install it to the fat32 partition of SD card
Get stable version: 2.6.29-oer34
$ wget http://www.rcn-ee.com/deb/kernel/beagle/lenny/v2.6.29-58cf2f1-oer34/uImage
$ copy uImage /media/disk-1
$ sudo umount /media/disk-1

(3) Make Ubuntu Root File System on the ext3 partition of SD card
$ cd <rootfs>
$ sudo apt-get install qemu
$ wget http://ports.ubuntu.com/pool/main/d/debootstap/debootstrap_1.0.13~jaunty1_all.deb
$ sudo dpkg -i debootstrap_1.0.13~jaunty1_all.deb
$ wget http://people.ubuntu.com/~ogra/arm/build-arm-rootfs
$ sudo chmod +x build-arm-rootfs
$ sudo ./build-arm-rootfs --fqdn beagleboard --login ubuntu --password passwd --imagesize 2G --seed gcc,make,usbutils
...
$ ls
armel-rootfs-<date>.tgz build-arm-rootfs build-aarm-rootfs-<date>.log
$ sudo tar xfp armel-rootfs-<date>.tgz -C /media/disk-2
$ cd /media/disk-2
$ sudo vi etc/event.d/ttyS2
# ttyS2 - getty
start on runlevel 2
start on runlevel 3

stop on runlevel 0
stop on runlevel 1
stop on runlevel 4
stop on runlevel 5
stop on runlevel 6

respawn
exec /sbin/getty -L 115200 ttyS2

$ cd ..
$ sudo umount /media/disk-2

(4) U-Boot setting and boot Linux at Beagle Board console (U-Boot Reference)
Insert SD card to SD slot of Beagle Board
U-Boot 1.3.3 (Jul 10 2008 - 16:33:09)
OMAP3530-GP rev 2, CPU-OPP2 L3-165MHz
DRAM: 128 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Audio Tone on Speakers ... complete
Hit any key to stop autoboot:
OMAP3 beagleboard.org #
setenv bootcmd 'mmcinit; fatload mmc 0:1 0x80300000 uImage; bootm 0x80300000'
OMAP3 beagleboard.org # setenv bootargs 'console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootwait rootfstype=ext3 rw'

OMAP3 beagleboard.org # saveenv
OMAP3 beagleboard.org # boot
reading uImage ...
...
beagleboard login:


Toolchain

(1) Get toolchain (ARM-GCC 4.2.1)
Download CodeSourcery G++ Lite 2007q3-51 for ARM GNU/Linux (IA GNU/Linux TAR) at
http://www.codesourcery.com/sgpp/lite/arm/portal/release313
$ ls
arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
$ cd /user/local
$ sudo tar jvxf <dir>/arm-2007q3-51-arm-none-gnueabi-i686-pc-linux-gnu.tar.bz2
$ ls
arm-2007q3
$ PATH=/usr/local/arm-2007q3/bin:$PATH


Rebuild u-boot for Beagleboard 7/20

(1) Build u-boot.bin

Insert SD card to SD slot of the host

$ git clone git://gitorious.org/u-boot-omap3/mainline u-boot-omap3
$ cd u-boot-omap3
$ git checkout --track -b omap3-dev origin/omap3-dev
$ make CROSS_COMPILE=arm-none-linux-gnueabi- mrproper
$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap3_beagle_config
$ make CROSS_COMPILE=arm-none-linux-gnueabi-

$ cp u-boot.bin /media/disk-1

(2) Write u-boot.bin to NAND Flash ([]: u-boot version>2009.06)

Insert SD card to SD slot of Beagle Board and reset
U-Boot 1.3.3 (Jul 10 2008 - 16:33:09)
OMAP3530-GP rev 2, CPU-OPP2 L3-165MHz
DRAM: 128 MB
NAND: 256 MiB
In: serial
Out: serial
Err: serial
Audio Tone on Speakers ... complete
Hit any key to stop autoboot:

Hit any key to enter uboot prompt
OMAP3 beagleboard.org # mmcinit [mmc init]
OMAP3 beagleboard.org # fatload mmc 0 0x80200000 u-boot.bin
reading u-boot.bin

176844 bytes read
OMAP3 beagleboard.org # nand unlock []
device 0 whole chip
nand_unlock: start: 00000000, length: 268435456!
NAND flash successfully unlocked
OMAP3 beagleboard.org # nand ecc sw [nandecc sw
OMAP3 beagleboard.org # nand erase 80000 160000
NAND erase: device 0 offset 0x80000, size 0x160000
Erasing at 0x1c0000 -- 100% complete.
OK
OMAP3 beagleboard.org # nand write.i 0x80200000 80000 160000
NAND write: device 0 offset 0x80000, size 0x160000

Writing data at 0x1df800 -- 100% complete.
1441792 bytes written: OK

OMAP3 beagleboard.org # nand lock []
NAND flash successfully locked
OMAP3 beagleboard.org # setenv bootcmd 'mmc init; fatload mmc 0:1 0x80300000 uImage; bootm 0x80300000'
OMAP3 beagleboard.org # setenv bootargs 'console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootwait rootfstype=ext3 rw'

OMAP3 beagleboard.org # saveenv
OMAP3 beagleboard.org # boot


Build and Configure Linux Kernel for Beagle Board

(1) Build Standard Kernel for BB (2.6.29-omap1+patchs)
Insert SD card to SD slot of the host
Reference: http://elinux.org/BeagleBoardDebian
$ sudo apt-get install git-core kernel-package fakeroot build-essential libncurses-dev uboot-mkimage
$ cd <kernel>
$ git-clone git://git2.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
$ cd linux-omap-2.6
$ git pull
$ git checkout 58cf2f1 -b v2.6.29-58cff1
$ git archive --format=tar --prefix=v2.6.29-58cf2f1/ v2.6.29-58cf2f1 | gzip > ../v2.6.29-58cf2f1.tar.gz
$ git checkout master
$ git branch v2.6.29-58cf2f1 -D
$ cd ..
$ wget http://rcn-ee.homeip.net:81/dl/omap/beagle/v2.6.29-58cf2f1-oer34/v2.6.29-58cf2f1-oer34.diff
$ wget http://rcn-ee.homeip.net:81/dl/omap/beagle/v2.6.29-58cf2f1-oer34/defconfig
$ tar -xf v2.6.29-58cf2f1.tar.gz
$ cd v2.6.29-58cf2f1
$ patch -p1 <../v2.6.29-58cf2f1-oer34.diff
$ cp ../defconfig .config
$ make CROSS_COMPILE=arm-none-linux-gnueabi- distclean
$ make menuconfig
$ make CROSS_COMPILE=arm-none-linux-gnueabi- uImage
...
$ cd arch/arm/boot
$ ls
Image Makefile bootp compressed install.sh uImage zImage
$ cp uImage /media/disk-1

(2) Configure and rebuild Kernel
(a) configure drivers for u-blox, emobile card (USB CDC ACM, USB GSM Modem) and PPP
Insert SD card to SD slot of the host
$ cd <kernel>/v2.6.29-58cf2f1
$ make menuconfig
Device Drivers ---->
- USB Support -
<*> USB Modem (CDC ACM) Support
<*> USB Serial Converter Support ---->
<*> USB driver for GSM and CDMA modems
- Network device support -
<*> PPP (Point-to-point protocol) support
<*> PPP support for async serial port
<*> ppp support for sync tty port

$ make CROSS_COMPILE=arm-none-linux-gnueabi- uImage

$ cp arch/arm/boot/uImage /media/disk-1
...
Insert SD card to SD slot of Beagle Board and boot Linux
BB$ ls /dev
... ttyACM0 ttyUSB0 ttyUSB1 ...
Serial devices can be accessed as:
/dev/ttyACM0: u-blox AEK-4T
/dev/ttyUSB0: emobile modem


Build and Configure WiFi network adaptor driver (Melco WLI-UC-GN) 2009/9/22

(1) Build driver on Host
(a) Get driver source package
http://www.ralinktech.com/support.php?s=2
download: RT3070USB(RT307X)

(b) Extract package
$ mkdir driver
$ tar xjvf 2009_0525_RT3070_Linux_STA_v2.1.1.0.bz2
$ cd 2009_0525_RT3070_Linux_STA_v2.1.1.0
(c) Configure makefile and source programs
$ cd os/linux
$ vi config.mk
...
HAS_WPA_SUPPLICANT=y
...
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
...
ifeq ($(PLATFORM),UBUNTU_ARM)
EXTRA_CFLAG:=-v $(WFLAGS) -I$(RT28xx_DIR)/include
endif

$ vi usb_main_dev.c
#ifdef RT3070
...
{USB_DEVICE(0x0411,0x015d)}, /* Melco., WLI-UC-GN */
#endif // RT3070

$ cd ../..
$ vi Makefile
PLATFORM = UBUNTU_ARM
...
ifdef ($(PLATFORM),UBUNTU_ARM)
LINUX_SRC = <kernel>/v2.6.29-58cf2f1
CROSS_COMPILE = /usr/local/arm-2007q3/bin/arm-none-linux-gnueabi-
endif

(d) Make driver module
$ sudo make
(e) Copy module and configration file to Root FS on SD card
$ mkdir /mnt/media/disk-2/etc/Wireless
$ mkdir /mnt/media/disk-2/etc/Wireless/RT2870STA
$ cp RT2870STA.dat /mnt/media/disk-2/etc/Wireless/RT2879STA
$ cp os/linux/rt3070sta.ko /mnt/media/disk-2/etc/Wireless/RT2870STA

(2) Install driver on target
(a) Boot with Root FS on SD card
(b) Install module
$ cd /etc/Wireless/RT2870STA
$ ls
RT2870STA.dat rt3070sta.ko
$ sudo insmod rt070sta.ko
$ sudo ifconfig ra0 up
$ ifconfig
ra0 Link encap:Ethernet HWaddr 00:1d:73:dd:d9:e6
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10 errors:0 dropped:0 overruns:0 frame:0
TX packets:77 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:750 (750.0 B) TX bytes:6240 (6.2 KB)
(c) Configure installation on startup
$ sudo vi /etc/rc.local
...
# install wifi card driver
insmod /etc/Wireless/RT2870STA/rt3070sta.ko
...

(3) Install wireless network tools and configure wireless network
(a) Install wireless-tools
$ sudo apt-get install wireless-tools
$ iwconfig
ra0 RT2870 Wireless ESSID:"11n-AP" Nickname:"RT2870STA"
Mode:Auto Frequency=2.412 GHz Access Point: Not-Associated
Bit Rate:1 Mb/s
RTS thr:off Fragment thr:off
Link Quality=10/100 Signal level:0 dBm Noise level:-115 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0


Configure Target Environment

(1) Ethernet setting
BB$ sudo vi /etc/network/interfaces
auto eth0
iface eth0 inet dhcp

(2) PPP setting
BB$ sudo apt-get install ppp pppconfig
BB$ pppconfig
Create a connection
Provider Name: emobile
Configure Nameservers (DNS): Dynamic
Authentication Method for emobile: PAP
User Name: em
Password: em
Speed: 460800
Pulse or Tone: Tone
Phone Number: *99***1#
Choose Modem Config Method: Yes
Manually Select Modem Port: /dev/ttyUSB0

Connect/disconnect to emobile by:
BB$ pon emobile
BB$ poff emobile


Performance Evaluation of RTKLIB

(1) Environment
- gcc 4.3.3 (Ubuntu 4.3.3-5ubuntu4), glibc 2.9
- rtklib_2.2.1 + patch rtklib_2.2.1_p3p
- libc6-vfp
- liblapack, libblas

(2) Execution Time

RTKLIB
Version
Compiler
Options
Libraries rnx2rtkp (a) convbin (b) Target
real user sys real user sys
2.2.1+
2.2.1_p3
-O2 -lm 2m40.333s 2m37.844s 0m1.664s 0m6.485s 0m3.242s 0m0.586s Beagle Board
Rev.B7
+ Ubuntu 9.04
-O3 -lm 2m39.795s 2m37.664s 0m1.750s 0m5.407s 0m3.188s 0m0.539s
-O4 -lm 2m39.866s 2m37.617s 0m1.805s 0m5.469s 0m3.180s 0m0.555s
-O3 -mfpu=vfp -lm 2m39.793s 2m37.805s 0m1.719s 0m5.501s 0m3.188s 0m0.578s
-O3 -mfpu=vfp
-mfloat-abi=softfp
-lm 1m9.021s 1m7.320s 0m1.547s 0m5.322s 0m3.172s 0m0.461s
-O3 -mfpu=neon
-mfloat-abi=softfp
-lm 1m8.669s 1m6.594s 0m1.703s 0m5.343s 0m3.094s 0m0.547s
-O3 -mfpu=neon
-mfloat-abi=softfp
-ffast-math
-lm 1m9.393s 1m5.914s 0m1.680s 0m5.317s 0m3.117s 0m0.500s
-O3 -mfpu=neon
-mfloat-abi=softfp
-DLAPACK
-lm
-llapack
-lblas
2m29.920s 2m27.734s 0m1.750s 0m5.367s 0m3.195s 0m0.437s
2.3.0b
(6/15)
O3 -mfpu=neon
-mfloat-abi=softfp
-ffast-math
-lm 1m4.291s 1m2.711s 0m1.352s
2.2.1+
2.2.1_p3
-O3 -lm 0m3.912s 0m2.508s 0m0.924s 0m0.728s 0m0.224s 0m0.312s C2Q 2.4GHz
+VMWare 6.5.2
+Ubuntu 9.04
-O3 -DLAPACK -lm
-llapack
-lblas
0m4.292s 0m2.572s 0m0.952s 0m0.743s 0m0.176s 0m0.332s
(a) rnx2rtkp: 2880 epochs, post mission baseline analysis, kinematic mode, dual-frequency, continous AR
(b) convbin: 3645 epochs, RINEX conversion of u-blox raw binary log, single-frequency

(3) Profile of rnx2rtkp

Options: CFLAGS = -O3 -mfpu=neon -mfloat-abi=softfp -ffast-math -pg, LDLIBS = -lm_p -pg

real: 1m36.455s user: 1m34.336s sys 0m1.852s

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls   s/call   s/call  name
 46.57     24.36    24.36   296465     0.00     0.00  matmul
 14.76     32.08     7.72                             __adddf3
  8.35     36.45     4.37                             __muldf3
  6.90     40.06     3.61    26003     0.00     0.00  matinv
  2.25     41.24     1.18  2229046     0.00     0.00  sinl
  1.84     42.20     0.97  1338312     0.00     0.00  cosl
  1.49     42.98     0.78                             __floatdidf
  1.36     43.69     0.71   126327     0.00     0.00  satpos_
  1.24     44.34     0.65                             __subdf3
  1.03     44.88     0.54   364258     0.00     0.00  __ieee754_atan2
  1.03     45.42     0.54     2880     0.00     0.00  lambda
  0.96     45.92     0.50                             __aeabi_drsub
  0.76     46.32     0.40     5760     0.00     0.00  ddres
  0.76     46.72     0.40                             __divdf3
  0.71     47.09     0.37                             __cmpdf2
  0.65     47.43     0.34   126327     0.00     0.00  eph2pos
  0.60     47.75     0.32     2880     0.00     0.00  filter
  0.57     48.05     0.30   253947     0.00     0.00  __ieee754_pow
  0.49     48.30     0.26   125829     0.00     0.00  ionmodel
  0.48     48.55     0.25     2880     0.00     0.01  pntpos
  0.47     48.80     0.25    14404     0.00     0.00  zeros
  0.46     49.04     0.24   122634     0.00     0.00  tan
  0.44     49.27     0.23     2880     0.00     0.01  rtkpos
  0.33     49.44     0.18    40414     0.00     0.00  ecef2pos
  0.31     49.60     0.16   251056     0.00     0.00  __exp1
  0.31     49.76     0.16                             __aeabi_cdrcmple
  0.29     49.91     0.15   201187     0.00     0.00  __ieee754_asin
  0.29     50.06     0.15  1011113     0.00     0.00  sincos
  0.29     50.21     0.15   186806     0.00     0.00  tropmodel
  0.27     50.35     0.14        3     0.05     0.09  readrnxfp
  0.25     50.48     0.13                             __aeabi_cdcmple
  0.23     50.60     0.12                             cmpobs
  0.22     50.72     0.12   423492     0.00     0.00  str2num
  0.21     50.83     0.11                             __ltdf2
  0.19     50.93     0.10   253947     0.00     0.00  powl
...

Useful Links

beagleboard.org
elinux.org - Embedded Linux Wiki - BeagleBoard
elinux.org - Embedded Linux Wiki - BeagleBoardDebian
elinux.org - Embedded Linux Wiki - BeagleBoardUbuntu
elinux.org - Embedded Linux Wiki - BeagleBoardLinuxKernel


Copyright (C) 2007-2010 by T.TAKASU, All rights reserved.