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.

AM3359: ICEv2 EOE using NDK

Part Number: AM3359


Hi,

I have almost the same question like three years ago:

I want to use the NDK for raw ethernet frames received by Ethercat to send them to the application and vice versa. I use the ETG stack (full stack) aplication.

Is there any documentation/ example about the usage of the low level NDK API?

I'm  using ndk_3_40_01_01 and an ICEv2.

  • Hi Herberg,

    Essentially you need enable EtherCAT EoE feature and integrate NDK - glue NDK and mailbox of EtherCAT for the feature.
    Are you looking for the NDK API user guide?
    file:///C:/ti/ndk_3_40_01_01/docs/ndk/NDK_API_Reference.html

    These may help as well:
    file:///C:/ti/ndk_3_40_01_01/docs/ndk/NDK_Users_Guide.html

    And processors.wiki.ti.com/.../PRU_ICSS_EtherCAT_firmware_API_guide

    Regards,
    Garrett
  • Hi Garrett,

    thank you for your response.

    The documentation is very massive. It is hard for me to find the correct starting point. Therefore I try to specify my questions much more.

    1.) Assumed I have a raw ethernet frame in RAM (received via EoE): How do I get it through the TCP/IP stack of the NDK?
    2.) On application side I used BSD sockets for getting frames directly from the NDK without EtherCAT. Is it still possible to use BSD sockets on application side using EoE? Otherweise which API has to be used?
    3.) How it is possible to fetch frames in sending direction after they left the TCP/IP stack to forwarding them to the EoE mailbox?
    4.) Is there any example using the NDK after receiving raw ethernetframes on any way exept usage of the TCP/IP stack (EOE, tunneld by another processor via SPI or anything else)?

    EoE is activated, I can receive frames and stuck in tiesc_eoe_receive() (in tiescmiscappl.c) which is looking for ARP and ping only instead of forwarding it to NDK.

    Regards,
    Martin
  • Hi Martin,

    1) You may refer to NIMU_ICSS_pktPoll (or NIMU_ICSS_rxPacket()) and NIMU_ICSS_send() for the NDK stack and icss emac driver. These functions are in packages\ti\transport\ndk\nimu_icss.

    2) Are you using the icss emac driver for the BSD sockets lower layer?

    3) refer to 1)

    4) I am not aware of the example.

    Do yo have to enable EoE instead of using the CPSW for ethernet traffic? AM335x has PRU based EMAC also CPSW Giga-bit interface.

    Regards,
    Garrett
  • Hi Garrett,

    thank you very much.

    1.) I found the functions. Is there any specification for them? I assume they are used by NDK libs only (e.g. the NIMU_ICSS_EmacInit()).

    2.) I'm not sure because the projoct is given to me only but I think so. the BSD socket functions are mapped to NDK_ versions of them in socket.h (like NDK_send()).

    How do I have to use the NIMU_ICSS functiosn correctly.
    Where I have to initialize the NETIF_DEVICE strcuture to use them?

    My customer wants to use EoE. I can ask again but I think it won't change anything. Otherwise it is possible to use EtherCat and "normal" Ethernet traffic (webserver, ...) simultaniously using the CPSW?

    Is there any other method to "explain" (in a simple way) the NDK that the network interface now is not a PHY but the EoE interface?

    Regards,
    Martin.

  • Martin,

    The NIMU ICSS code is for your reference only to hook the EtherCAT mailbox and NDK. The NIMU_ICSS driver is specifically design for ICSS EMAC driver/firmware, not in the EtherCAT context.

    Yes, it's it is possible to use EtherCat and "normal" Ethernet traffic (webserver, ...) simultaniously using the CPSW, seee2e.ti.com/.../2883725

    If you use create a raw socket instead of TCP/IP, that should be simpler to send/receive packets between NDK and EoE.

    Regards,
    Garrett
  • Hallo Garrett,

    I asked my customer. Currently it seems that EoE is the only option.

    Therefore I want go back to the beginning of this thread:
    How It is possible to put an ethernet frame from somewhere in the RAM (received by EoE, SPI or something else) through the NDK into the application layer and vice versa? Is it possible to that?

    I would be happy if this is possible using the BSD socket API (leading to NDK - versions of this API) but it is not absolutly necessary. Another method would be ok for me.

    Regards,
    Martin
  • Martin,

    Essentially you need to replace the EMAC driver functions (NIMU_send, NIMU_pktService) associated with NIMU/NDK to the EoE functions from EtherCAT(EOE_SendFrameRequest, EOEAPPL_ReceiveFrameInd), similar as NIMU_ICSS_send and NIMU_ICSS_pktService for ICSS EMAC.  

    I tried to illustrate the EoE/Mailbox call flow as below, hope this helps.

    Please refer to the Network Developer's Kit (NDK) Support Package Ethernet Driver document for details of NIMU layer, also the EMAC driver/NIMU/NDK structure from the PDK packages\ti\transport\ndk\nimu\src\v4\cpsw_nimu_eth.c

    With the NIMU driver update, the BSD socket APIs can be used as is.

    Regards,

    Garrett

  • Thanks Garret, it is very useful!
  • Hi Garret,

    thank you very much. The document and your illistration were the missing parts for understanding correctly.