This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x EtherCAT on linux

Other Parts Discussed in Thread: SYSBIOS

Hello suppot,

I’m trying to run the EtherCAT on our custom board with linux kernel version 3.12-31. I could manage to run the EtherCAT demo application included in the SysBIOS protocols examples, but I stuck in a problem that the firmwar doesn’t receive messages/interrupts when packet are received form the hardware layer.

I did the following:

  1. install the user space pru drivers for linux
    1. For the interrupt pin mapping I used the header delivered with the SysBIOS
    2. load the Firmware provided as C-Header files in the EtherCAT-Example application
    3. adapt the EtherCAT-Example application from SysBIOS to linux and Ethercat-Stack

The problem that I have is that the Firmware is waiting for the interrupt event “PRU_EVTOUT3”. This event according to the Interrupt mapping is mapped to channel 5, and channel 5 is assigned to system event “PRU_ARM_EVENT0” number 18.

My Questions are:

  1. Is the Firmware found in the EtherCAT example application code in the SysBIOS the right one?
  2. Is the interrupt pin mapping provided in the file “pruss_intc_mapping.h” correct? Since some system events are enabled, that do not correspond to the description in CPU-Reference Manual “spruh731.pdf”. For instance MII_LINK0_EVENT = System Event 41? According to the manual this event number “41” corresponds to “POINTRPEND” coming from “I2C0” and not MII-peripheral.
  3. Which system Events actually must be turned on in order to get EtherCAT-Firmware running?
  4. Does the firmware communicate with the peripherals over mailboxes? In the ti linux version 3.14.26 there are mailboxes swithed on in the device tree file “am33xx.dtsi”.
  5. Must the mailboxes also enabled in our device-tree file?

As you see I’m little bit confused and lost. Can you please help me?

