-
Notifications
You must be signed in to change notification settings - Fork 0
How to install 6LoWPAN Linux Kernel on Raspberry Pi
Install a fairly new (next) Linux kernel on a raspberry pi, which is able to run IEEE802.15.4 devices (i.e. the Atmel AT86RF233) and 6LoWPAN.
NOTE There is much room for improvement here, so follow the steps with caution :-)
http://elinux.org/RPi_Low-level_peripherals
git clone git@github.com:raspberrypi/linux.git linux-rpi
cd linux rpi
git checkout rpi-4.0.y
git clone git@github.com:raspberrypi/firmware.git firmware
cd firmware
git checkout next
http://openlabs.co/blog/archives/1-6LoWPAN-kernel-on-a-Raspberry-Pi Don't forget the lib dir
Follow these sections:
- cross-compiling
- building the Linux kernel
- patching the device tree
Boot options -> Use appended device tree blob to zImage
-- is this needed? --
http://elinux.org/Raspberry_Pi_Kernel_Compilation
http://elinux.org/Raspberry_Pi_Kernel_Compilation
http://elinux.org/Raspberry_Pi_Kernel_Compilation
https://github.com/raspberrypi/linux/wiki/How-to-boot-using-device-tree
(but remove the option init_emmc_clock
)
sudo apt-get install libnl-3-dev libnl-genl-3-dev
####get them from here:
https://github.com/linux-wpan/wpan-tools
The current master seems to fail while configuring...
cd wpan-tools
./autogen.sh
./configure
http://wpan.cakelab.org/releases/wpan-tools-0.4.tar.gz
tar xfvz wpan-tools-0.4.tar.gz
cd wpan-tools-0.4.tar.gz
./configure
make
sudo make install
For testing, follow some of the instructions at http://wpan.cakelab.org/#_how_to_8217_s
This how-to will guide you to:
- configure the Raspberry Pi Kernel for 802.15.4 and 6LoWPAN
- show you how to patch support for the openlabs Raspberry-Pi-802.15.4-radio
- compile a recent Linux kernel (rpi-4.0.y) for the Raspberry Pi
- and use the new built Kernel on your RasPi
To start off, we obtain the official and latest Raspbian image and flash it on our SDCard.
- We download the official latest Raspbian image (scroll down a bit),
- and follow the guides to flash it on our SDCard.
- Then we Plug the SDCard and fire our RasPi.
- Note if you login the first time, the username is
pi
and the password israspberry
- Second note watch out if you have a german keyboard layout, the keys
y
andz
are switched. - In the first run we set the filesystem to be expanded and if desired set additional options for the system using the
raspi-config
tool and let the RasPi reboot when we finished. - After the reboot we login and first update the system entering
sudo apt-get update
andsudo apt-get upgrade
.
We focus on cross compilation here, since we don't want to spend a night watching the build process ;).
First we obtain an appropriate and recent Cross GCC to build the Kernel.
The RasPi rquires an arm-gnueabihf
GCC for cortex a7
processors.
So, the Linaro GCC 4.9 is our candidate here.
We download the appropriate tar.xz
file and decompress it.
Now we open a terminal and export the path to the newly decompressed GCC bin directory.
We type export PATH=$PATH:/home/<myusername>/Downloads/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin
.
To test if the export succeeded we type arm-linux-gnueabihf-gcc --version
and should be provided with the version information of our cross compiler.
If not, the path export seems to be failed, you can check it by type in $PATH
in the terminal.
Note, if you use a 64 bit Linux you may also need multilib support.
Now we get the RasPi latest Kernel sources from their Git repository
git clone https://github.com/raspberrypi/linux.git linux-rpi
cd linux rpi
git checkout rpi-4.0.y
cd ..
and the latest firmware
git clone https://github.com/raspberrypi/firmware.git firmware
cd firmware
git checkout next
cd ..
First we configure the sources with an appropriate configuration for the RasPi.
We switch in the kernel source folder, typing cd linux-rpi
followed by
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcmrpi_defconfig
This setups the kernel with an initial configuration.
Now we need to enable 802.15.4 and 6LoWPAN plus the supported devices.
We basically follow the Openlabs guide to provide an appropriate configuration for 802.15.4 and 6LoWPAN.
Contrary to the guide we first patch the device tree, adding the SPI
part to arch/arm/boot/dts/bcm2835-rpi-b.dts
.
Then we type
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
and start to configure/enable the desired features.
TODO: add the steps here
After the configuration process we type
CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm make zImage modules dtbs -j8
and have break.
When finished we collect all built modules together in a .mods
folder.
CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm INSTALL_MOD_PATH=.mods make modules_install
Now that we built a recent kernel we copy it, the modules and the firmware to our SDCard. First the kernel:
$ sudo cp arch/arm/boot/dts/*.dtb /media/<myusername>/boot/
$ sudo cp arch/arm/boot/dts/overlays/*.dtb* /media/<myusername>/boot/overlays
$ sudo scripts/mkknlimg arch/arm/boot/zImage /media/<myusername>/boot/kernel.img
After this is finished we copy the modules and the built firmware
$ sudo cp -r .mods/lib/* /media/<myusername>/<SDCardpatitionname>/lib
and the prebuilt firmware
$ cd ..
$ cd firmware
$ sudo rm -rf /media/<myusername>/<SDCardpatitionname>/opt/vc
$ sudo cp -r hardfp/opt/* /media/<myusername>/<SDCardpatitionname>/opt
Now we unmount the SDCard, plug it in the RasPi and let it boot.
After logging in, we need the WPAN tools to setup and use one of our 802.15.14 devices.
First we need to install the dh-autoreconf
package to be able to build the recent WPAN tools.
We type
sudo apt-get install dh-autoreconf
Then we clone the latest wpan-tools sources
git clone https://github.com/linux-wpan/wpan-tools
cd wpan-tools
build them
./autogen.sh
./configure CFLAGS='-g -O0' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
make
and finally install them
sudo make install
RIOT - The friendly Operating System for the Internet of Things
Homepage | [GitHub] (https://github.com/RIOT-OS/) | Developers Mailing List | Users Mailing List | Twitter @RIOT_OS
- Family: ARM
- Board: Airfy Beacon
- Board: Arduino Due
- Board: CC2538DK
- Board: HikoB Fox
- Board: IoT LAB M3
- Board: LimiFrog-v1
- Board: mbed_lpc1768
- Board: MSB-IoT
- Board: MSBA2
- Board: Nucleo-L1
- Board: Nucleo-F334
- Board: Nucleo-F303
- Board: Nucleo-F091
- Board: Mulle
- Board: OpenMote
- Board: PCA1000x (nRF51822 Development Kit)
- Board: Phytec phyWAVE-KW22
- Board: RFduino
- Board: Samr21 xpro
- Board: Spark Core
- Board: STM32F0discovery
- Board: STM32F3discovery
- Board: STM32F4discovery
- Board: UDOO
- Board: yunjia-nrf51822
- Family: ATmega
- Board: Arduino Mega2560
- Family: MSP430
- Board: MSB-430H
- Board: TelosB
- Board: WSN430
- Board: Zolertia Z1
- Board: eZ430-Chronos
- Family: native
- Board: native
- Family: x86
- Board: Intel Galileo