Closed jjrbfi closed 3 years ago
ok just a moment
I changed the runtest file at line 4. My fault. Now in terminal do a : /opt/hal-core/scripts/halrun -U Then try it again.
More less same:
Note: Using POSIX realtime
rtapi_shmem_new failed due to shmget(key=0xacb572c7): Invalid argument
lcec_conf: ERROR: couldn't allocate user/RT shared memory
lcec: dlopen: /opt/hal-core/rtlib/lcec.so: undefined symbol: lcec_el7031_init
<commandline>:0: waitpid failed /opt/hal-core/bin/rtapi_app lcec
<commandline>:0: /opt/hal-core/bin/rtapi_app exited without becoming ready
<commandline>:0: insmod for lcec failed, returned -1
./runtest: line 15: =: No such file or directory
./runtest: line 16: =: No such file or directory
./runtest: line 17: =: No such file or directory
HAL: ERROR: function 'lcec.read-all' not found
<commandline>:0: addf failed
HAL: ERROR: function 'lcec.write-all' not found
<commandline>:0: addf failed
I have to take a close look.
Here is the actual runtest file:
#!/usr/bin/bash
# Startup hal-core
cd /opt/hal-core/scripts/ && . ./rip-environment
cd /opt/hal-core/bin
halcmd stop
halcmd loadrt threads name1=base-thread fp1=0 period1=300000 name2=servo-thread period2=1000000
# Unix command to load the ethercat .xml config
/opt/hal-core/rtlib/./lcec_conf /opt/hal-core/rtlib/ethercat-conf.xml &
halcmd loadrt lcec
halcmd net ec-slaves-responding <= lcec.slaves-responding
halcmd net ec-link-up <= lcec.link-up
halcmd net ec-all-op <= lcec.all-op
halcmd addf lcec.read-all servo-thread
halcmd addf lcec.write-all servo-thread
halcmd start
halcmd show
# To clean the hal environment :
# $ /opt/hal-core$ /opt/linuxcnc/scripts/halrun -U
I will try to do again all from scratch and removing all old .so files. But I think you remove those few commits before.
I see you apptime period is different then base thread. Try to match it.
lcec_el7031_init I will check if this one is compiled within the lcec.so command..
Yes I got same error right now
The 7031 It is not inlcuded here : https://github.com/grotius-cnc/hal-core/blob/main/src/hal/components/ethercat/make Can you include it, and recompile.
Looks like is located just in those files:
Binary file lcec_main.o matches
lcec_el70x1.h:int lcec_el7031_init(int comp_id, struct lcec_slave *slave, ec_pdo_entry_reg_t *pdo_entry_regs);
Binary file lcec.so matches
lcec_el70x1.c:int lcec_el7031_init(int comp_id, struct lcec_slave *slave, ec_pdo_entry_reg_t *pdo_entry_regs) {
lcec_main.c: { lcecSlaveTypeEL7031, LCEC_EL70x1_VID, LCEC_EL7031_PID, LCEC_EL70x1_PDOS, lcec_el7031_init},
I have to go. I will continue tomorrow.
Thanks again for all! And great work you have made. :)
I can't remember, but was the 7031 already present in the source? or did you add it?
Ok. bybye see you !! Thanks.
Hi, just a tip. Start with only the buscoupler to test if your ethercat is working, then add the first slave in the xml etc. It is possible that your modified driver has a issue. To track that down. You could start with the original ethercat source code. If that works, replace it with the edited code etc.
Good luck !
Hello, I just come to start here again. I couldn't yesterday. I will check the differences between your ethercat Drivers fork and the original once to test it.
Thanks!
Regards :)
All working after added new drivers in make file. Already pushed all changes!
Thanks!
When running ./runtest from ethercat directory after doing make and changing the ethercat-conf.xml to my actual configuration, I got:
My ethercat-conf.conf