Can the OPI5 be Configured to Run LCNC?

More
27 Jan 2023 20:36 - 27 Jan 2023 21:35 #263021 by Bari
This is a fork of the thread "Potential All-in-One Single Board Computers".  

forum.linuxcnc.org/18-computer/46077-pot...ters?start=60#262958


Opi5 download and install a Debian version from here  www.orangepi.org/html/hardWare/computerA...ort/Orange-pi-5.html


But you still will have to patch the kernel for preempt_rt and modify the u-boot or hope it works well enough for low latency.

Please post your attempts at doing so on this thread of the forums.
Last edit: 27 Jan 2023 21:35 by Bari.

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

More
27 Jan 2023 20:46 - 27 Jan 2023 21:44 #263023 by Bari
Product page: www.orangepi.org/html/hardWare/computerA...ils/Orange-Pi-5.html

Rockchip RK3588
Quad-core ARM Cortex-A76 MPCore processor and quad-core ARM Cortex-A55 MPCore processor
3x Cortex-M0 MCUs integrated (stepgen)
ARM Mali-G610 MP4 GPU

Links to RK3588 info and data sheets  www.cnx-software.com/2021/12/16/rockchip...eet-sbc-coming-soon/

Orange Pi 5 4GB RK3588S US $68.00 + $12 shipping
www.aliexpress.us/item/3256804748236962.html

Orange Pi 5 8GB RK3588S US $83.00 + $12 shipping
www.aliexpress.us/item/3256804755535571.html

Orange Pi 5 16GB RK3588S US $115.00 + $12 shipping
www.aliexpress.us/item/3256804771408605.html

www.amazon.com/dp/B0BN15SS83   (in stock at higher price, Jan 27)
Last edit: 27 Jan 2023 21:44 by Bari. Reason: fixed links, editor issues etc
The following user(s) said Thank You: CarterKraft

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

More
27 Jan 2023 23:24 #263035 by royka
As said in the other topic I did an attempt to run it on Armbian, which is easy to configure/compile. Without extra boot parameters the latency became quick above a second, then I thought I'd patched the kernel (but got cleaned after) I tried with boot args: isolcpus=4-7 nohz=on nohz_full=4-7, and got with Wayland after running it half an hour watching YouTube and installing various things a max jitter of 100us.
After I realized that I didn't compile the patched kernel I've tried to compile with the preempt rt patches, but got an error. Also didn't I enable the full tick less option the first try, so a lot to improve/try. When I've got time I'll see if I could get most of the rt patches to work but I'm clearly no developer or anything.

The OPI5 with the 3x M0 MCU integrated and 6 pwm pins has a lot of potency with the right people working on it.
The following user(s) said Thank You: CarterKraft

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

More
28 Jan 2023 05:03 - 28 Jan 2023 05:04 #263050 by Bari
I know that the editor for the forums is difficult to work with but can you please post the links to your source, images, binaries, etc etc?
Which version Armbian from where etc etc
How did you build?
Which Kconfig was used?
Do you have a git for all this?

We need details to have any input on this.

100uS isn't bad for a non RT kernel. It's actully good enough for a servo thread with a Mesa FPGA card over Ethernet.

Thank you!
Last edit: 28 Jan 2023 05:04 by Bari.

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

More
28 Jan 2023 15:25 #263090 by royka
In short, I did first download the image from:
github.com/armbian/build/releases

Then setup for GPU hardware acceleration:
forum.armbian.com/topic/25957-guide-kodi...tion-and-hdmi-audio/

To prevent the Panfork drivers/software getting upgraded to non Panfork you coud follow:
forum.armbian.com/topic/26193-pin-packag...ia-and-panform-mesa/

