Real-Time Kernel with Orange Pi 4 LTS

More
20 Nov 2024 08:51 #314890 by royka
At least for the rk3588 the dtb version must match with the kernel version so I assume it's the same with yours. In this case it might be easier to create an image with the Armbian build system, just put the rt patch in the right folder, for example patch/kernel/archive/rockchip64-6.9 and start with ./compile and choose that you want to see the kernel config before you'll compile it.

Although they only support Linux 6.6, 6.9 and 6.12 (which don't need a rt patch). But if for some reason you need an older kernel you could just find an image with the same version kernel you've compiled and copy that dtb.

Please Log in or Create an account to join the conversation.

More
20 Nov 2024 08:53 #314891 by royka
Is there a reason that you need specific that kernel version?

Please Log in or Create an account to join the conversation.

More
20 Nov 2024 10:52 #314893 by Hossein74Majidi

At least for the rk3588 the dtb version must match with the kernel version so I assume it's the same with yours. In this case it might be easier to create an image with the Armbian build system, just put the rt patch in the right folder, for example patch/kernel/archive/rockchip64-6.9 and start with ./compile and choose that you want to see the kernel config before you'll compile it.

Although they only support Linux 6.6, 6.9 and 6.12 (which don't need a rt patch). But if for some reason you need an older kernel you could just find an image with the same version kernel you've compiled and copy that dtb.

I'm using those kernels just because the official links of orangepi provided them, If any rt-kernel can be installed, that would be great.
when I was using orange pi 5 plus, I used armbian 5.10.160. but I experienced a tough time with its SPI driver. after spending some time on that I thought it may be the armbian which its spi is not real-time and reliable.
That's why this time I was avoiding to installing armbian.
if you think armbian is reliable in SPI, then this time i will try this way.

Please Log in or Create an account to join the conversation.

More
20 Nov 2024 16:03 #314924 by royka
The SPI driver has nothing to do with Armbian, it's in the kernel, it seems to be a known issue with the default (example) driver. Unless their is a proper SPI driver for the rk3399 it won't be different on that sbc. AFAIK there's only made a realtime driver for the RPI.
Unfortunately I don't have a spi board to test with, perhaps it helps to pin the irq of spi to an isolated core?

I've seen that there has been a rt patch for one board for a quite old kernel, I can try to find that one and if I'm able to apply that on the newer kernel.

Please Log in or Create an account to join the conversation.

More
21 Nov 2024 08:31 #314969 by Hossein74Majidi

The SPI driver has nothing to do with Armbian, it's in the kernel, it seems to be a known issue with the default (example) driver. Unless their is a proper SPI driver for the rk3399 it won't be different on that sbc. AFAIK there's only made a realtime driver for the RPI.
Unfortunately I don't have a spi board to test with, perhaps it helps to pin the irq of spi to an isolated core?

I've seen that there has been a rt patch for one board for a quite old kernel, I can try to find that one and if I'm able to apply that on the newer kernel.
 

Is there really a real-time kernel version for the rk3399, like the one for Raspberry Pi? Because I haven't been able to find anything about it.Also, if you manage to find something useful with the older kernel, I’d really appreciate it if you could let me know. Thanks

Please Log in or Create an account to join the conversation.

More
21 Nov 2024 15:21 #314982 by royka
You can try this rt kernel for the rk3399:
drive.google.com/drive/folders/12VfNmKC3...feCnnzYX?usp=sharing

For the spi rt patch I'll see if I'm able to do something. For sure it won't be as complete as the "original" patch but maybe it'll be good enough.
Have you already been able to use the spidev driver at all?

Please Log in or Create an account to join the conversation.

More
23 Nov 2024 06:51 #315086 by Hossein74Majidi

You can try this rt kernel for the rk3399:
drive.google.com/drive/folders/12VfNmKC3...feCnnzYX?usp=sharing

For the spi rt patch I'll see if I'm able to do something. For sure it won't be as complete as the "original" patch but maybe it'll be good enough.
Have you already been able to use the spidev driver at all?
 

Sorry for late response. Yes I've used spidev in orangepi 5 plus before but I always enountered with watchdog errors.
Thanks for helping me. Now I'm trying to try the files in the provided link.
 

Please Log in or Create an account to join the conversation.

More
23 Nov 2024 12:42 #315098 by Hossein74Majidi

You can try this rt kernel for the rk3399:
drive.google.com/drive/folders/12VfNmKC3...feCnnzYX?usp=sharing

For the spi rt patch I'll see if I'm able to do something. For sure it won't be as complete as the "original" patch but maybe it'll be good enough.
Have you already been able to use the spidev driver at all?
 

This worked and it made it real-time.
However its spi driver couldnt be enabled. I mean I've enabled it from armbina-config but in /dev/ directory, the spidev doesnt show up.

Please Log in or Create an account to join the conversation.

More
23 Nov 2024 13:00 - 23 Nov 2024 13:06 #315099 by royka
That's nice, how is the latency? It might help to isolate the last 4 cores (isolcpus=2-5)if just isolating the last core is not good enough (isolcpus=5)

For spi, open /boot/armbianEnv.txt and edit the following:
overlay_prefix=rockchip-rk3399
overlays=spi-spidev
Last edit: 23 Nov 2024 13:06 by royka.

Please Log in or Create an account to join the conversation.

More
24 Nov 2024 06:45 - 24 Nov 2024 08:06 #315164 by Hossein74Majidi

That's nice, how is the latency? It might help to isolate the last 4 cores (isolcpus=2-5)if just isolating the last core is not good enough (isolcpus=5)

For spi, open /boot/armbianEnv.txt and edit the following:
overlay_prefix=rockchip-rk3399
overlays=spi-spidev
 

The latency not good actually, it's 75 us with 6*glxgears without SSH, however during this test, there was so many lags.
and with SSH it was 130 us.
and about:
overlay_prefix=rockchip-rk3399
overlays=spi-spidev
I have now this:
verbosity=1
bootlogo=true
console=both
overlay_prefix=rockchip
fdtfile=rockchip/rk3399-orangepi-4-lts.dtb
rootdev=UUID=a703d82e-8d61-4266-8b54-c10361d608ca
rootfstype=ext4
overlays=rk3318-box-cpu-hs rk3318-box-emmc-ddr rk3318-box-emmc-hs200 rk3318-box-led-conf1 rk3318-box-led-conf2 rk3318-box-led-conf3 rk3318-box-led-conf4 rk3318-box-wlan-ap6330 rk3318-box-wlan-ap6334 rk3318-box-wlan-ext rk3328-i2c0 rk3328-i2s1-pcm5102 rk3328-opp-1.4ghz rk3328-opp-1.5ghz rk3328-spi-spidev rk3328-uart1 rk3399-dwc3-0-host rk3399-i2c7 rk3399-i2c8 rk3399-opp-2ghz rk3399-pcie-gen2 rk3399-spi-jedec-nor rk3399-spi-spidev rk3399-uart4 rk3399-uhs rk3399-w1-gpio rk3566-sata2 rk3568-hk-i2c0 rk3568-hk-i2c1 rk3568-hk-pwm1 rk3568-hk-pwm2 rk3568-hk-pwm9 rk3568-hk-spi-spidev rk3568-hk-uart0 rk3568-hk-uart0-rts_cts rk3568-hk-uart1 rk3568-nanopi-r5c-leds rk3568-nanopi-r5s-leds rockpi4cplus-usb-host rockpro64-lcd
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
isolcpus=2-5

Do I need to change it? cause the spi is there already.

 
Last edit: 24 Nov 2024 08:06 by Hossein74Majidi.

Please Log in or Create an account to join the conversation.

Time to create page: 0.232 seconds
Powered by Kunena Forum