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.

AM437x ISDK Ethernet TCP/IP transmission

Other Parts Discussed in Thread: SYSBIOS

Hi,

I use idkam437x with ccs 6.1.2, sysbios 6.45.1.29, sdk 2.1.1.2 and ndk 2.24.3.35.

I would like to establish a standard ethernet connection via tcp/ip transmission&stack by the use of PRUICSS module. There are two network examples in sdk: ethernet_mac and ethernetip_adapter. There is one nice example in pdk called NIMU_ICSS_BasicExample_idkAM437x_wSoCLib_armExampleproject, but it is almost a copy of ethernet_mac example. I have established two IP addresses at PHYs connected to PRU0 and PRU1 - it seems to be working so far.

Now there is another step related to the network connection: I would like to send and receive some data through the link - unfortunately none of the examples mentioned provides the transmission handling. Could you please give me some hints where should I look for the transmission API? Is it located in the vicss_emacDrv.h file where most of the ICSS_EMAC interface belongs?

Thanks

JJ

  • I will forward this to the ISDK team.
  • Hi Jacek,

    The icss_emacDrv.h lists the lower layer ICSS_EMAC driver APIs, see the block diagram for the various layers of network and packet processing applications, processors.wiki.ti.com/.../Processor_SDK_RTOS_NDK. For APIs of Ethernet transmission through TCP/IP, you can refer to the "TI Network Developer's Kit (NDK) v2.24 API Reference Guide", C:\ti\ndk_2_24_03_35\docs\spru524i, section 5.4 - TCP/UDP Server Daemon Support, and section 3.5 Raw Ethernet Sockets Programming Interface.

    Regards,
    Garrett
  • Hi Garrett,
    Thanks for your response.
    I have read most of the information enclosed in these documents. The problem is that without any example it is pretty hard to write the application handling data transmission or even EMAC configuration. Based on the NIMU_ICSS_BasicExample_idkAM437x_wSoCLib_armExampleproject from pdk_am437x 1.0.2 and ethernet_mac from sdk 2.1.1.2 I configured the EMAC, but completely do not know how to send/receive some data. in main source file of NIMU_ICSS_BasicExample_idkAM437x_wSoCLib_armExampleproject there is a line:

    ((ICSS_EmacObject*)emachandle->object)->rxTaskHandle = Task_create(ICSS_EMacOsRxTaskFnc, &taskParams, NULL);

    It looks that emachandle contains taskhandle for receiving and transmiting the data through established sockets. That task need to be created with Task_create() function where ICSS_EMacOsRxTaskFnc() is called to take data from stack into DDR memory. How should I pick that data up? Is there any way of moving that packets into my buffer?

    I also see that a PRUICSS_IntcInitData structure is initialized every time for icss_emac configuration. These vector interrupt structure contains interrupts from internal lines (4-8) - is it necessary for appropriate stack work? Moreover, some interrupts seem to be related to line transmission handling, like: PORT1_RX_EOF_EVENT but its number (42) indicates the PWM_ECAP event.... I have completely no idea how that structure works for any data transmission.

    Could you please explain those things to me - I have not found any essential information about these issues

    Thank you in advance
    JJ
  • Hi Jacek,

    The details of ICSS_EMAC driver design is captured here:

    Not sure if you have read this as well?

    Regards, Garrett

  • Hi Garrett,
    Yes, I have read this as well - most of the information is enclosed in User Guide and reference guide - in the NIMU_ICSS_BasicExample_idkAM437x_wSoCLib_armExampleproject there are a few sockets opened which is some start for transmission.
    The most important thing for me is about interrupt map for PRUICSS module. I would like to establish a communication on PRUICSS1 as in motor_control example from sdk 2.1.1.2. Unfortunately, I also need to trigger ADC by PRUICSS and it is available only from PRUICSS1 EVTOUT0. I see that it is already occupied in the pruicss1 map loaded by ICSS_EmacInit() function in all the ndk examples from ndk 2.24 and pdk_am437x 1.0.2. In conclusion, that map connects the following inputs and outputs-I would like to ask which of them:
    PRU_ARM_EVENT0 (20) -> PRU_EVTOUT0
    PRU_ARM_EVENT1 (21) -> PRU_EVTOUT1
    PRU_ARM_EVENT2 (22) -> PRU_EVTOUT2
    PRU_ARM_EVENT3 (23) -> PRU_EVTOUT3
    PRU_ARM_EVENT4 (24) -> PRU_EVTOUT4
    PORT1_RX_EOF_EVENT (42) -> PRU0
    PORT2_RX_EOF_EVENT (54) -> PRU1
    MII_LINK0_EVENT (41) -> PRU_EVTOUT6
    MII_LINK1_EVENT (53) -> PRU_EVTOUT7

    are crucial for proper operation of ndk tcp/ip stack loaded into PRUICSS1? E.g. can I remove PRU_ARM_EVENT0 directed to PRU_EVTOUT0 output and use the interrupt ICSS1_PRUSS0_HOST_INTR5 (56)? I do not know if these interrupts from PRU0/1 are important for proper operation of tcp/ip transmission in am437x applications.
    Please advise me with the above complications
    Thank you,
    JJ
  • Jacek,

    The PRU interrupts for packet transfer are listed in the table 'PRU interrupts in EMAC' in that ICSS EMAC design wiki. The PRU interrupt number and channel number are applicable to both AM335x and AM437x. I am confirming if channel 4/5 are used for Tx completion interrupt.....

    Regards, Garrett

  • Jacek,

    Referred to e2e.ti.com/.../522262, it appears you have figured out how to handle the Ethernet transmission through TCP/IP in ISDK. To make the thread complete, I confirmed Tx completion interrupt (host interrupt number 22/23) support will be available in later releases.
  • Hi Garett,

    Thanks for your reply.

    Yes, the problem was solved in the other post - I forgot to unckeck this one.

    Good to hear about the Tx completion interrupt - will be really useful for me.

    Thanks!

    JJ