• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linux RT kernel
#1
The Linux kernels of all netPI versions are upgraded with a real time extension also known as RT patch. For more details read the documentation.

You can use those RT features on netPI as well in your containerized applications. For that reason we are providing a compilation of RT tests as example under the Docker image netpi-linux-rt-patch-tests ready for your download. Try the different precompiled test applications, understand them as they are described in the documentation link above and create your own later.

We have seen that latencies smaller than 100usec can be reached easily.



You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#2
Hi Armin,
Where can I find the linux kernel for the netPi with the real time preemptive patch ?

Thx

Roy
  Reply
#3
Hello Roy,

the patch is included in the netPI default OS.

I have made a test in April 2018 with a test container. The Dockerfile based build of the container I made public here https://github.com/HilscherAutomation/ne...atch-tests

In the Dockerfile you see what I have hacked together and in the README what are the RT patch test commands you can use.

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#4
(December-3rd-2017, 08:49 AM)Armin@netPI Wrote: The Linux kernels of all netPI versions are upgraded with a real time extension also known as RT patch. For more details read the documentation.

You can use those RT features on netPI as well in your containerized applications. For that reason we are providing a compilation of RT tests as example under the Docker image  netpi-linux-rt-patch-tests ready for your download. Try the different precompiled test applications, understand them as they are described in the documentation link above and create your own later.

We have seen that latencies smaller than 100usec can be reached easily.

We are using our own sd card on the netPi platfotm with raspberian image downloaded from the rpi web site, not the SD which was delivered with netPi.
I understand the kernel and the bsp could be different. So I see two possible options:
1. To copy the fat32 partition from the SD card you delivered to the SD I have created.
2. To compile the kernel my self. That is why I asked if it can be located. is it something you share ? is it part of the  https://github.com/raspberrypi ? on a specific branch ?

please advice.

Thx,

Roy
  Reply
#5
Hi Roy,

oh did not know your are using your own SD card.

What I can tell you about the RT kernel patch is that the general patch has to fit to the used kernel. We are using kernel 4.9 with the RT patch and it worked fine. Then we have started a project later using kernel 4.14 and wanted to integrate the very same RT patch and it failed cause it produced 30% CPU load basically and this was unacceptable for us

1. copying the FAT32 partition is not enough. netPI SD card has 4 partitions. You can see them if you mount the SD card in Ubuntu for example. All 4 partitions are needed
2. yes the only chance I see is to build your own RT patched kernel yourself and make your own tests and collect experience like we did with kernel 4.14. I know currently the raspbian kernel is 4.19. I cannot tell you if there is patch available for kernel 4.19. In general we do not share our yocto reciept, but I thought building an own kernel along with any linux is well documented on the web? Isn't it? The landing page is this one here https://wiki.linuxfoundation.org/realtime/start

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#6
(January-31st-2020, 09:01 AM)Armin@netPI Wrote: Hi Roy,

oh did not know your are using your own SD card.

What I can tell you about the RT kernel patch is that the general patch has to fit to the used kernel. We are using kernel 4.9 with the RT patch and it worked fine. Then we have started a project later using kernel 4.14 and wanted to integrate the very same RT patch and it failed cause it produced 30% CPU load basically and this was unacceptable for us

1. copying the FAT32 partition is not enough. netPI SD card has 4 partitions. You can see them if you mount the SD card in Ubuntu for example. All 4 partitions are needed
2. yes the only chance I see is to build your own RT patched kernel yourself and make your own tests and collect experience like we did with kernel 4.14. I know currently the raspbian kernel is 4.19. I cannot tell you if there is patch available for kernel 4.19. In general we do not share our yocto reciept, but I thought building an own kernel along with any linux is well documented on the web? Isn't it? The landing page is this one here https://wiki.linuxfoundation.org/realtime/start

Thx
Armin

Hi Armin,
I am still contemplating what approach to take.
a. use your kernel and try to change the rootfs in the /boot/config.txt to have my own rootfs + copying the kernel modules from your img to mine. 
b. start from clean rpi image  

my concerns regarding approach a.
* is the yocto rootfs visible or encrypted ?
* read in another thread in the forum there is some kind of hw id validation https://forum.hilscher.com/Thread-SOLVED...cher-Image

my concerns regarding approach b.
* will I be able to have all net pi hw capability with raspberian vanilla image ?
I took the same sd card that was running with nethat moved it to netPi removed the Firmware packages  and Drivers of netHat, installed the netPi Firmware packages  and Drivers and tried to compile and run the example you provided. got a message the /dev/spi is missing.
There was a gap in between the Firmware sample and what was extracted from the deb package.  R160D000.nxf in deb package, X070D000.nxf in sample. is it just a remains of old version ?

I need also to consider what approach to take in order to be able to move to rt_preemptive patch later on.
I prefer approach b. but I am not sure I will be able to interact with all the hw drivers you provide on netPi. do you use drivers that I have to take from your propitiatory kernel or I can get it done straight forward in a clean image ?

please advice.

Thx

Roy
  Reply
#7
Roy,

approach 1 in my eyes is impossible. netPI boots a secured Linux that is bound to the serial number the kernel was deployed on during production time of netPI. It checks a signed certificate and then continues the boot process all the underlying kernel components like the simple "dpkg" command need packages for post-installation that are signed by hilscher root key ... which of course nobody have except we. And the FAT32 partion you see ... contains not the netPI software. There are more partitions named BACKUP, RESTORE and SYSTEM containing netPIs software and kernel.

And yes netPI schematics are 100% the same as original Raspberry Pi 3B. It is coming from the same fab in China. If "/dev/spi" is missing then you have to enable it using the raspi-config to enable the SPI device in general. This is not under control of the driver.

Each netX hardware has an internal security memory telling the firmware which firmware can be loaded. netHAT has a differnet signature that netPI concerning netX. This is why the netPI samples come with a firmware named Rxxxxx.nxf while netHAT come with Xxxxxx.nxf. So your netHAT sample will not run directly with the netX controller used on netPI.

The only possibility I see is using option b.) only.

The driver we provide are simply said SPI drivers and are not in conflict with the RT patch.

Thx
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#8
Thank you for your detailed answer.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Yocto linux tad 2 1,943 February-21st-2022, 11:50 AM
Last Post: tad
  linux bridge eth0 and cifx0 carmel85 3 3,467 August-13th-2020, 08:41 AM
Last Post: Armin@netPI
  Network issues after upgrading to Stretch + kernel to 5.4 carmel85 2 3,014 July-28th-2020, 03:04 PM
Last Post: Armin@netPI
  netX linux driver Irina Grinberg 4 3,472 May-7th-2020, 01:33 PM
Last Post: Armin@netPI
  Yocto Linux for Rpi3 + netHAT jenrei 4 3,736 July-16th-2018, 11:49 AM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)