User Tools

Site Tools


wiki:sdk

This is an old revision of the document!


IMPORTANT Firmware UPGRADE!!
The new firmware wirmaV2_wirgrid_v2.x is mandatory with the “27dBm LoRa IoT Stations”
The Semtech LoRa HAL have to be rebuild in version v2.0.0 or upper, with the compilation flag CFG_BRD= kerlink_868_27dbm

Distribution

The distribution provided on the station is generated by Kerlink. Inside:

  • u-boot-2009.03, the bootloader ;
  • linux-3.10.x, the kernel ;
  • busybox-1.18.5, which provides basic tools ;
  • buildroot-2011.08, to generate the applications present in the filesystem ;
  • M2M daemon developed by Kerlink ;
  • tools developed by Kerlink, available in /usr/local/bin/ on the filesystem..

Below the file .config of Buildroot :

Below the file .config of Busybox :

SDK

The SDK provided by Kerlink is able to generate a part of the firmware for Long Range IoT Station :

  • kernel,
  • rootfs.
The new firmware wirmaV2_wirgrid_v2.x is mandatory with the “27dBm LoRa IoT Stations”
The Semtech LoRa HAL have to be rebuild in version v2.0.0 or upper, with the compilation flag CFG_BRD= kerlink_868_27dbm
Note: kerlink_868_27dbm = Kerlink LoRa 868MHz gateway with 27dBm capability

Installation: firmware v2.x

The SDK is provided as an archive : wirgrid_buildroot_v2.1.tar.gz. You can also download the kernel sources linux-4281f2b.tar.xz.

To install it :

 $ cd ~/workdir
 $ tar xzf ~/wirgrid_buildroot_v2.1.tar.gz
 $ cd buildroot/
 $ mkdir dl
 $ cp ~/linux-4281f2b.tar.xz ./dl/linux-4281f2b.tar.xz

Before being able to compile, several tools must be installed:

 $ sudo apt-get install u-boot-tools lzma zlib1g-dev bison flex yodl

A number of packages are installed also in mode “host” in the toolchain.
According to the distribution used, it is possible that compilation fail.
For instance, if you use Ubuntu, change default Shell to link on Bash:
 $ sudo rm -f /bin/sh
 $ sudo ln -s /bin/bash /bin/sh

Installation: firmware v1.x

The SDK is provided as an archive : wirgrid_buildroot_v1.0.tar.gz. You can also download the kernel sources linux-wirgrid-1.0.tar.gz .

To install it :

 $ cd ~/workdir
 $ tar xzf ~/wirgrid_buildroot_v1.0.tar.gz
 $ cd buildroot/
 $ mkdir dl
 $ cp ~/linux-wirgrid-1.0.tar.gz ./dl/linux-wirgrid-1.0.tar.gz

Before being able to compile, several tools must be installed:

 $ sudo apt-get install u-boot-tools lzma zlib1g-dev bison flex yodl

A number of packages are installed also in mode “host” in the toolchain.
According to the distribution used, it is possible that compilation fail.
For instance, if you use Ubuntu, change default Shell to link on Bash:
 $ sudo rm -f /bin/sh
 $ sudo ln -s /bin/bash /bin/sh

Basic use

Rootfs & Kernel generation

cd ~/workdir/buildroot
make clean
make wirgrid_defconfig
make

Images description

The generated firmware is in the directory output/images/ of the workdir. Inside :

psa@psa-Vostro-260 ~/workdir/buildroot $ ll output/images
total 26M
drwxr-xr-x 2 psa psa 4,0K févr. 24 12:14 .
drwxr-xr-x 8 psa psa 4,0K févr. 24 12:05 ..
-rw-r--r-- 1 psa psa  16M févr. 24 12:14 rootfs.tar
-rw-r--r-- 1 psa psa 7,1M févr. 24 12:14 rootfs.tar.gz
-rw-r--r-- 1 psa psa 2,4M févr. 24 12:14 uImage

  • rootfs.tar archive of the root filesystem ;
  • rootfs.tar.gz compressed archive of the root filesystem ;
  • uImage kernel binary ;

Modify Rootfs configuration

The default configuration used by Buildroot is wirgrid_defconfig. This file is saved in ~/workdir/buildroot/configs/. To modify it :

 $ cd ~/workdir/buildroot
 $ make menuconfig
The new configuration will be saved in ~/workdir/buildroot/.config.

Update default Rootfs configuration

In order to update the default configuration :

 $ cd ~/workdir/buildroot
 $ make savedefconfig
 $ cp defconfig configs/wirgrid_defconfig

Update kernel configuration

Configuration and compilation are managed by Buildroot.

 $ cd ~/workdir/buildroot
 $ make linux-menuconfig
The new configuration will be saved in ~/workdir/buildroot/output/build/linux-wirgrid-1.0/.config.

Update default kernel configuration

In order to use your own kernel configuration by default, you must update buildroot configuration. In kernel configuration you must change “using a defconfig” by “using a custom config file” and add you configuration file path.

Advanced use

The SDK is build around Buildroot. To obtain more help about Buildroot you can read its manual : http://buildroot.uclibc.org/downloads/manual/manual.html.

You can also open the Makefile in the root of the SDK in order to understand how are built and generated packages with Buildroot.

TFTP boot

It is possible to boot the LoRa station on a kernel image with a tftp server. Set up a tftp server with the kernel image you want to use and follow these steps:

  • Enter in the u-boot shell and press “k” keyboard key several time at early boot time
  • Type watchdog disable in the u-boot shell

  Product: WirmaV2 lora V
  WARNING: Machine type unknown, set default wirmaV2 Module
  Autoboot in 1 seconds, enter Password:
  KLK-Uboot> kkkkkkkkkkkkkkkkkkkkkkkk
  Unknown command 'kkkkkkkkkkkkkkkkkkkkkkkk' - try 'help'
  KLK-Uboot> watchdog disable
  Watchdog disabled

  • Type printenv and check the field ipaddr and serverip. Your ip address is in the field ipaddr and the tftp server ip in the field serverip.

KLK-Uboot> printenv
ipaddr=192.168.4.232
serverip=192.168.4.104

  • Download the kernel image with tftp command : tftp 0x80010000 path_to_your_image

KLK-Uboot> tftp 0x80010000 path_to_your_image/uImage
        HW MAC address:  02:4B:08:05:03:A4
ENET:auto-negotiation complete
ENET:Link status up
ENET:FULL DUPLEX
ENET:100MBase
TFTP from server 192.168.4.104; our IP address is 192.168.4.232
Filename 'path_to_your_image/uImage'.
Load address: 0x80010000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##################################
done
Bytes transferred = 2166984 (2110c8 hex)

  • Change bootargs value and save

KLK-Uboot> setenv bootargs ${bootargs} root=/dev/mtdblock5 rootfstype=yaffs2 rw init=/sbin/init panic=1
KLK-Uboot> saveenv

  • Boot image from memory

KLK-Uboot> bootm 0x80010000

Toolchain

Kerlink provides the arm-2011.03-wirma2-r59.tar.xz package which contains the cross-toolchain, libraries and headers necessary to the compilation of an application. This toolchain is extracted from Buildroot.

Install

mkdir /opt/toolchains
cd /opt/toolchains
tar xJf arm-2011.03-wirma2-r59.tar.xz

You must add the toolchain to your environnement PATH:

PATH=$PATH:/opt/toolchains/arm-2011.03-wirma2/bin

In order to run in 64bits hardware, you must install ia32-libs :

sudo apt-get install ia32-libs

wiki/sdk.1435045245.txt.gz · Last modified: 2017/07/21 13:53 (external edit)