Ethercat build from source - full instructions

More
23 Nov 2023 12:32 #286326 by Sakhalin_Cat
Once again I greet you.
Tell me which network card to buy to minimize freezing of the system when the ezerkat driver is running in the "generic" mode?
There are probably chips on modern network cards that are 100% compatible with the "generic" ethercat driver and that do not cause bugs with short-term freezing of the system?

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

More
26 Nov 2023 17:10 #286561 by foxington
I had very similar problem with freezing of ethercat.... 

I have build in card for ethernet and networking e1000e and second pci stuff with 8139 chip set ... when it is ethernet connected ethercat pci is freezing ... while I disconnect the ethernet ... ethercat is starting to run smoothly ... There I have generic driver on 8139 chipset and there should be 8139too driver but I do not know how to carefully replace it... I had used deb 10 buster 2.8 

I have not solve this problem till now ...

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

More
26 Nov 2023 22:30 #286588 by Sakhalin_Cat
I asked this question on the authors website and received the following answer from "Bjarne von Horn @igh-vh":

Please find a list of all native drivers here .What does your realtime application look like? Do you use Xenomai/RTAI or is your RT application a kernel module? If so, using the generic driver will crash your system for sure. The generic driver only works with traditional Linux userspace applications, with or without PREEMPT_RT. But this is what people (and we in IgH) do all the time. But it is indeed independent of the network card, so there is no need to buy a special one.For kernel 6.1, there currently is igb for the Intel i210 and i350 card. The thing is that the kernel internals are changing from time to time, so we have to adapt all native drivers for more recent kernel versions. We mostly use the generic and ccat driver.


I bought a i350 network adapter and it's on the way. There will be a check later.
The following user(s) said Thank You: rodw

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

More
27 Nov 2023 09:47 #286612 by Sakhalin_Cat
Today I installed the i350 network adapter. After this system freezing disappeared. Total of the processor load decreased by about 15-20%. I'm use is "generic" driver .
The following user(s) said Thank You: rodw, bob8020, hilo90mhz

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

More
04 Feb 2024 10:08 - 04 Feb 2024 10:10 #292366 by pepex
Hello,
what is wrong on my settings?
   


only with EK1100 is possibly to start it.

Thank You very much.
pepex
Attachments:
Last edit: 04 Feb 2024 10:10 by pepex.

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

More
04 Feb 2024 17:01 #292416 by CORBETT
Hello Pepex,

Here is what I would check...  I assume from what you describe you have the EL1004 attached to the EK1100 and it will fail when trying to start LCNC, but you can remove the EL1004 and LCNC will fire up and work afterwards.  If you can get it to work with the EK1100 only, with the EL1004 removed, and do nothing to the hal file or xml, then I would lean towards a bad EL1004 terminal.  From the command line do a "ethercat slaves" and see if both the EK1100 and the EL1004 show up, if the EL1004 is not shown, then definitely a bad terminal.  If you have other EL terminals, try one of them to see if you can get it to fire up.

If you bought the terminal off of Ebay or somewhere second hand, you may have to go into Beckhoff's TwinCAT and reset the terminal.  This can also be done from the command line.  I have reset other EL terminals from the command line, but not a EL1004.  It can be found in Beckhoffs manual for the 1004.

If you did change the "ethercat-test.hal" file, then post it and one of us will help you, as that will be the problem.  If you had a pin written wrong in the hal file, it wouldn't fire up with the EK1100 only, so that leads me to believe you have something wrong in hardware and not software.  If you did write a pin for the EL, then remove or comment it out and see if LCNC will start.  If it starts up, then the pin is written a little wrong in the hal file and not matching the XML.


Hope this helps,
Robert
 
The following user(s) said Thank You: pepex

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

More
11 Feb 2024 15:04 - 11 Feb 2024 15:08 #293097 by pepex
 Hello Robert,

thank you for your answer. I've made some progress, but I can't see my digital inputs.If I don't write them in .xml as my hal pins, I don't see them in halshow. If I write them there - .xml found on the Internet, there is some error. I have no idea, but what's wrong. Not even in your instructions is the .xml detailed with the description:
<syncManager idx="1" dir="in"/>     
<pdo idx="1a00">     <pdoEntry idx="3101" subIdx="01" bitLen="1" halPin="din0" halType="bit"/>
What am I doing wrong?
Thank you for your patience.pepex
Attachments:
Last edit: 11 Feb 2024 15:08 by pepex.
The following user(s) said Thank You: CORBETT

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