To build a new kernel:
git clone https://github.com/armbian/build.git
cd build
./compile.sh BUILD_ONLY=kernel KERNEL_CONFIGURE=yes BOARD=orangepi5 BRANCH=legacy
Then it will prepare and open the kernel config menu, after exit it will ask to save the config if you hadn't already and then it will compile.
In the /build/output/debs folder you'll get the kernel packages, easy way to install them at once:
sudo apt install ./*.deb

To set the boot parameters:
cd /boot
sudo nano boot.cmd
# search for setenv bootargs "  you could put here the bootargs you want like isolcpus=4-7 nohz=on nohz_full=4-7 then save and compile
sudo  mkimage -C none -A arm64 -T script -d boot.cmd boot.scr

RT kernel patch could be put in this folder
/build/userpatches/kernel/rockchip-rk3588-legacy/

Later on I'll upload images/config, at the moment I'm a bit busy.
The following user(s) said Thank You: Bari, CarterKraft

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

More
29 Jan 2023 21:43 #263188 by royka
Did another test with the full dyntik enabled in the kernel but then the latency became worse, after I removed the nohz_full and nohz parameters it was around 80us but suddenly got a spike to 120us. Then I looked at the dtc and I saw that cpu 4 and 6 had an extra setting:
 dynamic-power-coefficient = <0x12c>;
                        cpu-supply = <0x18>;

cpu 5 and 7 didn't had these, not sure what it means, but decided to try to only isolate cpu 5 and 7 and the result for the servo thread was better.
I can see that the arch_timer still has a lot of interrupts on cpu7, so next step would be to find a way to disable the timer on those 2.

The settings I'd used with this test:
Kernel set on preempt desktop rt in kernel menu config, no patches yet
in armbian-config set the governor on performance , min and max @ 2400mhz but somehow armbianmonitor says 2400/1800mhz
Boot arg: isolcpus=5,7

Opened some glxgears and 4k youtube video and cpu stress on 6 cpu's

Kernel I compiled:
easyupload.io/q0xrfl
Attachments:
The following user(s) said Thank You: CarterKraft

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

More
30 Jan 2023 00:49 - 30 Jan 2023 02:00 #263199 by Bari
Just FYI: The servo thread is the one of interest for use with Mesa over Ethernet, not the base thread. The same is true with Remora using SPI to connect to an external microcontroller. I believe the RK3588 has three (3) integrated Cortex M0 micros but I don't think that the register specs to connect to them is in the public or leaked docs. 

u-boot should be configured to be at one set core frequency. It should not be jumping between core speeds as this causes latency jitter. The system gets halted for at least several hundred core clock cycles while it waits for the clock speed to stabilize and this shows up as a latency spike.
Attachments:
Last edit: 30 Jan 2023 02:00 by Bari.
The following user(s) said Thank You: CarterKraft

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

More
30 Jan 2023 02:07 #263203 by royka
I've read about the base thread not being used for Mesa, I've included that one to see if it might even be usable for software stepping for as long as the MCU's are not in use.
I thought that setting the governor at performance would prevent it from scaling, but that's not enough?

The arch timer had also some interrupts at cpu 5 so perhaps if that one will be disabled on the isolated cpus the latency will improve, not sure yet how to implement that. Here it's explained how to do it on another SBC: community.nxp.com/t5/QorIQ/How-to-move-o...nterrupt/m-p/1046574

The legacy kernel is btw 5.10.110 and only found a rt patch for 5.10.109 was hoping it was close enough. That might be the reason it will not compile with these patches.
The following user(s) said Thank You: CarterKraft

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

More
30 Jan 2023 03:51 #263207 by Bari
If the specs to the Cortex-M0 micros become or already are available then Remora or the other OpiCNC project firmware might be ported to work with the RK3588. The stepgens would be on the M0 micros and a servo thread would be used to update them.

The Allwinner/Orangepi project allwincnc.github.io/index.html

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

More
06 Feb 2023 19:59 #263864 by Bari
Found the u-boot sources here for the Radxa Rock5 wiki.radxa.com/Rock5/dev/Debian

The Radxa Rock5 is very similar to the Opi5. I haven't found the sources for the Opi5 u-boot from orange Pi yet.

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

Time to create page: 0.138 seconds
Powered by Kunena Forum