Xenomai on Raspberry Pi
Setup Xenomai on Raspberry Pi ZeroW
- Install toolchain
- Create a workspace folder to keep everything at one place
- Download Linux kernel for Raspberry Pi
- Download Xenomai source code
Extract files and modify "xenomai/scripts/prepare-kernel.sh": replace "ln -sf" with "cp" so that it will copy all neccessary xenomai files to linux source
- Download Xenomai kernel patch
Download the kernel patch from https://xenomai.org/downloads/ipipe/ . For best compatibility, choose the kernel and patch with similar version number. Otherwise, you may have to fix issues by yourself.
At the time of writing, patch for kernel 4.14.36 is the latest one for downloading. Accordingly we need to switch to a different commit of the linux kernel for RPi for least compatibility issues. Choose 4.14.37 in our case:
You need to replace the following two files in "linux/drivers/irqchip/" to patch the kernel successfully:
Find the modified files from: https://github.com/lemariva/RT-Tools-RPi
- Patch the kernel
If the patching is successful, you should get something like:
- Configure and build patched kernel (for Raspberry Pi ZeroW)
Make changes according to the instructions in .
Build kernel image, modules and device overlay
- Deploy the kernel
You can either configure the new kernel manually like  or build the kernel/headers to be ".deb" packages like .
- Compiling Xenomai tools
-  https://github.com/thanhtam-h/rpi01-4.1.21-xeno3/tree/master/scripts
-  https://lemariva.com/blog/2018/07/raspberry-pi-xenomai-patching-tutorial-for-kernel-4-14-y
-  https://gitlab.denx.de/Xenomai/xenomai/wikis/Setting_Up