- Posts: 99
- Thank you received: 23
Can the OPI5 be Configured to Run LCNC?
- echristley
- Offline
- Premium Member
-
Less
More
3 years 4 months ago #273526
by echristley
Replied by echristley on topic Can the OPI5 be Configured to Run LCNC?
Progress report:
- I got all the hardware rounded up and installed in a box.
- I've verified that the OPi5 can ping the Mesa7i96s. Don't have mesaflash on the Pi, so I wasn't able to get a report from the card.
- I've run through PncConf, but so far I've not been able to get any of the motors to move. I have everything except the Pulse and Dir of each motor disconnected for now.
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
-
Less
More
- Posts: 12170
- Thank you received: 4153
3 years 4 months ago #273529
by rodw
Replied by rodw on topic Can the OPI5 be Configured to Run LCNC?
mesaflash is in the debian bookworm repos
sudo apt install mesaflash
alternatively, its simple to build from source.
github.com/LinuxCNC/mesaflash
sudo apt install mesaflash
alternatively, its simple to build from source.
github.com/LinuxCNC/mesaflash
Please Log in or Create an account to join the conversation.
- Guglielmi
- Offline
- Senior Member
-
Less
More
- Posts: 78
- Thank you received: 17
3 years 4 months ago #273554
by Guglielmi
Replied by Guglielmi on topic Can the OPI5 be Configured to Run LCNC?
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..
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..
Code:
// 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
*/
The following user(s) said Thank You: royka, buzzFab
Please Log in or Create an account to join the conversation.
- buzzFab
- Offline
- Junior Member
-
Less
More
- Posts: 28
- Thank you received: 7
3 years 4 months ago - 3 years 4 months ago #273568
by buzzFab
Replied by buzzFab on topic Can the OPI5 be Configured to Run LCNC?
OPi5 Plus,
I built a bookwork server image, EDGE isn't an option only LEGACY. It booted up without and problems.
I then did this
upon reboot I xfce was working so I then did
added this line to isolate cpus
then installed linuxcnc with
but the jitter is horrible.
see attached screenshot
I built a bookwork server image, EDGE isn't an option only LEGACY. It booted up without and problems.
I then did this
Code:
sudo apt update && sudo apt upgrade
Code:
sudo apt install tasksel -y
Code:
sudo tasksel install xfce-desktop
Code:
sudo reboot
upon reboot I xfce was working so I then did
Code:
sudo nano /boot/armbianEnv.txt
added this line to isolate cpus
Code:
extraargs=isolcpus=4,5,6,7
then installed linuxcnc with
Code:
sudo apt-get install linuxcnc-uspace linuxcnc-uspace-dev mesaflash
but the jitter is horrible.
see attached screenshot
Last edit: 3 years 4 months ago by buzzFab.
Please Log in or Create an account to join the conversation.
- pippin88
- Offline
- Elite Member
-
Less
More
- Posts: 263
- Thank you received: 51
3 years 4 months ago #273569
by pippin88
Replied by pippin88 on topic Can the OPI5 be Configured to Run LCNC?
Is it really Realtime kernel?
Please Log in or Create an account to join the conversation.
- rodw
- Offline
- Platinum Member
-
Less
More
- Posts: 12170
- Thank you received: 4153
3 years 4 months ago #273570
by rodw
Replied by rodw on topic Can the OPI5 be Configured to Run LCNC?
I don't think so. MAybe somebody with more armbian experience might know. sudo apt install linux-image-rt-arm64 (If I typed that right)
Installs the RT kernel but it does not boot into it. Perhpas there are some ARM specific steps to follow.
Otherwise when you build hte kernel you need to select preempt_rt and patch it
Installs the RT kernel but it does not boot into it. Perhpas there are some ARM specific steps to follow.
Otherwise when you build hte kernel you need to select preempt_rt and patch it
Please Log in or Create an account to join the conversation.
Time to create page: 0.491 seconds