More
12 Feb 2024 06:19 #293131 by CORBETT
Hi Pepex,

Ok I see you are trying to use the “generic” driver for the EK and the EL.  There is no need to do this as both the EK1100 and EL1004 are already in the LCNC-Ethercat driver.  I know you are saying LCNC fails if you try the XML without the “generic” type, but the EK and EL definitely work out of the box as these were working from the beginning when Sascha released his code.

The first thing is to change the XML back.   Make your XML look like this, I will use your “naming” scheme:
<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
    <slave idx="0" name=”EK1100” type="EK1100"/>
    <slave idx="1" name=”EL1004” type="EL1004"/>
  </master>
</masters>

Make sure to remove all the pins that you have written for the EL1004 in any of your “hal” files.  With the EK and EL hooked up, try and see if LCNC will start.  It should start right up if the EL1004 terminal is ok and not bad.

If LCNC starts up then you are ready to write pins for the EL terminal.  For the above XML and how you had your XML “naming”, the correct way a pin would be written is:
    lcec.0.EL1004.din-0
    lcec.0.EL1004.din-1
    lcec.0.EL1004.din-2
    lcec.0.EL1004.din-3

The above pin would be all of the inputs for the EL1004.  If you have multiple EL1004 terminals, then you need to change the “name” in the XML to the following so that it will work:
<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
    <slave idx="0" name=”EK1100” type="EK1100"/>
    <slave idx="1" name=”EL1004-1” type="EL1004"/>
    <slave idx="2" name=”EL1004-2” type="EL1004"/>
  </master>
</masters>
From the above you see why it is easier to just do the XML “naming” as D1, D2, D3, etc…, but it will work that way also, just don’t get confused with multiple terminals that are the same “type”.

Pins for the #1 EL1004 would be:         
    lcec.0.EL1004-1.din-0
    lcec.0.EL1004-1.din-1
    lcec.0.EL1004-1.din-2
    lcec.0.EL1004-1.din-3

Pins for the #2 EL1004 would be:         
    lcec.0.EL1004-2.din-0
    lcec.0.EL1004-2.din-1
    lcec.0.EL1004-2.din-2
    lcec.0.EL1004-2.din-3
If you need to invert pins, then make them:
    lcec.0.EL1004-2.din-0-not
    lcec.0.EL1004-2.din-1-not
    lcec.0.EL1004-2.din-2-not
    lcec.0.EL1004-2.din-3-not


Ok let's do an XML like the old days with the “D” naming.  Just change the “name” only:
<masters>
  <master idx="0" appTimePeriod="1000000" refClockSyncCycles="1000">
    <slave idx="0" name=”D1” type="EK1100"/>
    <slave idx="1" name=”D2” type="EL1004"/>
    <slave idx="2" name=”D3” type="EL1004"/>
  </master>
</masters>

Pins for the #1 EL1004 would be: 
    lcec.0.D2.din-0
    lcec.0.D2.din-1
    lcec.0.D2.din-2
    lcec.0.D2.din-3
Pins for the #2 EL1004 would be: 
    lcec.0.D3.din-0
    lcec.0.D3.din-1
    lcec.0.D3.din-2
    lcec.0.D3.din-3


Last thing… if you still cannot get the EL to show up, then I would say you need to reset the terminal or get another as it would be hardware.  I know TwinCAT can change the terminals heavily, so if this is a used terminal then keep in mind you don’t know what the person before you did and it’s best to factory reset it so that you are starting fresh with the terminal.

I have had terminals not work, until I reset them.  Your first post with the Debug file shows that the terminal is not “seen” by the LCNC-ethercat driver.  You call for it in the XML, but the driver cannot find/see it.  This is evident in the line:
    lcec: rtapi_app_main: Invalid argument (-22)
So this leads me to believe you may have a hardware issue still, but try the XML and software side and we will go through the steps to figure this out.

I am working 7 days a week and up way too late but will try and check back with you tomorrow to help you.  Nothing is more frustrating than having LCNC fail and not start up, I have felt your pain before.


Hope this helps,
Robert

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

Time to create page: 0.234 seconds
Powered by Kunena Forum