Giter Club home page Giter Club logo

linux-rt-rpi's Introduction

Real-time kernel for Raspberry Pi

This repository holds a fork of Raspberry Pi Linux kernel patched with rt-patch and configured as a fully preemtible kernel. Instructions on compiling, setting up and testing the kernel are provided below.

Cross-compiling the rt kernel on Linux

Download Raspberry Pi tools:

git clone https://github.com/raspberrypi/tools.git

Download kernel sources and switch to rt branch:

git clone -b rpi-3.18.9-rt5 https://github.com/emlid/linux-rt-rpi.git
cd linux-rt-rpi

Export the following variables to specify cross-compilation options:

export ARCH=arm 
export CROSS_COMPILE=~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-

If you compile on a x64-machine you need to change the last export to

export CROSS_COMPILE=~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-

For Raspberry Pi:

make bcmrpi_rt_defconfig

For Raspberry Pi 2:

make bcm2709_rt_defconfig

Optional: make changes to the config

make menuconfig

Compile the kernel:

make -j5

Install modules, will result in "lib" folder with modules and firmware:

mkdir kernel-rt
INSTALL_MOD_PATH=kernel-rt make modules_install

Setting up an SD card with the compiled rt kernel

Copy kernel:

For Raspberry Pi:

Copy arch/arm/boot/Image to /boot/kernel.img on SD card.
Copy arch/arm/boot/dts/bcm2708-rpi-b.dtb to /boot/bcm2708-rpi-b.dtb on SD card
Copy arch/arm/boot/dts/bcm2708-rpi-b-plus.dtb to /boot/bcm2708-rpi-b-plus.dtb on SD card
Copy (merge if necessary) kernel-rt/lib to / on SD card.

For Raspberry Pi 2:

Copy arch/arm/boot/Image to /boot/kernel7.img on SD card.
Copy arch/arm/boot/dts/bcm2709-rpi-2-b.dtb to /boot/bcm2709-rpi-2-b.dtb on SD card
Copy (merge if necessary) kernel-rt/lib to / on SD card.

Now you can insert an SD card into your Raspberry Pi and check if it boots. If something is wrong it is recommended to observe serial console.

Testing real-time capabilites using cyclictest utility

Installing cyclictest utility on Raspberry Pi:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git 
cd rt-tests
make all
cp ./cyclictest /usr/bin/
cd ~

Testing real-time:

sudo cyclictest -l1000000 -m -n -a0 -t1 -p99 -i400 -h400 -q

linux-rt-rpi's People

Contributors

torvalds avatar broonie avatar davem330 avatar tiwai avatar gregkh avatar htejun avatar kaga-koko avatar bigguiness avatar pmundt avatar joeperches avatar axellin avatar arndb avatar bzolnier avatar jmberg-intel avatar ralfbaechle avatar adrianbunk avatar danvet avatar olofj avatar rddunlap avatar larsclausen avatar kaber avatar dhowells avatar acmel avatar ozbenh avatar ickle avatar neilbrown avatar heicarst avatar hverkuil avatar ebiederm avatar jmberg avatar

Watchers

James Cloos avatar WillenDuan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.