Skip to content

Notes on PREEMPT_RT patching the Raspberry Pi 3B kernel

Notifications You must be signed in to change notification settings

non-det-alle/rtpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PREEMPT_RT patch the Raspberry Pi 3B kernel

Useful links for RT patching the kernel:

Tested on kernel 6.1.77 and Raspberry OS Bookworm (link to exact version).

The linux/ contains a submodule with the kernel code already patched (even if it's quite easy to do yourself). You can pull the contents by cloning with --recurse-submodules --shallow-submodules (second option is there to avoid pulling the full kernel repo, which is big).

Kernel compilation

IMPORTANT: Configure full real-time capabilities with menu_config before compilation.

Cross compile the kernel following the indications in the second link.

Installation via ssh

After having built the kernel:

  • Run the packing script from this directory: ./pack.sh.
  • Copy the installation archive via ssh: scp .\rt-install.tar.gz <dest>:.
  • Ssh into your Raspberry Pi: ssh <dest>
  • Backup your current kernel image: sudo cp /boot/firmware/kernel8.img /boot/firmware/kernel8-$(date +"%Y%m%d_%H%M%S").img
  • Unpack the files tar -xvf rt-install.tar.gz
  • Copy the nel kernel files: sudo cp -r rt-install/* /
  • Append dwc_otg.fiq_enable=0 dwc_otg.fiq_fsm_enable=0 to /boot/firmware/cmdline.txt (see https://wiki.linuxfoundation.org/realtime/documentation/known_limitations)
  • Reboot: sudo reboot

All in one script to run on ste RPi (DANGER!):

sudo cp /boot/firmware/kernel8.img /boot/firmware/kernel8-$(date +"%Y%m%d_%H%M%S").img && \
tar -xvf rt-install.tar.gz && sudo cp -r rt-install/* / && \
sudo sed -i 's/$/ dwc_otg.fiq_enable=0 dwc_otg.fiq_fsm_enable=0/' /boot/firmware/cmdline.txt

About

Notes on PREEMPT_RT patching the Raspberry Pi 3B kernel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages