Hi everybody,
a few weeks ago I bought a Raspberry Pi 3b+ and since then I'm making experiences with both: RPi and Machinekit. However, I've come to a point to not get any further anymore, having one minor and one major problem. With this email I describe the minor problem, I think it will take a lot more time for the major one. Thanks for any advice in advance helping me further!
I'm successfully running a Linux RT kernel on RPi 3b+, I isolated cores 2,3 of my CPU according to
http://www.machinekit.io/docs/hal/threads-and-latency/, I'm successfully running the cgreb service. Here is some further information resp. output of my system (if I can provide more information about something then please let me know):
pi@raspberrypi:~ $ uname -a && cat /etc/os-release | grep PRETTY
-> Linux raspberrypi 4.19.71-rt24-v7-rt+
-> #1 SMP PREEMPT RT Sun Jun 28 07:57:30 CEST 2020 armv7l GNU/Linux
-> PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
pi@raspberrypi:~ $ lscgroup cpuset:/
-> cpuset:/
-> cpuset:/rt
pi@raspberrypi:~ $ dpkg -l machinekit-rt-preempt machinekit
-> ||/ Name Version Architecture
-> +++-==============-============-============
-> ii machinekit 0.1.15705286 armhf
-> ii machinekit-rt- 0.1.15705286 armhf
pi@raspberrypi:~ $ DEBUG=5 CGNAME=/rt latency-test
pi@raspberrypi:~ $ ps -Leo pid,tid,class,rtprio,stat,wchan,psr,comm,args | grep `pidof rtapi:0`
-> 1801 1801 TS - SLsl - 0 rtapi:0 rtapi:0
-> 1801 1805 TS - SLsl - 1 rtapi:0 rtapi:0
-> 1801 1806 TS - SLsl - 1 rtapi:0 rtapi:0
-> 1801 1810 FF 98 SLsl - 2 slow:0 rtapi:0
-> From the DEBUG messages of latency-test I get
-> rtapicmd {
-> instance: 0
-> threadname: "slow"
-> threadperiod: 1000000
-> use_fp: false
-> cpu: -1
-> flags: 0
-> cgname: "/rt"
-> }
Success, the slow thread is started on isolated core #2 of the CPU. But, if I call latency-test with two more arguments then never any of the two threads starts on an isolated core. The DEBUG messages tell me "cpu: -1" for both threads and they are always started on core #0 of the the CPU, eg.
pi@raspberrypi:~ $ DEBUG=5 CGNAME=/rt latency-test 100us 1ms
pi@raspberrypi:~ $ ps -Leo pid,tid,class,rtprio,stat,wchan,psr,comm,args | grep `pidof rtapi:0`
-> 3005 3005 TS - SLsl - 1 rtapi:0 rtapi:0
-> 3005 3009 TS - SLsl - 0 rtapi:0 rtapi:0
-> 3005 3010 TS - SLsl - 0 rtapi:0 rtapi:0
-> 3005 3014 FF 98 SLsl - 0 fast:0 rtapi:0
-> 3005 3016 FF 97 SLsl - 0 slow:0 rtapi:0
-> From the DEBUG messages of latency-test I get
-> equest: type: MT_RTAPI_APP_NEWTHREAD
-> rtapicmd {
-> instance: 0
-> threadname: "fast"
-> threadperiod: 200000
-> use_fp: false
-> cpu: -1
-> flags: 0
-> cgname: ""
-> }
Next, if I switch machinekit packages on the same system to
pi@raspberrypi:~ $ dpkg -l machinekit-*
-> ||/ Name Version Architecture
-> +++-===============================-====================-============
-> ii machinekit-cnc-rt-preempt 0.1.1569926353.git8e armhf
-> ii machinekit-hal-rt-preempt 0.2.1573130755.git12 armhf
-> ii machinekit-manual-pages 1.10340 all
then neither with the command "CGNAME=/rt latency-test" nor with the command "CGNAME=/rt latency-test 100us 1ms" any of the threads is started on an isolated core. I traced back this problem to here because I actually wanted to "loadrt motmod" within "halrun" and assign the two created threads to the two isolated cores, without success.
It looks like I'm missing something, maybe somebody can help me.
Thanks,
Thomas