RealTime-Kernel on RasPI2

Raspberry Pi 2

RealTime-Kernel on RasPI2

Postby faehkerlohl » Mon Feb 15, 2016 11:50 am

So I've been tasked to provide and test various Linux-OS' with the addition of having a realtime kernel.
The first choice is obviously EmbeddedLinux with RT, but what you get is quite limited in functionality and because the RasPi2 will be used for "heavy" development, I'll need several options for remote-dev-tools.

Being an Arch-Acolyte for a long time and enjoying the ease of development using Arch (my Host runs Arch as well), I've been thinking to use LinuxArch|Arm on the RasPi2 - which is, again, quite easy to achieve.
The problem occurs with the realtime contraint: I don't have any idea how to patch the package linux-raspberrypi (4.1.17-3 as of writing this post) and if that even works because the raspi-kernel would differ in some points in the sources, preventing the patches to go through.

Does anyone have prior experience in trying to get the linux-kernel with RT on the RasPi2 or can give me pointers in how to proceed?
I've been looking into the other thread concerning RT-Kernel for Raspberry(1) but couldn't really follow the conversation and hoped that in the ~3years since then it got easier/feasible to accomplish.
faehkerlohl
 
Posts: 1
Joined: Mon Feb 15, 2016 11:35 am

Re: RealTime-Kernel on RasPI2

Postby m16 » Fri Feb 19, 2016 10:22 am

Hello,

I'd be interested in some pointers too.

mk
m16
 
Posts: 1
Joined: Fri Feb 19, 2016 10:21 am

Re: RealTime-Kernel on RasPI2

Postby venetanji » Tue Mar 08, 2016 6:39 am

Hi there! Also trying to figure this magic out.

At the moment the issue is that latest 4.1 rt patch (https://www.kernel.org/pub/linux/kernel/projects/rt/) is based on 4.1.15 but latest version of raspberrypi-linux is updated to 4.1.19 and the patch does not apply cleanly.

This guy built his own rt-kernel using 3.18.9: https://github.com/emlid/linux-rt-rpi

I just tested, patch for 4.4.3 applies ok to 4.4.y branch (https://github.com/raspberrypi/linux/tree/rpi-4.4.y)

I'll see if I can get it to run and let you guys know!
venetanji
 
Posts: 4
Joined: Tue Mar 08, 2016 6:10 am

Re: RealTime-Kernel on RasPI2

Postby venetanji » Thu Mar 10, 2016 10:08 am

Success!

Here's the PKGBUILD:

https://github.com/venetanji/linux-raspberrypi-rt

This is vanilla kernel (no BFQ, no aufs) from the raspberrypi/linux 4.4.y repo with latest rt patch.

Note that you may need to tweak your kernel config according to your hardware, here's a good starting point:

http://raspberrypi.stackexchange.com/qu ... ry-options

Removing unnecessary modules will speed up the compilation time.

Sorry but haven't fixed the checksums yet just run makepkg with --skipchecksums for now :)

If you want to recompile with different kernel config options run:

$this->bbcode_second_pass_code('', 'makepkg --skipchecksums --noprepare --noextract
')

to avoid recompiling the whole thing again.
venetanji
 
Posts: 4
Joined: Tue Mar 08, 2016 6:10 am

Re: RealTime-Kernel on RasPI2

Postby luoyi » Sun Mar 13, 2016 2:41 pm

Hi, could you kind enough provide the compiled rt kernel arch linux arm package here ?

thank you very much .
luoyi
 
Posts: 6
Joined: Mon Nov 05, 2012 2:32 am

Re: RealTime-Kernel on RasPI2

Postby venetanji » Mon Mar 14, 2016 4:22 am

Here you go!

https://www.dropbox.com/s/i6q59d9vpnfiw ... ar.xz?dl=0
https://www.dropbox.com/s/7fsb6b47kxuac ... ar.xz?dl=0

I also updated the PKGBUILD so it should compile ok now and the checksums are updated.

https://github.com/venetanji/linux-raspberrypi-rt

Note that to get audio to work with 4.4.y you need to now add dtparam=audio=on to your config.txt, make sure it's there!
venetanji
 
Posts: 4
Joined: Tue Mar 08, 2016 6:10 am

Re: RealTime-Kernel on RasPI2

Postby luoyi » Tue Mar 15, 2016 2:07 am

which version of firmware do you use ? after upgrade to your firmware, my RPI2

1. can't get HDMI output
2. can't complete the reboot process .
3. can't find i2s audio card

but I can ssh into it.
luoyi
 
Posts: 6
Joined: Mon Nov 05, 2012 2:32 am

Re: RealTime-Kernel on RasPI2

Postby venetanji » Tue Mar 15, 2016 3:55 am

Some config options have changed in 4.4 kernel, you may need to add some lines to your /boot/config.txt

Check here for more info: https://www.raspberrypi.org/forums/view ... 9&start=25

output of dmesg can maybe help find out what's wrong, maybe paste it here I can have a look. I'm also getting an i2s audio card so definitely interested to make it work.

I'm running this on an rpi3 with no screen.
venetanji
 
Posts: 4
Joined: Tue Mar 08, 2016 6:10 am

Re: RealTime-Kernel on RasPI2

Postby luoyi » Wed Apr 06, 2016 2:48 am

sorry , long time not check this thread. I've rollbacked my kernel to the offical one. so doesn't have the dmesg now. maybe I'll have some time to check it again. and can you use your rt-kernel with the DAC board now ?
luoyi
 
Posts: 6
Joined: Mon Nov 05, 2012 2:32 am


Return to Broadcom

Who is online

Users browsing this forum: No registered users and 2 guests