[LINUX] Step 2 to install Xenomai on RaspberryPi 3 model B +

Overview

Last time, I explained the procedure to build the Kernel for introducing Xenomai. This time, I will build Xenomai itself so that I can use the functions of Xenomai on Raspberry Pi. If Xenomai can be introduced into a microcomputer, operations that require real-time performance, such as robot operation, will be possible.

Notes

It's a continuation of the last time, so if you haven't seen it yet, I recommend reading this first.

Procedure for installing Xenomai on RaspberryPi 3 model B + Part 1

https://qiita.com/TordanHatiman/items/697aaa520914e159de2b

The specifications etc. are not different from the first one, so they are omitted.

table of contents

--Work content --Operation check

Work content

Work in a cross-compile environment where you built the Kernel for Xenomai as before. Xenomai itself is also located in the same working directory. (The previous working directory was kernel_cnst)

Let's work now. First, build the Xenomai libraries. Since it is a cross-compilation environment, pass the path to the cross-compiler. (Same as what I did last time)

linux_user@TN-201709Fxxxx:~$ cd ~/kernel_cnst
linux_user@TN-201709Fxxxx:~$ cd ./Xenomai3.x/
linux_user@TN-201709Fxxxx:~$ export CROSS_COMPILE=../tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-

Next, build Xenomai, but create a directory to store the built files in order to move the built files to RPi.

linux_user@TN-201709Fxxxx:~$ mkdir ~/kernel_cnst/target
linux_user@TN-201709Fxxxx:~$ ./scripts/bootstrap
linux_user@TN-201709Fxxxx:~$ ./configure CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfloat-abi=hard -mfpu=neon -ffast-math" --enable-smp --with-core=cobalt
linux_user@TN-201709Fxxxx:~$ make -j4 install DESTDIR=~/kernel_cnst/target/

If the build passes, the compilation is complete. Compress the files as before and bring them to RPi. (You can also transfer with SSH, but I do not recommend it for security)

linux_user@TN-201709Fxxxx:~$ cd ~/kernel_cnst
linux_user@TN-201709Fxxxx:~$ tar -zcvf xenomai_tools.tgz ./target

Bring it to a suitable place and defrost it -------- Work with RPi from here --------

linux_user@TN-201709Fxxxx:~$ cd ~/workspace(It's a place to unzip, so it can be anywhere)
linux_user@TN-201709Fxxxx:~$ tar -zxvf ./target.tgz

After unzipping, install the file you brought into RPi

linux_user@TN-201709Fxxxx:~$ sudo cp -rd ./target/dev/* /dev/
linux_user@TN-201709Fxxxx:~$ sudo cp -rd ./target/usr/* /usr/

Also at this time, be sure to make a backup of / dev / and / usr / before installation </ font> This completes the introduction of Xenomai itself.

Operation check

When the Xenomai installation work is completed without any errors, execute the following

linux_user@TN-201709Fxxxx:~$ sudo /usr/xenomai/bin/latency

If it works normally, the latency will be measured as follows.

== Sampling period: 1000 us
== Test mode: periodic user-mode task
== All results in microseconds
warming up...
RTT|  00:00:01  (periodic user-mode task, 1000 us period, priority 99)
RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst
RTD|     12.239|     12.693|     19.427|       0|     0|     12.239|     19.427
RTD|     12.291|     12.720|     16.926|       0|     0|     12.239|     19.427
RTD|     12.290|     12.701|     17.447|       0|     0|     12.239|     19.427
RTD|     12.238|     12.709|     14.634|       0|     0|     12.238|     19.427

Exhibitor: https://lemariva.com/blog/2018/07/raspberry-pi-xenomai-patching-tutorial-for-kernel-4-14-y (I forgot to take this log this time, so I referred to the above.)

In this way, Xenomai has real-time performance that can process even application operations in 1ms units. Application operation check code using Xenomai functions in C language is also published on the net, so you may want to check that.

I actually measured the Latency of Xenomai, but it is true that the Latency works at 1ms ± 0.1ms at the latest for a program that runs at 1ms cycle, and most of them return a response at 1ms, so a Linux-based microcomputer operates in real time. I think it's the best way to get it done. (Measurement data cannot be posted due to various circumstances .....)

At the end

Since there are almost no Japanese-based materials for introducing Xenomai, it is quite difficult unless you are accustomed to reading and understanding overseas materials. If you get stuck trying to do the same, feel free to ask. (I will answer as much as possible)

I will write about the patch in another article. I'm sorry for those who want to see it in writing, but please wait until then ...

See you later!

Recommended Posts

Step 2 to install Xenomai on RaspberryPi 3 model B +
Procedure for installing Xenomai on RaspberryPi 3 model B + Part 1
Could not install python3.8.1 grovepi module on RaspberryPi Model 3B (solved)
Retry to turn on/off the power of the USB port on RaspberryPi 4 Model B
Power on/off the USB port on the RaspberryPi 4 Model B
Steps to install MySQL 8.0 on CentOS 8.1
How to install mysql-connector-python on mac
Steps to install matplotlib on Mac
Steps to install VirtualBox on CentOS
How to install graph-tool on macOS
How to install pycrypto on Windows
How to install OpenCV on Mac
How to install PyPy on CentOS
How to install TensorFlow on CentOS 7
How to install Maven on CentOS
Steps to install python3 on mac
How to install Go on Ubuntu
How to install music 21 on windows
Install Ubuntu 18.04 on MacBook Pro Touchbar model and connect to WIFI
How to install aws-session-manager-plugin on Manajro Linux
How to install drobertadams / toggl-cli on Mac
[Kivy] How to install Kivy on Windows [Python]
USB boot on Raspberry Pi 4 Model B
Install ROS and ROS module for Roomba on RaspberryPi3 and try to run it
Steps to install Python environment on Ubuntu
How to install packages on Alpine Linux
5 reasons to install Linux on your laptop.
How to install Anisble on Amazon Linux 2
Error reading SHT31-D value on RaspberryPi 3B +
How to install richzhang / colorization on Windows 10
How to install Apache (httpd) on CentOS7
Install python on xserver to use pip
How to install php7.4 on Linux (Ubuntu)
How to install Eclipse GlassFish 5.1.0 on CentOS 7
How to install Apache (httpd) on CentOS8
Personal Note Package to install on Anaconda
How to install NumPy on Raspberry Pi
How to install cx_Oracle on macOS Sierra
[2020 version] How to install Python3 on AWS EC2
How to install OpenCV on Jetson Nano Python
How to quickly install h5py on Windows 10 [Unofficial]
How to install OpenGM on OSX with macports
How to install Camunda Modeler on Manjaro Linux
[Python] How to install OpenCV on Anaconda [Windows]
How to install / verify graphviz on anaconda / windows10
Install Debian 10 to use Remote Development on BeagleBone Black
Steps to install the latest Python on your Mac
Very easy to install SciPy on Mac OS X
How to install Linux on a 32bit UEFI PC
How to install Git GUI and Gitk on CentOS
How to install caffe on OS X with macports
[AWS EC2] How to install Maven on Amazon Linux 2
How to install git on Linux such as EC2
I tried to install scrapy on Anaconda and couldn't