My notes on compiling LiteX-CNC on linuxCNC
18 Sep 2022 13:33 - 01 Oct 2022 16:18 #252264
by DePrutser
SOLVED My notes on compiling LiteX-CNC on linuxCNC was created by DePrutser
Hi All,
I am trying to compile LiteX-CNC [1] for a Colorlight 5A-75E [2] on LinuxCNC.
In the next series of reply's I'll document my findings.
[1] github.com/Peter-van-Tol/LiteX-CNC
[2] nl.aliexpress.com/item/1005003349205208....gatewayAdapt=glo2nld
Cheers,
Cedric
I am trying to compile LiteX-CNC [1] for a Colorlight 5A-75E [2] on LinuxCNC.
In the next series of reply's I'll document my findings.
[1] github.com/Peter-van-Tol/LiteX-CNC
[2] nl.aliexpress.com/item/1005003349205208....gatewayAdapt=glo2nld
Cheers,
Cedric
Last edit: 01 Oct 2022 16:18 by DePrutser. Reason: It's solved
Please Log in or Create an account to join the conversation.
18 Sep 2022 17:52 #252276
by DePrutser
Replied by DePrutser on topic My notes on compiling LiteX-CNC on linuxCNC
1) Install linuxCNC from this ISO: www.linuxcnc.org/iso/linuxcnc-2.8.2-buster.iso
2) Install packages:
# apt-get update
# apt-get install libjson-c-dev
# apt-get install git
# apt-get install build-essential
3) Get the source
$ git clone github.com/Peter-van-Tol/LiteX-CNC.git
4) replace halcompile
# whereis halcompile
halcompile: /usr/bin/halcompile /usr/share/man/man1/halcompile.1.gz
# cd /home/cedric/LiteX-CNC
# cp halcompile.py /usr/bin/halcompile
5) build LiteX-CNC
# cd /home/cedric/LiteX-CNC/driver/
# halcompile --install litexcnc.c litexcnc_eth.c litexcnc_debug.c
6) load the driver
# loadrt litexcnc
-bash: loadrt: command not found
Hmmm... that does not work yet.
2) Install packages:
# apt-get update
# apt-get install libjson-c-dev
# apt-get install git
# apt-get install build-essential
3) Get the source
$ git clone github.com/Peter-van-Tol/LiteX-CNC.git
4) replace halcompile
# whereis halcompile
halcompile: /usr/bin/halcompile /usr/share/man/man1/halcompile.1.gz
# cd /home/cedric/LiteX-CNC
# cp halcompile.py /usr/bin/halcompile
5) build LiteX-CNC
# cd /home/cedric/LiteX-CNC/driver/
# halcompile --install litexcnc.c litexcnc_eth.c litexcnc_debug.c
6) load the driver
# loadrt litexcnc
-bash: loadrt: command not found
Hmmm... that does not work yet.
Please Log in or Create an account to join the conversation.
- tommylight
- Online
- Moderator
Less
More
- Posts: 19196
- Thank you received: 6434
18 Sep 2022 18:07 #252279
by tommylight
Replied by tommylight on topic My notes on compiling LiteX-CNC on linuxCNC
Pretty sure you need to
halrun
before loading anything with loadrt.
halrun
before loading anything with loadrt.
Please Log in or Create an account to join the conversation.
18 Sep 2022 18:20 #252280
by DePrutser
Replied by DePrutser on topic My notes on compiling LiteX-CNC on linuxCNC
I don't think loadrt exists on my system:
# whereis loadrt
loadrt:
root@mill:/home/cedric/LiteX-CNC/driver# cd /
root@mill:/# find -iname loadrt
root@mill:/#
# whereis loadrt
loadrt:
root@mill:/home/cedric/LiteX-CNC/driver# cd /
root@mill:/# find -iname loadrt
root@mill:/#
Please Log in or Create an account to join the conversation.
- tommylight
- Online
- Moderator
Less
More
- Posts: 19196
- Thank you received: 6434
18 Sep 2022 19:20 #252287
by tommylight
Replied by tommylight on topic My notes on compiling LiteX-CNC on linuxCNC
No double posting.
forum.linuxcnc.org/38-general-linuxcnc-q...-2-8-2-buster#252278
forum.linuxcnc.org/38-general-linuxcnc-q...-2-8-2-buster#252278
Please Log in or Create an account to join the conversation.
19 Sep 2022 07:30 #252318
by TOLP2
Then within the running hal environment you can do
Side note: While halrun is perfect to check whether the firmware is correctly installed and some basic tasks can be done (i.e. GPIO, PWM and presumably encoder), the stepgen is not designed to work without the motion planner of LinuxCNC.
Replied by TOLP2 on topic My notes on compiling LiteX-CNC on linuxCNC
First run halrun from the shell to start the real-time:I don't think loadrt exists on my system:
# whereis loadrt
loadrt:
root@mill:/home/cedric/LiteX-CNC/driver# cd /
root@mill:/# find -iname loadrt
root@mill:/#
# halrun
Then within the running hal environment you can do
loadrt litexcnc
Side note: While halrun is perfect to check whether the firmware is correctly installed and some basic tasks can be done (i.e. GPIO, PWM and presumably encoder), the stepgen is not designed to work without the motion planner of LinuxCNC.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
19 Sep 2022 16:48 #252354
by DePrutser
Replied by DePrutser on topic My notes on compiling LiteX-CNC on linuxCNC
It does a little more this time:
root@mill:/# halrun
halcmd: loadrt litexcnc
Refusing to run as root without fallback UID specified
To run under a debugger with I/O, use e.g.,
sudo env RTAPI_UID=`id -u` RTAPI_FIFO_PATH=$HOME/.rtapi_fifo gdb /usr/bin/rtapi_app
<stdin>:1: waitpid failed /usr/bin/rtapi_app litexcnc
<stdin>:1: /usr/bin/rtapi_app exited without becoming ready
<stdin>:1: insmod for litexcnc failed, returned -1
halcmd: quit
Refusing to run as root without fallback UID specified
To run under a debugger with I/O, use e.g.,
sudo env RTAPI_UID=`id -u` RTAPI_FIFO_PATH=$HOME/.rtapi_fifo gdb /usr/bin/rtapi_app
root@mill:/#
I guess I have a manual to read before proceeding further.
root@mill:/# halrun
halcmd: loadrt litexcnc
Refusing to run as root without fallback UID specified
To run under a debugger with I/O, use e.g.,
sudo env RTAPI_UID=`id -u` RTAPI_FIFO_PATH=$HOME/.rtapi_fifo gdb /usr/bin/rtapi_app
<stdin>:1: waitpid failed /usr/bin/rtapi_app litexcnc
<stdin>:1: /usr/bin/rtapi_app exited without becoming ready
<stdin>:1: insmod for litexcnc failed, returned -1
halcmd: quit
Refusing to run as root without fallback UID specified
To run under a debugger with I/O, use e.g.,
sudo env RTAPI_UID=`id -u` RTAPI_FIFO_PATH=$HOME/.rtapi_fifo gdb /usr/bin/rtapi_app
root@mill:/#
I guess I have a manual to read before proceeding further.
Please Log in or Create an account to join the conversation.
19 Sep 2022 16:56 #252355
by TOLP2
Replied by TOLP2 on topic My notes on compiling LiteX-CNC on linuxCNC
Problem is, your logged in as root. Create a user and login to that user and try again.
Please Log in or Create an account to join the conversation.
20 Sep 2022 05:52 #252375
by DePrutser
Replied by DePrutser on topic My notes on compiling LiteX-CNC on linuxCNC
Thanks, that worked:
cedric@mill:~$ halrun
halcmd: loadrt litexcnc
Note: Using POSIX realtime
litexcnc: Loading Litex CNC driver version 1.0.0
halcmd: exit
litexcnc: LitexCNC driver unloaded
Note: Using POSIX realtime
cedric@mill:~$
cedric@mill:~$ halrun
halcmd: loadrt litexcnc
Note: Using POSIX realtime
litexcnc: Loading Litex CNC driver version 1.0.0
halcmd: exit
litexcnc: LitexCNC driver unloaded
Note: Using POSIX realtime
cedric@mill:~$
Please Log in or Create an account to join the conversation.
21 Sep 2022 02:28 - 21 Sep 2022 02:30 #252455
by DePrutser
Replied by DePrutser on topic My notes on compiling LiteX-CNC on linuxCNC
I tried to compile the gateware for the FPGA, but I got this error:
sudo apt-get install wget
sudo apt-get install python3-pip
wget raw.githubusercontent.com/enjoy-digital/...aster/litex_setup.py
pip3 install --user meson ninja
python3 litex_setup.py --init --install --config=standard --gcc=riscv
wget github.com/YosysHQ/oss-cad-suite-build/r...nux-x64-20220920.tgz
tar -xvf oss-cad-suite-linux-x64-20220920.tgz
mkdir -p ~/bin
ln -s ~/LiteX/oss-cad-suite/bin/* ~/bin/
#start a new bash, so ~/bin is added to the PATH
bash --login
echo $PATH
/home/cedric/.local/bin:/home/cedric/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
#return to the LiteX-CNC repository
cd ~/LiteX-CNC/
python -m firmware examples/5a-75e.json
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "firmware/__init__.py", line 20, in <module>
from .soc import LitexCNC_Firmware
File "firmware/soc.py", line 32
baseclass: Type = Field(
^
SyntaxError: invalid syntax
sudo apt-get install wget
sudo apt-get install python3-pip
wget raw.githubusercontent.com/enjoy-digital/...aster/litex_setup.py
pip3 install --user meson ninja
python3 litex_setup.py --init --install --config=standard --gcc=riscv
wget github.com/YosysHQ/oss-cad-suite-build/r...nux-x64-20220920.tgz
tar -xvf oss-cad-suite-linux-x64-20220920.tgz
mkdir -p ~/bin
ln -s ~/LiteX/oss-cad-suite/bin/* ~/bin/
#start a new bash, so ~/bin is added to the PATH
bash --login
echo $PATH
/home/cedric/.local/bin:/home/cedric/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
#return to the LiteX-CNC repository
cd ~/LiteX-CNC/
python -m firmware examples/5a-75e.json
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
mod_name, _Error)
File "/usr/lib/python2.7/runpy.py", line 111, in _get_module_details
__import__(mod_name) # Do not catch exceptions initializing package
File "firmware/__init__.py", line 20, in <module>
from .soc import LitexCNC_Firmware
File "firmware/soc.py", line 32
baseclass: Type = Field(
^
SyntaxError: invalid syntax
Last edit: 21 Sep 2022 02:30 by DePrutser. Reason: for got output of a command
Please Log in or Create an account to join the conversation.
Time to create page: 0.088 seconds