LitexCNC: firmware and driver for 5A-75B and 5A-75E

More
2 years 9 months ago #290626 by TOLP2
Can you post the error files, so I have some guidance what is missing.

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

More
2 years 9 months ago #290643 by uba100
First I tried "litexcnc --help" as a test. I got the error message "litexcnc command not found". I then added the line: "export PATH=$PATH:~/.local/bin/" to my bashrc. Now "litexcnc--help" worked.
So I tried to compile one of the examples:
"itexcnc build_firmware "/home/cnc/Downloads/5a-75b_v8.0_i12o14p6s6e6.json" --build"
Unfortunately, this did not work :
".....
OSError: Unable to find Yosys/Nextpnr toolchain, please:
- Add Yosys/Nextpnr toolchain to your $PATH."
So I extended the line in my bashrc to:
export PATH=$PATH:~/.local/bin/:~/toolchain/oss-cad-suite/libexec/
Now I got the following error message in the output, among others:
".....
INFO:SoC:
yosys: error while loading shared libraries: libffi.so.7: cannot open shared object file: No such file or directory
...."
Now I have added the following line to my bashrc:
export LD_LIBRARY_PATH=~/toolchain/oss-cad-suite/lib/:$LD_LIBRARY_PATH

to explicitly refer to the "libffi.so.7" located in this directory.
Since then I only get the following messages:
/home/cnc/.local/bin/python3: /home/cnc/toolchain/oss-cad-suite/lib/libm.so.6: version `GLIBC_2.35' not found (required by /home/cnc/.local/bin/python3)
/home/cnc/.local/bin/python3: /home/cnc/toolchain/oss-cad-suite/lib/libc.so.6: version `GLIBC_2.33' not found (required by /home/cnc/.local/bin/python3)
/home/cnc/.local/bin/python3: /home/cnc/toolchain/oss-cad-suite/lib/libc.so.6: version `GLIBC_2.32' not found (required by /home/cnc/.local/bin/python3)
/home/cnc/.local/bin/python3: /home/cnc/toolchain/oss-cad-suite/lib/libc.so.6: version `GLIBC_2.34' not found (required by /home/cnc/.local/bin/python3)

Now Chat GBT doesn't know what to do :)
The following user(s) said Thank You: TOLP2

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

More
2 years 9 months ago - 2 years 9 months ago #290742 by TOLP2
I can confirm that on my RPi4 this behavior does also occur with the latest image. The steps were modified from an installation using Raspbian + LinuxCNC with RTAI. So there is a difference between Rapsbian and the base-image used by LinuxCNC.

Tonight I have more time to look into this issue and will modify the manual when I find a solution. Things that are an issue now:
  • the PATH-variable is not set when installing;
  • therefore litexcnc cannot be found after a restart;
  • therefore also the toolchain cannot be found after a restart.

I'm not sure whether the missing shared library can also be attributed to this problem. It might got broken during your trying to fix the problem. IT is not Yosys missing GLIBC, by Python. So by changing LD_LIBRARY_PATH something got broken, because Python does not know where to look anymore....

Edit:
I created an issue on GitHub:  github.com/Peter-van-Tol/LiteX-CNC/issues/74

Progress on solving this issue will be logged on GitHub. When the issue is resolved, I will give a heads up in this topic. Thank you for reporting this issue.
Last edit: 2 years 9 months ago by TOLP2.
The following user(s) said Thank You: tommylight

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

More
2 years 9 months ago - 2 years 9 months ago #290789 by TOLP2
The problem has been identified. When running bash from the desktop, the file .profile is not loaded. This file contains the settings for PATH. Because it is not loaded, the litexcnc and the toolchain cannot be found. I tested with SSH, so therefore I didn't detect this error before.

As a temporary fix, one can add the following lines to ~/.bashrc:
Code:
# set PATH so it includes user's private bin if it exists if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi # set PATH so it includes oss-cad-suite if [ -d "/home/cnc/toolchain/oss-cad-suite/bin" ] ; then PATH="/home/cnc/toolchain/oss-cad-suite/bin:$PATH" fi

After restarting the terminal it works. 

NOTE: the variable LD_LIBRARY_PATH should not be changed.. When changed, it should be changed back to the original.
Last edit: 2 years 9 months ago by TOLP2.

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

More
2 years 9 months ago #290803 by TOLP2
The problem has been resolved in version 1.2.1, which has been released on pypi.org. Also, the documentation has been updated.

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

More
2 years 9 months ago #290809 by uba100
Thank you very much for your help.
Now it seems to work.
To be on the safe side, I reinstalled the image on the SD card and followed all the steps as described in the documentation here
litex-cnc.readthedocs.io/en/latest/raspberrypi.html
described here.
After reading these lines here:
# set PATH so it includes oss-cad-suite
if [ -d "/home/cnc/toolchain/oss-cad-suite/bin" ] ; then
PATH="/home/cnc/toolchain/oss-cad-suite/bin:$PATH"
fi
in my /.bashrc, the compilation of the JSON file seems to work.
I do get the error message at the end:

ERROR: Cell 'watchdog0$tr_io' cannot be bound to bel 'X0/Y44/PIOD' since it is already bound to cell 'gpio_out0$tr_io'
0 warnings, 1 error
Traceback (most recent call last):
File "/home/cnc/.local/bin/litexcnc", line 8, in <module>
sys.exit(cli())
^^^^^
File "/home/cnc/.local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cnc/.local/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/cnc/.local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cnc/.local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cnc/.local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cnc/.local/lib/python3.11/site-packages/litexcnc/cli/build_firmware.py", line 58, in cli
builder.build(run=build)
File "/home/cnc/toolchain/litex/litex/litex/soc/integration/builder.py", line 350, in build
vns = self.soc.build(build_dir=self.gateware_dir, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cnc/toolchain/litex/litex/litex/soc/integration/soc.py", line 1205, in build
return self.platform.build(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cnc/toolchain/litex/litex/litex/build/lattice/platform.py", line 43, in build
return self.toolchain.build(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cnc/toolchain/litex/litex/litex/build/lattice/trellis.py", line 236, in build
_run_script(script)
File "/home/cnc/toolchain/litex/litex/litex/build/lattice/trellis.py", line 174, in _run_script
raise OSError("Error occured during Yosys/Nextpnr's script execution.")
OSError: Error occured during Yosys/Nextpnr's script execution.

But this seems to me to be an error in the example file 5a-75b_v8.0_i12o14p6s6e6.json.
The following user(s) said Thank You: TOLP2

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

Moderators: PCW, jmelson
Time to create page: 0.077 seconds
Powered by Kunena Forum