ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
- juergenmoser
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 10
09 Jan 2023 08:47 #261339
by juergenmoser
Replied by juergenmoser on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
@deroj I have downloaded the normal Buster image from the linuxcnc website 2.8.4 Buster (ISO) i can share you all the commands to install it - but with no warranties!
i have to check everything again and maybe make a installl script for this.. The only thing is i cannot make the bitfile in 2.8.4 - i make the bitfile in min21 ( In 2.8.4 I always get an error that yosys is missing but I already installed it!(to $PATH)
Please Log in or Create an account to join the conversation.
09 Jan 2023 10:08 #261342
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
In the output there are two problems:so i found the original halcompile and renamed it to halcompile1.
then i run the litexcnc install_driver again with no changes.
i attached the terminal output. maybe you can find my mistakes?
thank you
- it is compiled with warnings enabled. This gives insight that on 64-bit systems the formatting of the data-types in the print-statements is not correct. This warnings still lead to a driver which should work. I created an issue for this and found a solution for this problem. Apparently, warnings were not on my system or my development OS is 32-bit as well (never checked that).
- The second problem is a linking problem which has been experienced by multiple users. This occurs when LinuxCNC 2.9 is used, cause is yet to be determined. I also created an issue for this.
Please Log in or Create an account to join the conversation.
- juergenmoser
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 10
09 Jan 2023 13:37 - 09 Jan 2023 13:40 #261351
by juergenmoser
[/code][/code]
[/code][/code][/code]
[/code][/code][/code]
Replied by juergenmoser on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
@ TOLP2 I've now tried the Example with the STEPGEN.
I copied the example from Read The Docs in my HAL File.
I got an error by starting: pos2vel-cmd :
[code]
[code]net pos2vel.0.velocity-cmd => Juergen.stepgen.00.velocity-cmd
[code]/my-mill.hal:62: Signal name 'pos2vel.0.velocity-cmd' must not be the same as a pin. Did you omit the signal name?
[code]so i changed in the Hal:
[code][code][code]net xpos-fp pos2vel.0.velocity-cmd => Juergen.stepgen.00.velocity-cmd
[/code]
[code][code]Is that right to put in after net the xpos-fp? I have to try it with a stepper... So for Now Lcnc starts and i get signals to the pos -cmd
Last edit: 09 Jan 2023 13:40 by juergenmoser.
The following user(s) said Thank You: TOLP2
Please Log in or Create an account to join the conversation.
09 Jan 2023 15:27 #261356
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
Thanks for your finding. I modified the documentation, the line should read:
NOTE: I used xvel_cmd as signal name, as this is the velocity command. It is an unique signal, if you had appointed an existing signal to this line, please rename it.
net xvel_cmd pos2vel.0.velocity-cmd => [LITEXCNC](NAME).stepgen.00.velocity-cmd
NOTE: I used xvel_cmd as signal name, as this is the velocity command. It is an unique signal, if you had appointed an existing signal to this line, please rename it.
The following user(s) said Thank You: juergenmoser
Please Log in or Create an account to join the conversation.
- juergenmoser
- Offline
- Junior Member
Less
More
- Posts: 26
- Thank you received: 10
09 Jan 2023 15:32 #261357
by juergenmoser
Replied by juergenmoser on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
Okay Thank you. And for the other axes I take yvel and zvel?
Please Log in or Create an account to join the conversation.
09 Jan 2023 21:54 - 10 Jan 2023 12:39 #261386
by TOLP2
@deroj: I changed a small bit in my modified halcompile to show the errors (added print("EXTRA_CFLAGS += -Wall", file=f) to line 1117). Now I can reproduce the warnings you got. Going to solve these warnings, as I believe in clean code is better code. But, how did you get those warnings on your system, did you change halcompile as well or have a certain setting somewhere? Otherwise this is also a difference between the 2.8-family and 2.9.
Edit:
I solved now all compiler warnings in the code in the branch 7-resolve-compiler-warnings. I will leave the option -Wall as default to see any new warnings. In my opinion the driver should compile without any warning.
I also started on testing why the code fails to link on LinuxCNC 2.9. Created a new development container with Debian Bullseye and LinuxCNC 2.9.0-pre1, et voila, I can reproduce the error:
Now have to solve this one...
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
Would recommend yvel_cmd and zvel_cmd, but any name will do as long as they are unique.Okay Thank you. And for the other axes I take yvel and zvel?
@deroj: I changed a small bit in my modified halcompile to show the errors (added print("EXTRA_CFLAGS += -Wall", file=f) to line 1117). Now I can reproduce the warnings you got. Going to solve these warnings, as I believe in clean code is better code. But, how did you get those warnings on your system, did you change halcompile as well or have a certain setting somewhere? Otherwise this is also a difference between the 2.8-family and 2.9.
Edit:
I solved now all compiler warnings in the code in the branch 7-resolve-compiler-warnings. I will leave the option -Wall as default to see any new warnings. In my opinion the driver should compile without any warning.
I also started on testing why the code fails to link on LinuxCNC 2.9. Created a new development container with Debian Bullseye and LinuxCNC 2.9.0-pre1, et voila, I can reproduce the error:
halcmd: loadrt litexcnc
Note: Using POSIX non-realtime
litexcnc: dlopen: /opt/linuxcnc/rtlib/litexcnc.so: undefined symbol: json_object_array_length
<stdin>:1: waitpid failed /opt/linuxcnc/bin/rtapi_app litexcnc
<stdin>:1: /opt/linuxcnc/bin/rtapi_app exited without becoming ready
<stdin>:1: insmod for litexcnc failed, returned -1
halcmd: Note: Using POSIX non-realtime
Now have to solve this one...
Last edit: 10 Jan 2023 12:39 by TOLP2.
Please Log in or Create an account to join the conversation.
11 Jan 2023 16:53 #261590
by deroj
Replied by deroj on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
@TOLP2Not, as I know...I just installed Linux Mint 21, then the debs with preempt kernel and linuxcnc, and then followed your python install instructions
But, how did you get those warnings on your system, did you change halcompile as well or have a certain setting somewhere?
Please Log in or Create an account to join the conversation.
12 Jan 2023 11:19 - 13 Jan 2023 23:06 #261679
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
The warnings are solved now. The mostly stem from difference between 32-bit systems and 64bit and the formatting of numbers. Now I use inttypes to format the numbers, which solves the warnings. There were some other warnings as well, those have been solved at the same time.
For compiling it in LinuxCNC 2.9: something has changed in the linking; there is a notion of it in the CHANGELOG. However, I cannot find a way to successfully link the external library after this change. I decided to solve this by changing libjson-c to cJSON. The benefit of using cJSON is that this is a small library which can ben inlined in the driver. This requires a re-write of the driver on the configuration part. I rewrote the driver litexcnc_eth as a prove of concept and it works really well.
The major work is now in rewriting the modules and the main driver.
Edit:
For the brave: I've committed the re-written code to GitLab. Didn't have the chance to test the code fully, but preliminary tests show that all pins are correctly created from the JSON. Took also the chance to refactor the initialization for the modules to get them all in the same format. The one thing I'm not confident about yet is the calculation of the CRC fingerprint.
So, if you are feeling adventurous, you can try it. Think I can do some testing myself during the weekend.
For compiling it in LinuxCNC 2.9: something has changed in the linking; there is a notion of it in the CHANGELOG. However, I cannot find a way to successfully link the external library after this change. I decided to solve this by changing libjson-c to cJSON. The benefit of using cJSON is that this is a small library which can ben inlined in the driver. This requires a re-write of the driver on the configuration part. I rewrote the driver litexcnc_eth as a prove of concept and it works really well.
The major work is now in rewriting the modules and the main driver.
Edit:
For the brave: I've committed the re-written code to GitLab. Didn't have the chance to test the code fully, but preliminary tests show that all pins are correctly created from the JSON. Took also the chance to refactor the initialization for the modules to get them all in the same format. The one thing I'm not confident about yet is the calculation of the CRC fingerprint.
So, if you are feeling adventurous, you can try it. Think I can do some testing myself during the weekend.
Last edit: 13 Jan 2023 23:06 by TOLP2.
Please Log in or Create an account to join the conversation.
15 Jan 2023 16:18 #262047
by DePrutser
Replied by DePrutser on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
I've tested some more, but I cannot get it to work on my linuxCNC installation yet. I have replaced the first part of the links by the string "https--" to keep the forum software happy
I've created a new user to my LinuxCNC machine, to test with a fresh start:
root@mill:~# useradd -m testuser
root@mill:~# passwd testuser
New password:
Retype new password:
passwd: password updated successfully
root@mill:~# su testuser
$ bash --login
testuser@mill:/root$ cd
testuser@mill:~$
Now let's try the commands:
testuser@mill:~$ pip install --extra-index-url https--test.pypi.org/simple/ litexcnc[cli]
bash: pip: command not found
Pip was installed, but it is known as pip3, not just pip
root@mill:~# apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (18.1-5).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
testuser@mill:~$ pip3 install --extra-index-url https--test.pypi.org/simple/ litexcnc[cli]
Looking in indexes: https--pypi.org/simple, https--test.pypi.org/simple/
Collecting litexcnc[cli]
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https--pypi.org/simple/litexcnc/
Try again with python2
# apt-get install python-pip
$ pip install --extra-index-url https--test.pypi.org/simple/ litexcnc[cli]
Looking in indexes: https--pypi.org/simple, https--test.pypi.org/simple/
Collecting litexcnc[cli]
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https--pypi.org/simple/litexcnc/
The url https--test.pypi.org/simple/litexcnc/ is valid, but pip doesn't seem to use it.
testuser@mill:~$ pip install -i https--test.pypi.org/simple/ litexcnc[cli]
Looking in indexes: https--test.pypi.org/simple/
Collecting litexcnc[cli]
Could not find a version that satisfies the requirement litexcnc[cli] (from versions: )
No matching distribution found for litexcnc[cli]
Pip3 goes a bit further:
testuser@mill:~$ pip3 install -i https--test.pypi.org/simple/ litexcnc[cli]
Looking in indexes: https--test.pypi.org/simple/
Collecting litexcnc[cli]
Downloading https--test-files.pythonhosted.org/packages/30/26/efc54ae0864aa303387ac22bfc985fb9f7235fea4e63ac462d0439528a54/litexcnc-0.9.0a4-py3-none-any.whl (146kB)
100% |████████████████████████████████| 153kB 3.5MB/s
Collecting packaging<22.0,>=21.3 (from litexcnc[cli])
Could not find a version that satisfies the requirement packaging<22.0,>=21.3 (from litexcnc[cli]) (from versions: 16.7)
No matching distribution found for packaging<22.0,>=21.3 (from litexcnc[cli])
I've created a new user to my LinuxCNC machine, to test with a fresh start:
root@mill:~# useradd -m testuser
root@mill:~# passwd testuser
New password:
Retype new password:
passwd: password updated successfully
root@mill:~# su testuser
$ bash --login
testuser@mill:/root$ cd
testuser@mill:~$
Now let's try the commands:
testuser@mill:~$ pip install --extra-index-url https--test.pypi.org/simple/ litexcnc[cli]
bash: pip: command not found
Pip was installed, but it is known as pip3, not just pip
root@mill:~# apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (18.1-5).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
testuser@mill:~$ pip3 install --extra-index-url https--test.pypi.org/simple/ litexcnc[cli]
Looking in indexes: https--pypi.org/simple, https--test.pypi.org/simple/
Collecting litexcnc[cli]
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https--pypi.org/simple/litexcnc/
Try again with python2
# apt-get install python-pip
$ pip install --extra-index-url https--test.pypi.org/simple/ litexcnc[cli]
Looking in indexes: https--pypi.org/simple, https--test.pypi.org/simple/
Collecting litexcnc[cli]
Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https--pypi.org/simple/litexcnc/
The url https--test.pypi.org/simple/litexcnc/ is valid, but pip doesn't seem to use it.
testuser@mill:~$ pip install -i https--test.pypi.org/simple/ litexcnc[cli]
Looking in indexes: https--test.pypi.org/simple/
Collecting litexcnc[cli]
Could not find a version that satisfies the requirement litexcnc[cli] (from versions: )
No matching distribution found for litexcnc[cli]
Pip3 goes a bit further:
testuser@mill:~$ pip3 install -i https--test.pypi.org/simple/ litexcnc[cli]
Looking in indexes: https--test.pypi.org/simple/
Collecting litexcnc[cli]
Downloading https--test-files.pythonhosted.org/packages/30/26/efc54ae0864aa303387ac22bfc985fb9f7235fea4e63ac462d0439528a54/litexcnc-0.9.0a4-py3-none-any.whl (146kB)
100% |████████████████████████████████| 153kB 3.5MB/s
Collecting packaging<22.0,>=21.3 (from litexcnc[cli])
Could not find a version that satisfies the requirement packaging<22.0,>=21.3 (from litexcnc[cli]) (from versions: 16.7)
No matching distribution found for packaging<22.0,>=21.3 (from litexcnc[cli])
Please Log in or Create an account to join the conversation.
15 Jan 2023 21:19 #262068
by TOLP2
Replied by TOLP2 on topic ColorCNC Colorlight 5A-75E/5A-75B as FPGA controller board
@DePrutser: Thanks for trying! Could you please provide me with:
Above won't solve your error, I've to look into that error based on the version you use.
Update on Linux 2.9:
The complete driver has been re-written and I'm able to connect to the card using halrun. I'm going to merge the branches tomorrow and do another pre-release.
In the update is also a small bug-fix for Python 3.7 in building the firmware. Python 3.7 does support Literal, so it would lead to strange errors. The error was in LitexCNC, however the error was pointing to Litex. Anyway, this has been fixed by an added depency 'typing_extensions' and some error catching at start up.
5A-75E Version 8.2
I spotted a new FPGA in the wild. I received a version 8.2 of the 5A-75E. It took me some time to get it talking to LinuxCNC, but that was my fault. If you receive such an FPGA, you can use the firmware for the version 6.0 as the pin-out seems to be the same. The only difference seems to be a higher speed grade for the FPGA.
- your Linux distro type and version;
- your LinuxCNC version
- your python version (i.e. python --version)
sudo env PATH="$PATH" litexcnc build_firmware ...
Above won't solve your error, I've to look into that error based on the version you use.
Update on Linux 2.9:
The complete driver has been re-written and I'm able to connect to the card using halrun. I'm going to merge the branches tomorrow and do another pre-release.
In the update is also a small bug-fix for Python 3.7 in building the firmware. Python 3.7 does support Literal, so it would lead to strange errors. The error was in LitexCNC, however the error was pointing to Litex. Anyway, this has been fixed by an added depency 'typing_extensions' and some error catching at start up.
5A-75E Version 8.2
I spotted a new FPGA in the wild. I received a version 8.2 of the 5A-75E. It took me some time to get it talking to LinuxCNC, but that was my fault. If you receive such an FPGA, you can use the firmware for the version 6.0 as the pin-out seems to be the same. The only difference seems to be a higher speed grade for the FPGA.
The following user(s) said Thank You: Pro_El
Please Log in or Create an account to join the conversation.
Time to create page: 0.257 seconds