Can the OPI5 be Configured to Run LCNC?

More
24 Apr 2024 18:57 #299020 by royka

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

More
27 Apr 2024 02:15 #299160 by vre
also with spi connection to mesa card like rpi4 ?

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

More
27 Apr 2024 04:22 #299162 by cornholio
I don't know if there is a SPI driver like the RPi from Linuxcnc (this is a dedicated driver for only the Rpi3/34), as per the RPI the /dev/spidev driver probably wont give you the speed you are after.

Unless you already have a 7c80 or 7c81 I'd tend to stay away from the SBC's and go for a small form factor x86 system (if space is a concern) and an ethernet mesa card. That way you wont be stuck when you need to update\replace the computer. Ethernet is everywhere, SPI seems to be the realm of the non-x86 platforms, and each SBC will require it's own driver, which requires someone to develop & maintain it and you are at the whim of the manufacturers\dealers regarding availability........and the infinite number of models.

Another thing to take into account some of these SBC's require messing about with the uboot loader, or whatever flavour of boot loader is used, to use a realtime kernel.

They have their place, it just depends how much time you are willing to spend and whether it will be obsolete in a couple of months to a year.

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

More
27 Apr 2024 04:53 #299166 by vre
This seems very good for use with mesa ethernet card + extra ethernet for internet
www.hardkernel.com/shop/odroid-h4-plus/

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

More
27 Apr 2024 09:12 #299172 by royka
@cornholio not a single one here that had to mess with their ubootloader.
To build a rt kernel is also pretty easy or just download and install. Mainline Linux support is getting there too, it's already usable.

@vre There isn't a SPI driver like on the Raspberry Pi indeed but a /dev/spidev like cornholio said. If I can test the speed with a microcontroller or something I'd like to test it.
@cornholio Is there a reason that this can't work fast enough or just a guess?

Mesa over Ethernet might be the most safe option. An Opi5-plus has dual Ethernet too.

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

More
27 Apr 2024 15:14 #299188 by cornholio
Regarding uboot first post of the thread, so you're saying this has changed now ?
forum.linuxcnc.org/18-computer/48079-can...-lcnc?start=0#263021

Regarding spidev
linuxcnc.org/docs/stable/html/man/man9/hm2_spi.9.html

I've tried it and it just doesn't work on the Rpi5, using 7c81 firmware on a Xilinx dev board (which has the same FPGA as the 7c81 and there's no hardware issues, SPI cable is well grounded & shielded and only about 2" long). The hm2_rpspi driver actually unloads the kernel module, the Linuxcnc driver is actually a direct acting driver on the Rpi3/4 spi hardware. The spidev kernel driver has has to call to the underlying driver that talks to the hardware (and these drivers in themselves may not be optimum for RT cnc work.).

You can load the the hm2_spi driver from within halcmd and everything works as should, but once you start adding the read\write to the servo thread errors start happening. I haven't tried increasing the servo thread as I didn't think is was worth it.

Now I'm using the same hardware with the EPP interface (x86 board), runs fine no issues and talks to Smart Serial boards without an issue.
The following user(s) said Thank You: royka

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

More
28 Apr 2024 00:45 - 28 Apr 2024 01:28 #299224 by royka
Regarding the uboot, that didn't change, hoping that it was good enough did the trick.

It looks indeed that the chance is small that the SPI driver will be fast enough, still worth a shot, but better not to count on it.
Pinning the irq of the spi to the isolated CPU might help by the way.
Last edit: 28 Apr 2024 01:28 by royka.

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

More
08 Jun 2024 08:43 #302615 by Hossein74Majidi
Hi
I'm pretty new in this field and I'm trying hard to figure this out.
I have some challenges that I'm dealing with.
The first one, I couldn't use the GPIO driver which Guglielmi created. I'm getting some errors after configuring and writing the HAL code.
I installed the .deb package of linuxcnc and then installed the wiringop seperately.
Then as explained in following link, I cloned linuxcnc git and then copied and pasted the related files in the considered destination.
forum.linuxcnc.org/18-computer/48079-can...cnc?start=200#273554
I actually tried the halcmd loadrt hal_op5_io, but I got failed error and said it's not existed.

The second question is, is it necessary for OS to be real-time to execute this gpio driver?

and at last, can u please explain again that how should I make my Armbian, Debian bookworm to be real-time? I did the following link procedure as Royka said.
forum.linuxcnc.org/18-computer/48079-can...lcnc?start=80#269222

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

More
08 Jun 2024 11:51 - 08 Jun 2024 12:32 #302621 by royka
To install the realtime kernel just download the 2 files from:
drive.google.com/drive/folders/1JglCIPKv...roZcjOvr?usp=sharing
Then first install the headers, then the kernel. sudo apt install ./linux-headers....

About the driver: did you use the "next" branch? Which errors do you get at what moment?
Were you able to compile/install it with: sudo halcompile --install hal_op5_io.c ?
Last edit: 08 Jun 2024 12:32 by royka.

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

More
08 Jun 2024 12:31 - 08 Jun 2024 12:34 #302623 by Hossein74Majidi
Wow the real-time worked for me, thanks a lot. now I get this:
Linux orangepi5-plus 5.10.160-rt89+ #8 SMP PREEMPT_RT Sun Apr 14 23:02:59 CST 2024 aarch64 GNU/Linux

About the driver, no I didn't use next branch. but the error was that the related files don't exist.
let me tell u what I've done step by step:

I clone linuxcnc-dev, however I already have linuxcnc installed by .deb package.
git clone https://github.com/LinuxCNC/linuxcnc.git linuxcnc-dev
2. Then I copied the hal_op5_io.c file to linuxcnc-dev/src/hal/drivers
3. Then I copied the version.h file and wiringPi folder from Guglielmi attachment in the following link to linuxcnc-dev/src/hal/drivers/opi5
4. Then I renamed the required files: wiringPi_c.h and piHiPri_c.h
5. Then I run
sudo hal compile --install /root/linuxcnc-dev/src/hal/drivers/hal_op5_io.c
I got it right? Did I miss anything?
Last edit: 08 Jun 2024 12:34 by Hossein74Majidi. Reason: typo

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

Time to create page: 0.162 seconds
Powered by Kunena Forum