Can the OPI5 be Configured to Run LCNC?

More
15 Jun 2023 07:36 #273580 by tommylight
Perhaps editing GRUB so it boots the RT kernel?

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

More
15 Jun 2023 08:12 #273587 by rodw

Perhaps editing GRUB so it boots the RT kernel?

THere is no grub on ARM 

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

More
15 Jun 2023 08:24 #273590 by tommylight

Perhaps editing GRUB so it boots the RT kernel?

THere is no grub on ARM 


That is why i used "perhaps" as i can not recall reading about it, ever.
Does it use the same way of loading kernel as some android tv boxes?
That requires editing a text file to point to the other kernel.

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

More
15 Jun 2023 11:43 - 15 Jun 2023 11:48 #273604 by royka
That doesn't look like the realtime kernel indeed or there is something else wrong. Mine still has to come so couldn't test it.

To check if you're using the rt kernel you could run latency-histogram from a terminal. If it's a rt kernel you should see "Note: Using POSIX realtime"

sudo apt upgrade AFAIK shouldn't upgrade the kernel, if you did dist-upgrade there is a chance it "upgraded" the kernel to the non rt kernel. When you've built the image you should also have the kernel deb in the output folder. Assuming you had placed the patches in the right folder, reinstalling the rt kernel should fix it:
sudo dpkg -i --force-overwrite linux-image-legacy-rockchip......deb

To prevent the kernel from getting "upgraded":
sudo apt-mark hold linux-image-legacy-rockchip-rk3588

The rt kernel built with the patches with Armbian should have the same name as the non rt kernel. Because it doesn't like local versions I had to remove that with a patch.

Actually there is GRUB for ARM:
forum.armbian.com/topic/24931-armbian-efigrub-nvme/

The rk3588 could make use of uboot or UEFI, with this Armbian version it's uboot, this uboot searches for extlinux or boot.scr. In this case it has boot.scr, variables set in armbianEnv.txt overrules the ones set in boot.scr. boot.cmd is the one which is readable/editable and you could compile to boot.scr (last line explains how), but you probably don't need to.
Last edit: 15 Jun 2023 11:48 by royka. Reason: GRUB for ARM
The following user(s) said Thank You: tommylight, rodw

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

More
15 Jun 2023 14:34 - 15 Jun 2023 23:25 #273615 by buzzFab
I tried your suggestion Rod, i used a freshly flashed image of bookwork server.
sudo apt install linux-image-rt-arm64

it errored out due to /boot being full. I will have to figure out how to resize the partition and try again tonight.

(edit) I found that I can add a argument when building the image BOOTSIZE="xxx" where xxx is size is MB.
Eric
Last edit: 15 Jun 2023 23:25 by buzzFab.
The following user(s) said Thank You: rodw

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

More
15 Jun 2023 15:43 #273622 by royka

Hi, as promised, I finalized and tested the gpio driver for OPI5.
It is based on wiringPi provided with wiringOP.
In my first release I cut & paste functions on my driver in order to have all in one but finally I though it could be a big advantage to
keep wiringPi mostly as it is so in future someone else could take last official release and attach to my code easily..
I accept suggestions here... in order to complete this step, I renamed 2 files xxx.c to xxx_c.h, including them in my .c driver.
I don't know other way to include the c part with functions implementation. I commented step by step in the driver how to do. 

Attached driver.c and file.so already built.
I tested with oscilloscope and IN and OUT are working as expected.

Another couple of doubts are related to permissions to set for uart, I'm configuring them into the driver.. for me it's ok... and the debug port that I don't know way but I'm not able to have in the system with correct name ttyS2 so it works renaming it.

WiringIp allows to use uart, 1wire, i2c.. so in future it's possible to extend the driver with some new interfaces for linuxcnc..

// how to build the driver:
// 1. clone linuxcnc branch on opi5
// 2. copy this file inside linuxcnc/src/hal/drivers
// 3. clone next branch of wiringOP
// 4. create a folder linuxcnc/src/hal/drivers/opi5
// 5. copy wiringPi folder and version.h file included into wiringOP package into opi5
// 6. inside opi5/wiringPi find and rename file: wiringPi.c --> wiringPi_c.h
// 7. inside opi5/wiringPi find and rename file: piHiPri.c --> piHiPri_c.h
// 8. build the driver "sudo halcompile --install /home/USER/WhereLinuxCNCWasCloned/linuxcnc/src/hal/drivers/hal_op5_io.c"

/* How to use in hal:
copy and paste this piece of text

# ========= GPIO -> WiringPI pins =======================
# The number of pin correspond to the number of wPi in the table calling "gpio readall", for opi5 0-16
# 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 
# 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
#
# 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 0 0 1 0 0 0 0 1 0 1     --> 51333 // dir      [bin to dec]  mask (0 = IN,     1 = OUT)
# 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0     -->    24 // exclude [bin to dec]  mask (0 = used,     1 = Excluded)
# excluded pins for serial (modbus)
# using uart1 for modbus, wpi 3-4 should be excluded.
loadrt hal_op5_io dir=51333 exclude=24

# --- begin addf s
addf hal_op5_io.read base-thread            # <== read task
addf stepgen.make-pulses base-thread
addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
addf hal_op5_io.write base-thread            # <== write task
# --- end addf s

# The number of pin correspond to the number of wPi in the table calling "gpio readall"
net xstep stepgen.0.step => hal_op5_io.pin-02-out
net ystep stepgen.1.step => hal_op5_io.pin-11-out
net zstep stepgen.2.step => hal_op5_io.pin-15-out
*/
 

That's an awesome job what you made! This makes the OPI5/rk3588 a true all-in-one SBC. When I see time I'll test it.
The following user(s) said Thank You: Guglielmi

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

More
15 Jun 2023 16:08 - 15 Jun 2023 16:33 #273625 by royka
@buzzFab I wasn't aware of the size limit of mega.nz. Did you try to use a working Ubuntu Jammy image and install the kernel deb package that's in the folder of the image I had uploaded?

This is the compressed image which is 1.18 GB instead of 5.92 GB:
mega.nz/file/mkAj0ADb#kOVsoqYLxDANBkXT2R...oZ83G4Og2jwaKIpWqwtU
Last edit: 15 Jun 2023 16:33 by royka. Reason: Compressed image
The following user(s) said Thank You: buzzFab

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

More
16 Jun 2023 14:39 #273702 by royka
@buzzFab I've finally received the OPi5+
The image I had uploaded doesn't work as is. It does load the dtb and kernel but then it's looking for an UUID that isn't in armbianEnv.txt or fstab, perhaps something wrong in the dtb or uboot.
Tomorrow I'll look further into it, perhaps using a working image and install the rt-kernel that I had uploaded will still work.

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

More
16 Jun 2023 16:10 #273705 by buzzFab
@royka I actually tried your image last night and it only booted to the (initramfs) prompt. I then built a xfce jammy image and download the debs from your folder. when i tried to install them with the gui only one would install, I cant remember which one.

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

More
17 Jun 2023 15:15 #273743 by buzzFab
You can now get a passively cooled aluminum case for the OPi5 and OPi5b on AliExpress or Amazon.

www.aliexpress.com/item/1005005558033596.html

www.amazon.com/Orange-Pi-Aluminum-Materi...atible/dp/B0C6K6QQXT

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

Time to create page: 0.345 seconds
Powered by Kunena Forum