Configuring LinuxCNC with ethercat

More
29 Nov 2022 00:50 #257924 by mwc
Adding various $(info ...) statements to realtime.mk-
$(module): $(lcec-objs)
    $(info $$CC is $(CC))
    $(info $$lcec-objs is $(lcec-objs))
    $(info $$LIBDIR is $(LIBDIR))
    $(CC) -shared -o $@ $(lcec-objs) -Wl,-rpath,$(LIBDIR) -L$(LIBDIR) -llinuxcnchal -lethercat -lrt

I've figured out that the command that ultimately the problem line generates is -
gcc -shared -o @ lcec_main.o lcec_class_enc.o lcec_class_ax5.o lcec_generic.o lcec_ax5100.o lcec_ax5200.o lcec_el1xxx.o lcec_el1252.o lcec_el1859.o lcec_el2521.o lcec_el2xxx.o lcec_el2202.o lcec_el31x2.o lcec_el31x4.o lcec_el3255.o lcec_el40x1.o lcec_el40x2.o lcec_el40x8.o lcec_el41x2.o lcec_el41x4.o lcec_el5101.o lcec_el5151.o lcec_el5152.o lcec_el6900.o lcec_el1918_logic.o lcec_el1904.o lcec_el2904.o lcec_ax5805.o lcec_el7041_1000.o lcec_el70x1.o lcec_el7211.o lcec_el7342.o lcec_el7411.o lcec_el95xx.o lcec_em7004.o lcec_stmds5k.o lcec_deasda.o lcec_dems300.o lcec_omrg5.o lcec_ph3lm2rm.o -Wl,-rpath,/lib -L/lib -llinuxcnchal -lethercat -lrt

Which when run directly in a terminal, doesn't generate a separator error, but a list of No such file or directory errors-
/usr/bin/ld: cannot find lcec_class_enc.o: No such file or directory
/usr/bin/ld: cannot find lcec_class_ax5.o: No such file or directory
/usr/bin/ld: cannot find lcec_generic.o: No such file or directory
/usr/bin/ld: cannot find lcec_ax5100.o: No such file or directory
/usr/bin/ld: cannot find lcec_ax5200.o: No such file or directory
/usr/bin/ld: cannot find lcec_el1xxx.o: No such file or directory
/usr/bin/ld: cannot find lcec_el1252.o: No such file or directory
/usr/bin/ld: cannot find lcec_el1859.o: No such file or directory
/usr/bin/ld: cannot find lcec_el2521.o: No such file or directory
/usr/bin/ld: cannot find lcec_el2xxx.o: No such file or directory
/usr/bin/ld: cannot find lcec_el2202.o: No such file or directory
/usr/bin/ld: cannot find lcec_el31x2.o: No such file or directory
/usr/bin/ld: cannot find lcec_el31x4.o: No such file or directory
/usr/bin/ld: cannot find lcec_el3255.o: No such file or directory
/usr/bin/ld: cannot find lcec_el40x1.o: No such file or directory
/usr/bin/ld: cannot find lcec_el40x2.o: No such file or directory
/usr/bin/ld: cannot find lcec_el40x8.o: No such file or directory
/usr/bin/ld: cannot find lcec_el41x2.o: No such file or directory
/usr/bin/ld: cannot find lcec_el41x4.o: No such file or directory
/usr/bin/ld: cannot find lcec_el5101.o: No such file or directory
/usr/bin/ld: cannot find lcec_el5151.o: No such file or directory
/usr/bin/ld: cannot find lcec_el5152.o: No such file or directory
/usr/bin/ld: cannot find lcec_el6900.o: No such file or directory
/usr/bin/ld: cannot find lcec_el1918_logic.o: No such file or directory
/usr/bin/ld: cannot find lcec_el1904.o: No such file or directory
/usr/bin/ld: cannot find lcec_el2904.o: No such file or directory
/usr/bin/ld: cannot find lcec_ax5805.o: No such file or directory
/usr/bin/ld: cannot find lcec_el7041_1000.o: No such file or directory
/usr/bin/ld: cannot find lcec_el70x1.o: No such file or directory
/usr/bin/ld: cannot find lcec_el7211.o: No such file or directory
/usr/bin/ld: cannot find lcec_el7342.o: No such file or directory
/usr/bin/ld: cannot find lcec_el7411.o: No such file or directory
/usr/bin/ld: cannot find lcec_el95xx.o: No such file or directory
/usr/bin/ld: cannot find lcec_em7004.o: No such file or directory
/usr/bin/ld: cannot find lcec_stmds5k.o: No such file or directory
/usr/bin/ld: cannot find lcec_deasda.o: No such file or directory
/usr/bin/ld: cannot find lcec_dems300.o: No such file or directory
/usr/bin/ld: cannot find lcec_omrg5.o: No such file or directory
/usr/bin/ld: cannot find lcec_ph3lm2rm.o: No such file or directory
collect2: error: ld returned 1 exit status

And that's as far as I'm going for tonight.

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

More
29 Nov 2022 01:36 - 29 Nov 2022 01:38 #257931 by rodw
DId you
sudo make install

This command should copy the files to the correct directory
Last edit: 29 Nov 2022 01:38 by rodw.

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

