Coder Social home page Coder Social logo

oldjohn86 / ubuntu-rt-up-board Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qiayuanl/ubuntu-rt-up-board

0.0 1.0 0.0 147.85 MB

The RT-PREEMPT 4.4 kernel of ubuntu for UP board.

License: GNU General Public License v2.0

Makefile 0.29% C 95.87% Assembly 1.84% C++ 1.35% Objective-C 0.34% Shell 0.07% Perl 0.13% Awk 0.01% Python 0.05% GDB 0.01% Yacc 0.02% Lex 0.01% UnrealScript 0.01% SmPL 0.02% Gherkin 0.01% XS 0.01% Roff 0.01% Clojure 0.01% M4 0.01% Raku 0.01%

ubuntu-rt-up-board's Introduction

Ubuntu-RT-UP-Board

An UP board Ubuntu real-time patched kernel (4.4.86).

Grab & Go!

Here's a compiled image for UP Board. Copy and paste following in your terminal:

wget -c "https://github.com/QiayuanLiao/Ubuntu-RT-UP-Board/releases/download/UP-board-4.4.86-rt99/UP-board-4.4.86-rt99.tar.xz" && tar -xvzf UP-board-4.4.86-rt99.tar.xz

You are all set now! For the next step:

  1. If you need help to replace the kernel or install Ubuntu, please follow the link and read on.
  2. To test this kernel please refer to Configuration and Test
  3. Also if you want to build from source, here is the tutorial.
  4. Finally, here's a step by step tutorial to build from generic kernel

Features

  • The UP board patches is modify from this repo to work with kernel version 4.4.86
  • Supported Buses:
    • GPIO
    • UART
    • SPI
    • I2C
    • LEDs
  • Unsupported:
    • HDMI Audio
    • PWM(frequency error)

Help Desk

Replace the kernel

  1. Copy the Debian packages to UP board

  2. Remove all the generic installed kernel

    sudo apt-get autoremove --purge 'linux-.*generic'
    
  3. Go to the file of debian packages and install the kernel:

    sudo dpkg -i linux-*.deb
    
  4. Reboot

    sudo reboot
    
  5. Verify that the kernel is indeed installed by typing

    uname -v
    

    you should get

    #1 SMP PREEMPT RT xxxxxxxx
    

Install Ubuntu

  1. Download Ubuntu 16.04.6 ISO from the Ubuntu download page (works with desktop and server edition)

    http://releases.ubuntu.com/16.04/ubuntu-16.04.6-desktop-amd64.iso http://releases.ubuntu.com/16.04/ubuntu-16.04.6-server-amd64.iso

  2. Burn the downloaded image on a USB stick. We suggest to use etcher for doing that. You can download it from:

    https://etcher.io

  3. Insert the USB thumb drive in a empty USB port and proceed with a normal Ubuntu installation.

Build from source

  1. Get the source:

    git clone [email protected]:QiayuanLiao/Ubuntu-RT-UP-Board.git
    cd Ubuntu-RT-UP-Board
    
  2. Config the kernel:

    cp .config kernel
    cd kernel
    make menuconfig
    

    selet save and exit

  3. Make the kernel

    make -j`nproc` && make -j`nproc` bindeb-pk
    

    Then you will get:

    linux-firmware-image-4.4.86-rt99_4.4.86-rt99-1_amd64.deb
    linux-headers-4.4.86-rt99_4.4.86-rt99-1_amd64.deb
    linux-image-4.4.86-rt99_4.4.86-rt99-1_amd64.deb
    linux-libc-dev_4.4.86-rt99-1_amd64.deb
    

Build from generic kernel step by step

  1. Get kernel from:

    https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/snapshot/linux-4.4.86.tar.gz
    

    and decompress.

  2. Get RT_PREEMPT patch from:

    https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/4.4/older/patches-4.4.86-rt99.tar.xz

  3. Get UP board patches from release

    https://github.com/QiayuanLiao/Ubuntu-RT-UP-Board/releases/download/UP-board-4.4.86-rt99/UP-borad-patches.tar.xz

  4. Copy patches-4.4.86-rt99.tar.xz to linux-4.4.86, then patch:

    unxz -cd patches-4.4.86-rt99.tar.xz | patch -p1
    
  5. Copy UP-borad-patches.tar.xz to linux-4.4.86, then patch:

    unxz -cd UP-borad-patches.tar.xz | patch -p1
    
  6. Config and make

Configuration and Test

Config and test HAT device

  1. Check if there are two SPI device

    ls /dev/spidev*
    

    you should get:

    /dev/spidev2.0  /dev/spidev2.1
    
  2. Enable the HAT functionality from userspace

    sudo add-apt-repository ppa:ubilinux/up
    sudo apt install upboard-extras
    sudo usermod -a -G gpio ${USER}
    sudo usermod -a -G leds ${USER}
    sudo usermod -a -G spi ${USER}
    sudo usermod -a -G i2c ${USER}
    sudo usermod -a -G dialout ${USER}
    sudo reboot
    
  3. Go to the /test file run the ./blink.sh

    cd test
    sh ./blink.sh
    

    then the green led of UP board will blink

  4. For HAT test, check

    https://wiki.up-community.org/Pinou

Real time test using latency plot under the stress

  1. Install requirement

    sudo apt install rt-tests stress gnuplot
    
  2. Go to the /test file and Run the RT test

    cd test
    sudo sh  ./rt-test.sh
    

    The latency plot look like this:

    generic real time

  3. Analysis:

    • More sample on the left means lower latency in general
    • More clustered samples indicate less flutter
    • The max latency should not deviate far from mean value (typically under 100us)

Credits

@dicarlo236 helped a lot through out patching work.

ubuntu-rt-up-board's People

Contributors

qiayuanl avatar

Watchers

James Cloos 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.