Install Xenomai on DB410C
The following part should be done on Linux OS (VM is also an option)
-
Download ipipe-jro-410c.linaro-15.07
(From URL: http://git.xenomai.org/ipipe-jro.git/tag/?h=410c.linaro-15.07
File name: ipipe-jro-410c.linaro-15.07.tar.bz2 ) -
Download xenomai-jro-410c.linaro-15.07
-
Patch Xenomai into the download kernel (the one with ipipe we downloaded in step 1):
• cd xenomai-jro-410c.linaro-15.07/scripts
• ./prepare-kernel.sh --arch=arm64 --linux=$kernel
($kernel= the path of ipipe we downloaded in step 1) -
Download gcc cross compiler:
gcc-linaro-4.9-2014.11-x86_64_aarch64-linux-gnu (the latest one is not suitable to this kernel) -
cd kernel (kernel = the path of ipipe we downloaded in step 1).
export ARCH=arm64
export CROSS_COMPILE=/bin/aarch64-linux-gnu-
make defconfig distro.config
make -j4 Image dtbs
(must write I = i capital letter) -
sudo apt-get install device-tree-compiler
git clone git://codeaurora.org/quic/kernel/skales -
./skales/dtbTool -o dt.img -s 2048 arch/arm64/boot/dts/qcom/
-
./skales/mkbootimg --kernel arch/arm64/boot/Image
–ramdisk initrd.img-4.9.27-linaro-lt-qcom
–output boot-db410c.img
–dt dt.img
–pagesize 2048
–base 0x80000000
–cmdline “root=/dev/disk/by-partlabel/rootfs rw rootwait console=ttyMSM0,115200n8” -
sudo fastboot flash boot boot-db410c.img
Reference to parts 1-3: Installing xemomai on 410c
Reference to parts 4-10: https://builds.96boards.org/releases/dragonboard410c/linaro/debian/latest/
After we’ve done with flashing the Dragonboard with the Xenomai patched kernel, a configuration of Xenomai must be done in order to use it properly. The following steps are done on the DB410C itself:
- Download http://git.xenomai.org/xenomai-jro.git/ xenomai-jro-410c.linaro-15.07.tar.bz2 natively and extract it.
- sudo apt-get update
- sudo apt-get install automake
- sudo apt-get install libtool
- sudo apt-get install libltdl-dev
- sudo apt-get install autoconf
- sudo apt-get install dh-autoreconf
- cd to the directory you have downloaded xenomai at step 1
- ./scripts/bootstrap
- ./configure --with-core=cobalt --enable-smp --enable-pshared --enable-assert --prefix=/usr/xenomai
- make -j 4
- sudo make install
- sudo su
- sudo echo “/usr/xenomai/lib” > /etc/ld.so.conf.d/xenomai.conf
- PATH=$PATH:/usr/xenomai/bin
- run latency check:
/usr/xenomai/bin/latency
That’s it. You now have Xenomai installed and enabled on your board.
Here is an example of a simple “Hello World” program taken from here (just copy the code of Hello World section) http://www.cs.ru.nl/lab/xenomai/exercises/ex01/Exercise-1.html
To compile the program use the following commands (ex01.c is the program you wish to compile)
Pay attention that ` = backtick.
- sudo su
- PATH=$PATH:/usr/xenomai/bin
- xeno-config --skin=native --cflags
- xeno-config --skin=native --ldflags
- export CFLAGS=
xeno-config --skin=native --cflags
- export LDFLAGS=
xeno-config --skin=native --ldflags
- export LD_LIBRARY_PATH=/usr/xenomai/lib/
- gcc $CFLAGS $LDFLAGS -o
For example:
gcc $CFLAGS $LDFLAGS /home/linaro/ex01.c -o ex01 - run you program
./ex01
And of course you may use the full Xenomai API documentation from here to create your own programs https://xenomai.org/documentation/xenomai-3/pdf/xeno3prm.pdf
Credits: Special thanks go to Jorge Ramirez - ldts who helped us to get through a whole lot of obstacles during the process