# How modifing RPI4 source for custom EtherCAT driver (AX2006) in lcec

**URL:** <http://discourse.heig-vd.ch/t/how-modifing-rpi4-source-for-custom-ethercat-driver-ax2006-in-lcec/206>\
**Category:** OpenCN Framework\
**Created:** [March 19, 2021, 2:30pm UTC](http://discourse.heig-vd.ch/t/how-modifing-rpi4-source-for-custom-ethercat-driver-ax2006-in-lcec/206 "2021-03-19T14:30:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marian](http://discourse.heig-vd.ch/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@Marian](http://discourse.heig-vd.ch/u/Marian)\
**Post date:** [March 19, 2021, 2:30pm UTC](http://discourse.heig-vd.ch/t/how-modifing-rpi4-source-for-custom-ethercat-driver-ax2006-in-lcec/206/1 "2021-03-19T14:30:52Z")

</div>

I want add support for different hardware (Beckhoff AX2006 driver) - Wher I can start.  
I successfully build image for RPI4. I connect EtherCAT network to RPI4 Ethernet port, but how connect GUI computer to RPI4.  
After boot I get error: ifconfig: SIOCGIFFLAGS: No such device.  
Thank you.

---

<div class="post-metadata">

**Author:** ![jmi](http://discourse.heig-vd.ch/user_avatar/discourse.heig-vd.ch/jmi/32/125_2.png) [@jmi](http://discourse.heig-vd.ch/u/jmi)\
**Post date:** [March 20, 2021, 8:31am UTC](http://discourse.heig-vd.ch/t/how-modifing-rpi4-source-for-custom-ethercat-driver-ax2006-in-lcec/206/2 "2021-03-20T08:31:36Z")

</div>

Hi Marian,

For the connection of the rpi4 with a remote PC, we use this [Ethernet HAT](https://www.sg-electronic-systems.com/ethernet-dual-shield-v-1-1-for-raspberry/).

- The error you got is due because this HAT is not mounted on you rpi4

The temporary fix this issue, you can comments the content of `<OPENCN_HOME>/agency/rootfs/board/rpi4/rootfs_overlay/etc/network/interfaces` (not tested, I don’t have a rpi4 available right now)

**EtherCAT slave support**  
EtherCAT slave support are implemented in the `lcec` component - kernel part

- Path: `<OPENCN_HOME>/linux/opencn/components/lcec/`

Here is a small overview on how to add support for a new slave:

- In the above path, add the src/header file for your new slave: `lcec\_my\_slave.{c,h}
- In the `C` file, implement the functions: `lcec_my_slave_init()`, `lcec_my_slave_read()` and `lcec_my_slave_write()`
- Add the PDO definitions. It is possible to get it with the help of `./ethercat cstruct` cli tool available in the `rpi4` prompt.

You can get inspiration by looking how the other slaves have been implemented.

I’m working on an initial version of `lcec` documentation. It currently is under review.

- path: `doc/src/hal.rst`
- branch: `96-initial-hal-companion-documentation`  
It should be integrated in `master` branch and so in the official documentation next week.

Hope this help. Don’t hesitate to ask any question you have

J-P

---

<div class="post-metadata">

**Author:** ![jmi](http://discourse.heig-vd.ch/user_avatar/discourse.heig-vd.ch/jmi/32/125_2.png) [@jmi](http://discourse.heig-vd.ch/u/jmi)\
**Post date:** [June 6, 2021, 7:19pm UTC](http://discourse.heig-vd.ch/t/how-modifing-rpi4-source-for-custom-ethercat-driver-ax2006-in-lcec/206/3 "2021-06-06T19:19:50Z")

</div>

Hi Marian, hi all

The support for the AX5000 drives have been added to OpenCN framework.

Have a nice day  
J-P
