I have patched PREEMPT-RT for Raspbian Linux kernel. It works fine for normal operations (web browsing or short time programs) the following is the output of
uname -a of my Rapsberry Pi 2 after patching
My problem is this systems is freezing for some code that I am running. I tried to make a simple code to calculate how long the Raspberry Pi 2 can stay without freezing. I used the following code
#!/bin/bash cd ~/Scripts/running_time export start_time=$(date +'%Y/%m/%d___%H:%M:%S') printf $start_time > up_time while true do printf 'start time %s \n end at %s' $start_time, $(date +'%Y/%m/%d___%H:%M:%S') > up_time sleep 1 done
What I got is it freezes after about 4 hours. I have other code and it freezes after 1 hour and sometimes after 10 minutes.
I have monitored system performance remotely using ssh with htop, the following is observed at last moment before freezing:
RAM consumption: total memory consumption about 120 M running script load: only 6 M
So for me:
Raspbian without the PREEMPT-RT patch is working without freezing.
Raspbian with the PREEMPT-RT patch without any running applications is working without freezing.
Raspbian with the PREEMPT-RT patch running applications is freezing.
I hope someone has suggestions or explanations for solving this issue please.
I have worked on solving this problem for almost 1 year. Simply I wasn't able to solve it. But I will try to describe what actions I had taken maybe I can shorten sometime for people who are suffering from the same problem:
for applying the PREEMPT-RT patch, please use this link http://www.frank-durr.de/?p=203 as it is the best resource explaining how to apply the PRREMPT-RT.
you are free to execute
sudo apt-get update. it doesn't matter.
to predict if your linux going to freeze or not, use ltp test suite
there you can build realtime test cases:
tar xvf ltp-full-20150420.tar.bz2 cd ltp-full-20150420 ./configure --with-realtime-testsuite cd testcases/realtime make
then execute a test called pthread_kill_latency (
sudo ./run.sh -t func/pthread_kill_latency -l 25) usually the linux will freeze in first 5 running.
When freezing, switch off your power then switch it on again, open log message
nano /var/log/syslogmaybe you can find a clue what happend before freezing immediately.
That is all my conclusion. I had to stop searching for that problem. If someone found a solution, I will be grateful if he/she shares with us here.