Why Xenomai?
While Preempt-RT provides soft real-time capabilities, Xenomai 4 delivers hard real-time performance via its EVL (Evolvable Linux) core. This dual-kernel approach achieves:
- Sub-10μs latency for time-critical tasks
- Deterministic interrupt handling
- Coexistence of real-time and Linux applications
Prerequisites
- BeagleY-AI running Debian 12.11 2025-05-21 XFCE
- Host Machine: Ubuntu 22.04+ (64-bit) with ARM cross-compiler
Step 1: Obtain Kernel Sources
(On Host Machine)
1.1 Clone Beagleboard’s Linux Kernel
git clone https://github.com/beagleboard/linux -b 6.6.58-ti-rt-arm64-r27cd linux1.2 Fetch Xenomai EVL Patches
git remote add xenomai https://source.denx.de/Xenomai/xenomai4/linux-evl.gitgit fetch xenomai v6.6.y-evl-rebaseStep 2: Merge EVL into TI Kernel
2.1 Create a Merge Branch
git checkout -b ti-xenomai-mergegit merge xenomai/v6.6.y-evl-rebase2.2 Resolve Merge Conflicts
Focus on:
arch/arm64: TI-specific changes vs. Xenomai’s EVL modifications.drivers/: SPI, PWM, or Ethernet drivers.kernel/sched: Scheduler conflicts between RT and EVL.
Step 3: Configure the Kernel
3.1 Start with BeagleY’s Default Config
make distcleanmake ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bb.org_defconfig3.2 Enable Xenomai EVL
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfigKey Options:
-> Kernel Features -> [*] EVL real-time core [*] Enable quota-based scheduling [*] Enable temporal partitioning policy (4) Number of partitions [*] Collect runtime statisticsStep 4: Build the Kernel
4.1 Compile Kernel & Modules
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LOCALVERSION="-xenomai" -j$(nproc)make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=./modules modules_install4.2 Package Artifacts
tar -czf xenomai-kernel-6.6.69-xenomai.tar.gz arch/arm64/boot/Image modules/lib/modules/6.6.69-xenomaiStep 5: Deploy EVL Kernel
(On BeagleY-AI)
- Copy
Imageto/BOOT/. - Extract modules to
/lib/modules. - Update
/boot/firmware/extlinux/extlinux.conf:
label microSD (default) kernel /Image append console=ttyS2,115200n8 root=/dev/mmcblk1p3 ro rootfstype=ext4 resume=/dev/mmcblk1p2 rootwait net.ifnames=0 quiet fdtdir / fdt /ti/k3-am67a-beagley-ai.dtb fdtoverlays /overlays/k3-am67a-beagley-ai-csi0-tevs-rpi22.dtbo initrd /initrd.imgVerify the kernel version:
$ uname -r6.6.69-xenomaiStep 6: Build & Install Xenomai Libraries
(Native on BeagleY-AI)
6.1 Clone Source
mkdir ~/xenomai && cd ~/xenomaigit clone https://source.denx.de/Xenomai/xenomai4/libevl.gitgit clone https://source.denx.de/Xenomai/xenomai4/linux-evl.git --depth=1 --branch v6.6.y-evl-rebase6.2 Build libevl
mkdir build && cd buildmeson setup -Dbuildtype=release -Dprefix=/usr -Duapi=~/xenomai/linux-evl ../libevlmeson compilesudo ninja install6.3 Validate with EVL test
sudo evl testExpected Output:
basic-xbuf: OK, clock-timer-periodic: OK, clone-fork-exec: OK, etc.
Conclusion
Setting up Xenomai 4 on the BeagleY-AI provides a solid foundation for ultra-low latency audio and robotics applications. By merging the TI vendor kernel with the EVL core, we get the best of both worlds: full hardware support and hard real-time guarantees.