- Posts: 383
- Thank you received: 135
Can the OPI5 be Configured to Run LCNC?
- royka
- Offline
- Platinum Member
-
Less
More
2 years 6 months ago #299172
by royka
Replied by royka on topic Can the OPI5 be Configured to Run LCNC?
@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.
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.
- Cant do this anymore bye all
- Offline
- Platinum Member
-
Less
More
- Posts: 1200
- Thank you received: 426
2 years 6 months ago #299188
by Cant do this anymore bye all
Replied by Cant do this anymore bye all on topic Can the OPI5 be Configured to Run LCNC?
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.
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.
- royka
- Offline
- Platinum Member
-
Less
More
- Posts: 383
- Thank you received: 135
2 years 6 months ago - 2 years 6 months ago #299224
by royka
Replied by royka on topic Can the OPI5 be Configured to Run LCNC?
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.
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: 2 years 6 months ago by royka.
Please Log in or Create an account to join the conversation.
- Hossein74Majidi
- Offline
- Senior Member
-
Less
More
- Posts: 44
- Thank you received: 0
2 years 4 months ago #302615
by Hossein74Majidi
Replied by Hossein74Majidi on topic Can the OPI5 be Configured to Run LCNC?
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
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.
- royka
- Offline
- Platinum Member
-
Less
More
- Posts: 383
- Thank you received: 135
2 years 4 months ago - 2 years 4 months ago #302621
by royka
Replied by royka on topic Can the OPI5 be Configured to Run LCNC?
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 ?
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: 2 years 4 months ago by royka.
The following user(s) said Thank You: briansm
Please Log in or Create an account to join the conversation.
- Hossein74Majidi
- Offline
- Senior Member
-
Less
More
- Posts: 44
- Thank you received: 0
2 years 4 months ago - 2 years 4 months ago #302623
by Hossein74Majidi
Replied by Hossein74Majidi on topic Can the OPI5 be Configured to Run LCNC?
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.
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
I got it right? Did I miss anything?
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.
Code:
git clone https://github.com/LinuxCNC/linuxcnc.git linuxcnc-dev
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
Code:
sudo hal compile --install /root/linuxcnc-dev/src/hal/drivers/hal_op5_io.c
Last edit: 2 years 4 months ago by Hossein74Majidi. Reason: typo
Please Log in or Create an account to join the conversation.
Time to create page: 3.131 seconds