LinuxCNC / Ethercat on recent ubuntu & kernel

More
31 Mar 2021 12:39 #204211 by parmitt
Hi,

Hopefully this is vaguely the right place to post this, but I'm looking for a bit of assistance to setup a fairly up-to-date system with which to get into helping developing LinuxCNC. My specific interest is in controlling Ethercat slaves that I have developed based on an Infineon XMC series MCU (& have controlled using TwinCAT to date!).

My progress so far is:

1) Install recent-ish x64 Ubuntu distribution (20.04 caused me endless headaches with the removal of python 2 support, so for now I've stuck with 18.04)
2) Compile the latest stable kernel with PREEMPT_RT support. (at the moment 5.10.25-rt35 #1 SMP PREEMPT_RT)
3) Build linux-cnc from source, with support for PREEMPT_RT (i.e. --with-realtime=uspace)

All this was fairly straightforward, but I'm having difficulty understanding how to proceed with integrating Ethercat support.

My understanding is that linuxcnc leverages the IgH/Etherlab "EtherCAT Master for Linux"
And that a "HAL" component for linuxcnc "github.com/sittner/linuxcnc-ethercat.git" communicates with this.

Most build instructions I've seen use "ec-debianize", which from what I understand is an automated build process to configure & build the etherlab master in a way that is suitable to integrate with linuxcnc-ethercat. This is the part I am having major issues with, as apparently it is not suitable for use with newer linux kernels.

Now, I can checkout the IgH/Etherlab "EtherCAT Master for Linux" from their current repository gitlab.com/etherlab.org/ethercat.git & happily build this against current kernel headers - I just don't really know what I need to do to integrate it with linuxcnc-ethercat, as ec-debianize appears to apply lots of patches & do things I don't fully understand.

If anyone can give me a brief rundown on how everything EtherCat related in linuxcnc actually integrates under the hood, I'd love to get into a position I can contribute something back to this awesome project.

Thanks!
Paul

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

More
31 Mar 2021 12:50 #204212 by Hakan
You can have a look at my notes from building ethercat support support on raspberry pi forum.linuxcnc.org/10-advanced-configura...at-on-raspberry-pi-4 . It doesn't use ec-debianize and might work better.

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

More
31 Mar 2021 18:58 #204262 by parmitt
Thanks for getting back - I'd come across your post previously & I did think it was more in line with what I need to do.

One further question, how come you & most others I've seen use the code at github.com/icshwi/etherlabmaster?

I don't quite understand what functionality this gives over & above the latest code from IgH, or indeed what the point of the "patchset" it uses is!

I'll get chance to try it out a bit later, so hopefully it will all become clear then! ;)

Cheers,
Paul

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

More
31 Mar 2021 21:46 #204315 by Hakan
It is just because the honourable icshwi was active in the long thread about ethercat and from there this work was picked up.

I got lost with ec-debianize. It didn't build cleanly, and I had no clue on where to start look for amending the build. Icshwi's work came in handy, I don't know more about that really.

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

More
31 Mar 2021 22:54 #204326 by parmitt
Great, that makes total sense.

I'm coming at all this fairly green and whilst I've a good background in C/C++ & embedded development, there's a lot to wrap my head around - so thanks for your patience!

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

Time to create page: 0.068 seconds
Powered by Kunena Forum