Thanks in advance!

 

  • Hi,

    Are you trying to run the EtherCAT Master or Slave under Linux? The EtherCAT Slave stack can be run only under the Sitara Industrial SDK, based on SYS/BIOS.

  • Biser,

    Biser Gatchev-XID said:
    The EtherCAT Slave stack can be run only under the Sitara Industrial SDK, based on SYS/BIOS.

    That is not true. I do have customers who ported this to Linux and it is working. But obviously it is not trivial and we should seriously answer the customers questions. I assume the IA-SDK team is in charge.

    We do provide all driver source code to enable customers to port to another OS than Sys/Bios. However as we test only using Sys/Bios we can't guarantee all functionality or performance in the same way on a ported version. But this is a topic for a more detailed discussion.

    Regards,

  • Hello,

    I forgot to mention that we are develop EtherCAT Slave Device based on Sitara and we are also member of the ETG Group, means we have the source code of the Slave Stack.

    Regards
    Dimitar
  • This has already been forwarded to the Industrial SDK team.
  • Hi Dimitar,

    Dimitar Ivanov2 said:
    I forgot to mention that we are develop EtherCAT Slave Device based on Sitara and we are also member of the ETG Group, means we have the source code of the Slave Stack.

    Thanks for the info. That is obviously required but now your issues seem more with the OS port. So initially I would check if your pin-muxing is correct and interrupt config does not collide with the way it is done usually in Linux. I am not a Linux driver expert...

    We will try to answer the other questions asap. Don't think we use mailboxes (as a peripheral). EtherCAT does have it's own 'mailboxes'. But I subsume this is not the question.

    Regards,

  • Hello Frank,

    according to the mailboxes I mean the hardware mailboxes implemented in the CPU. As much as I could understand they are enabled in the linux "dts"-file and are probed by the linux mailbox driver and the pruss_remoteproc driver ,but I'm not sure.

    Here is also an output from the kernel concerning the pinmux confirguration. I hope it helps further.

    Regards,
    Dimitar


    [ 1.167850] pinctrl-single 44e10800.pinmux: found group selector 1 for pruss_pins
    [ 1.167876] pinctrl-single 44e10800.pinmux: request pin 9 (44e10824.0) for 4a300000.pruss
    [ 1.167894] pinctrl-single 44e10800.pinmux: request pin 16 (44e10840.0) for 4a300000.pruss
    [ 1.167911] pinctrl-single 44e10800.pinmux: request pin 17 (44e10844.0) for 4a300000.pruss
    [ 1.167927] pinctrl-single 44e10800.pinmux: request pin 18 (44e10848.0) for 4a300000.pruss
    [ 1.167942] pinctrl-single 44e10800.pinmux: request pin 19 (44e1084c.0) for 4a300000.pruss
    [ 1.167958] pinctrl-single 44e10800.pinmux: request pin 20 (44e10850.0) for 4a300000.pruss
    [ 1.167974] pinctrl-single 44e10800.pinmux: request pin 21 (44e10854.0) for 4a300000.pruss
    [ 1.167990] pinctrl-single 44e10800.pinmux: request pin 22 (44e10858.0) for 4a300000.pruss
    [ 1.168005] pinctrl-single 44e10800.pinmux: request pin 23 (44e1085c.0) for 4a300000.pruss
    [ 1.168021] pinctrl-single 44e10800.pinmux: request pin 24 (44e10860.0) for 4a300000.pruss
    [ 1.168037] pinctrl-single 44e10800.pinmux: request pin 25 (44e10864.0) for 4a300000.pruss
    [ 1.168053] pinctrl-single 44e10800.pinmux: request pin 26 (44e10868.0) for 4a300000.pruss
    [ 1.168069] pinctrl-single 44e10800.pinmux: request pin 27 (44e1086c.0) for 4a300000.pruss
    [ 1.168084] pinctrl-single 44e10800.pinmux: request pin 34 (44e10888.0) for 4a300000.pruss
    [ 1.168100] pinctrl-single 44e10800.pinmux: request pin 35 (44e1088c.0) for 4a300000.pruss
    [ 1.168115] pinctrl-single 44e10800.pinmux: request pin 29 (44e10874.0) for 4a300000.pruss
    [ 1.168131] pinctrl-single 44e10800.pinmux: request pin 30 (44e10878.0) for 4a300000.pruss
    [ 1.168147] pinctrl-single 44e10800.pinmux: request pin 40 (44e108a0.0) for 4a300000.pruss
    [ 1.168163] pinctrl-single 44e10800.pinmux: request pin 41 (44e108a4.0) for 4a300000.pruss
    [ 1.168178] pinctrl-single 44e10800.pinmux: request pin 42 (44e108a8.0) for 4a300000.pruss
    [ 1.168194] pinctrl-single 44e10800.pinmux: request pin 43 (44e108ac.0) for 4a300000.pruss
    [ 1.168210] pinctrl-single 44e10800.pinmux: request pin 44 (44e108b0.0) for 4a300000.pruss
    [ 1.168225] pinctrl-single 44e10800.pinmux: request pin 45 (44e108b4.0) for 4a300000.pruss
    [ 1.168241] pinctrl-single 44e10800.pinmux: request pin 48 (44e108c0.0) for 4a300000.pruss
    [ 1.168257] pinctrl-single 44e10800.pinmux: request pin 49 (44e108c4.0) for 4a300000.pruss
    [ 1.168272] pinctrl-single 44e10800.pinmux: request pin 50 (44e108c8.0) for 4a300000.pruss
    [ 1.168288] pinctrl-single 44e10800.pinmux: request pin 51 (44e108cc.0) for 4a300000.pruss
    [ 1.168304] pinctrl-single 44e10800.pinmux: request pin 52 (44e108d0.0) for 4a300000.pruss
    [ 1.168320] pinctrl-single 44e10800.pinmux: request pin 53 (44e108d4.0) for 4a300000.pruss
    [ 1.168335] pinctrl-single 44e10800.pinmux: request pin 54 (44e108d8.0) for 4a300000.pruss
    [ 1.168459] pinctrl-single 44e10800.pinmux: request pin 55 (44e108dc.0) for 4a300000.pruss
    [ 1.168481] pinctrl-single 44e10800.pinmux: request pin 58 (44e108e8.0) for 4a300000.pruss
    [ 1.168497] pinctrl-single 44e10800.pinmux: request pin 59 (44e108ec.0) for 4a300000.pruss
    [ 1.168518] pinctrl-single 44e10800.pinmux: enabling pruss_pins function1
    [ 1.168667] pruss_uio 4a300000.pruss: obtain a copy of previously claimed pinctrl
  • Dimitar,

    the EtherCAT firmware is not based on the remote_proc method used by standard PRU support. There is a direct and dedicated register (memory) interface between firmware and ARM drivers. Don't mix the two methods...

    Checking your pin-mux config is outside the scope of E2E support I believe. Do you get local support from distri or FAE? Maybe your schematic does not match the pin-mux requirements for EtherCAT slave?

    Regards,
  • Hi,

    Existing implementations are based on UIO PRUSS driver. For e.g.:- www.ibv-augsburg.net/.../icECAT_Slave_SDK_Linux_Whitepaper.pdf . You may contact them if this is a feasible option. See below my answers

    1.Is the Firmware found in the EtherCAT example application code in the SysBIOS the right one?

    Yes
    2.Is the interrupt pin mapping provided in the file “pruss_intc_mapping.h” correct? Since some system events are enabled, that do not correspond to the description in CPU-Reference Manual “spruh731.pdf”. For instance MII_LINK0_EVENT = System Event 41? According to the manual this event number “41” corresponds to “POINTRPEND” coming from “I2C0” and not MII-peripheral.

    This will be a MII event used when MII mode is enabled in PRU-ICSS, that part of the TRM is only available under NDA I think...
    3.Which system Events actually must be turned on in order to get EtherCAT-Firmware running?

    This is already described in pruss_intc_mapping.h - please enable everything mentioned there
    4.Does the firmware communicate with the peripherals over mailboxes? In the ti linux version 3.14.26 there are mailboxes swithed on in the device tree file “am33xx.dtsi”.

    No - firmware do not use SoC mailbox - this is way too slow to access from PRU-ICSS going over interconnect. Not sure about .dtsi file...
    5.Must the mailboxes also enabled in our device-tree file?

    Not required for EtherCAT
  • Hi Praheesh

    thank you for your answers. I think I can see clearly now :-).

    How/where can I get the missing part of the TRM?

    Regards
    Dimitar
  • Hello Frank,

    thank your for your help.

    I hope it's OK if ask where to find the missing part of the TRM that Pratheesh mentioned.

    Regards
    Dimitar
  • Dimitar,

    sure, for that you need to get in contact with your local support as the doc is not publicly available.

    Regards,
  • Hello Frank,

    do you mean TI-local support or the distri where we bought our developper kits?

    Thanks!

    Regards
    Dimitar
  • Dimitar,

    whatever is your standard channel for support on TI products. Usually broad market is through distributors.

    Regards,
  • Frank,

    Does this missing part has notation for instance "spruh731.-whatever version foo.1" ?

    Thank you!

    Regards
    Dimitar
  • I assume Pratheesh was referring to SPRUHO4 AM335x PRU-ICSS Reference Guide which requires an NDA.
  • Hello guys,

    thank you for your help. Can you please tell me how to mark the post as answered? There is no button for that function.

    Regards,
    Dimtar
  • Hello Frank,

    i was able to port EtherCAT-Stack and PRUs interface on linux.
    Thank you for your support.
  • Hi Dimitar,

    thanks for letting us know. Great to know we have smart customers!

    Regards,
  • Hi Dimitar,

    Congratulations! Out of all the people who have tried to make EtherCAT work on an AM335x with Linux you are one of the very few that succeeded.

    It would be very kind of you to summarize and share here what were the required steps for your success. What is the secret ingredient of the recipe?

    I'm looking forward to your reply.

    Best regards
    Stefano