More
29 Nov 2022 02:07 #257934 by mwc
I couldn't remember if I used sudo or not, but I've just re-ran the original realtime.mk, and I'm still getting the ecrt not found error.
Modified realtime.mk still won't compile

I have just been going back over the other threads, and the only thing that has varied from your install, is I never started with a Bookworm ISO.

I'm thinking I might download the ISO you suggested in another thread ( forum.linuxcnc.org/ethercat/47372-any-re...etup?start=10#257435 ), and start a fresh to see if that cures any of the issues I appear to be having.

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

More
29 Nov 2022 05:13 - 29 Nov 2022 05:17 #257941 by rodw
I have just installd Debian Bookwork aka Testing from an ISO I downloaded earlier in the month. Everythuing worked with a couple of exceptions.1. install the linuxcnc-uspace and linuxcnc-uspace-dev packages (dev is needed to get halcompile)
( sudo apt-get install linuxcnc-uspace linuxcnc-uspace-dev)
2. Make sure you edit the instructions to use Debian Testing after the keyring text.
3. Had to use the original realtime.mk file (which now works!)

I don't have any hardware here but when I followed the instructions to the end and the test I suggested worked perfectly



EDIT: This was on a Virtual Box VM on Windows.
Attachments:
Last edit: 29 Nov 2022 05:17 by rodw.

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

More
29 Nov 2022 05:34 #257942 by rodw
I've updated the instructions to alter the bit about realtime.mk and hide the different text  in a spoiler
The following user(s) said Thank You: tommylight

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

More
29 Nov 2022 18:48 #258011 by mwc
So I've reinstalled Bookworm using the ISO at this link -  Index of /cdimage/unofficial/non-free/cd-including-firmware/bookworm_di_alpha1+nonfree/amd64/iso-dvd (debian.org)
The one you linked to wouldn't recognise the NICs or graphics. I also tried a different non-free-firmware ISO, but again it didn't recognise the NICs or Graphics.

And I still have the same problem.
Original realtime.mk compiles without error, but getting the erct.... not found error.
Modified realtime.mk doesn't compile with the same separator error

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

More
29 Nov 2022 19:09 #258014 by mwc
Rod, I forgot to mention in the last post, that halcmd show pin lcec works. It's loading the loadrt lcec where things don't.

Would it be possible to see your config.mk?
I'm wondering if there's a path being detected wrong on my system, but both realtime.mks result in identical files -
COMP = /usr/bin/halcompile
MODINC = /usr/share/linuxcnc/Makefile.modinc
BUILDSYS = uspace
KERNELDIR = 
CC = gcc
RTAI = 
RTFLAGS = -Os -g -I. -I/build/linuxcnc-36cfOd/linuxcnc-2.9.0~pre0+git20221105.ffb6bda926/src/include -DUSPACE -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime
KERNELRELEASE = 
EXTRA_CFLAGS = -Os -g -I. -I/build/linuxcnc-36cfOd/linuxcnc-2.9.0~pre0+git20221105.ffb6bda926/src/include -DUSPACE -fno-fast-math -mieee-fp -fno-unsafe-math-optimizations -DRTAPI -D_GNU_SOURCE -Drealtime -D__MODULE__ -I/usr/include/linuxcnc -Wframe-larger-than=2560 -DSIM -fPIC
USE_RTLIBM = 
EMC2_HOME = /usr
RUN_IN_PLACE = no
RTLIBDIR = /usr/lib/linuxcnc/modules
LIBDIR = /lib
prefix = /usr

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

More
29 Nov 2022 22:11 #258034 by db1981
is the ethercat master running without errors on your computer?

What is the output of "ethercat master" and "ethercat slaves"

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

More
29 Nov 2022 22:29 #258037 by mwc
Ethercat appears to be running as expected.
master-
lcnc@lcnc:~$ ethercat master
Master0
  Phase: Idle
  Active: no
  Slaves: 3
  Ethernet devices:
    Main: 00:1e:06:45:04:f9 (attached)
      Link: UP
      Tx frames:   4851
      Tx bytes:    300660
      Rx frames:   4847
      Rx bytes:    300420
      Tx errors:   0
      Tx frame rate [1/s]:    123    125     61
      Tx rate [KByte/s]:      7.2    7.4    3.7
      Rx frame rate [1/s]:    123    125     61
      Rx rate [KByte/s]:      7.2    7.4    3.7
    Common:
      Tx frames:   4851
      Tx bytes:    300660
      Rx frames:   4847
      Rx bytes:    300420
      Lost frames: 4
      Tx frame rate [1/s]:    123    125     61
      Tx rate [KByte/s]:      7.2    7.4    3.7
      Rx frame rate [1/s]:    123    125     61
      Rx rate [KByte/s]:      7.2    7.4    3.7
      Loss rate [1/s]:          0      0      0
      Frame loss [%]:         0.0    0.0    0.1
  Distributed clocks:
    Reference clock:   Slave 0
    DC reference time: 0
    Application time:  0
slaves-
0  0:0  PREOP  +  CL3-E57H
1  0:1  PREOP  +  CL3-E57H
2  0:2  PREOP  +  CL3-E57H

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

More
29 Nov 2022 22:58 #258042 by db1981
strange, try in linuxcnc-ethercat :

-sudo make clean
-sudo make configure
-sudo make install

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

Time to create page: 0.120 seconds
Powered by Kunena Forum