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.

MCU-PLUS-SDK-AM243X: MDIO Manual Mode

Part Number: MCU-PLUS-SDK-AM243X
Other Parts Discussed in Thread: TMDS243EVM

Hi support team,

We're using the board TMDS243EVM.

Our final goal it to load our own EtherNet/IP stack on the AM243x CPU.

I followed this guide to use ICSS-EMAC:
https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/latest/exports/docs/api_guide_am263x/ICSS_EMAC.html
But I can see no link detection when trying to send Ethernet packets.

Because of the issue i2329 [MDIO interface corruption (CPSW and PRU-ICSS)]So, I followed this guide to load the MDIO in Manual Mode:
https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/latest/exports/docs/api_guide_am243x/INDUSTRIAL_COMMS_MDIO_MANUALMODE_FW_USAGE.html

(For details about i2329, see https://www.ti.com/lit/er/sprz457g/sprz457g.pdf?ts=1680680167338&ref_url=https%253A%252F%252Fsoftware-dl.ti.com%252Fmcu-plus-sdk%252Fesd%252FAM243X%252Flatest%252Fexports%252Fdocs%252Fapi_guide_am243x%252FINDUSTRIAL_COMMS_MDIO_MANUALMODE_FW_USAGE.html)

First, I load the PRU FW for on PRU0 and PRU1 with this:
C:\ti\mcu_plus_sdk_am243x_08_05_00_24\source\industrial_comms\ethernetip_adapter\icss_fwhal\firmware\mii\ethernetip_adapter_pru0_bin.h
C:\ti\mcu_plus_sdk_am243x_08_05_00_24\source\industrial_comms\ethernetip_adapter\icss_fwhal\firmware\mii\ethernetip_adapter_pru1_bin.h

Then, I load the MDIO FW for Manual Mode located here:
C:\ti\mcu_plus_sdk_am243x_08_05_00_24\source\industrial_comms\ethercat_slave\icss_fwhal\firmware\g_v1.3\mdio_fw_bin.h

After that, I call ICSS_EMAC_Params_init(), initialize the struct icssEmacParams field before calling ICSS_EMAC_open().

When I step into ICSS_EMAC_open() with the debugger, I can see no link on both of the stacked ICSSG Ethernet ports even if I connect/disconnect a cable on it.

In MDIO_phyLinkStatus(), I can see theses MDIO registers:



I wonder if is normal as in the API guide page, it is mentioned that some registers are not available (MDIO_VERSION_REG, MDIO_CONTROL_REG...) (See § "Impact")

If don't load the MDIO FW for Manual Mode setup, just to compare, I can see exactly the same reg values, weird...

It is as if the loading of MDIO FW in Manual Mode didn't work, that could explain the link not detected, according to i2329.

What could be the cause of the link status not detected on both Ethernet ports in my implementation?
Did I miss something?

Just to see, I also tried to load the demo project "enet_lwip_icssg_am243x-evm_r5fss0-0_freertos_ti-arm-clang", I can see the link state changing when I connect/disconnect the Ethernet cable, so the hardware is working fine.

Thanks for your help.

  • An additional remark:

    In this page for the EtherNet/IP adapter demo:

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/latest/exports/docs/api_guide_am243x/EXAMPLES_INDUSTRIAL_COMMS_ETHERNETIP_ADAPTER_DEMOS.html

    In can see  a note saying the EtherNet/IP adapter demo doesn't work on HS FS device.


    As my EVM board is a TMDS243EVM, so HS FS, does it mean the link detection issue I'm seeing is related to this incompatibility?

    When I try to load the EIP demo on the HS FS, the FW loops in the function MDIO_phyRegRead() and hence, never starts the application.
    It works fine on GP version of the EVM board.

    What should I do to make the link detection working with ICSS-EMAC running on HS FS device?

    Thanks,
    Ludovic

  • Hi Ludovic,

    I would recommend starting with HSR-PRP example and modify it by adding EIP fw. I have concerns w.r.t to the initialisation rather than errata issue.

    Can you please try above.

    BR

    Nilabh A.

  • Hi Nilabh, 

    With HSR demo, I set an IP address.
    When I try to ping it, there is no response.
    Is it normal?

    Thanks,

    Ludovic

  • Hi Ludovic,

    This is not an expected as ping should work. let me check this and get back on it by Thursday 

  • Hi Ludovic,

    Please try with PRP example as HSR frames are usually dropped by PC nic due to HSR tag present in frame is not recognized by PC.

    Prp also has tag but it is append at the end so it is detected by PC NIC

    Could you please try this and let me know.

  • Hi Nilabh,

    I confirm ping works with PRP demo project.
    I also tried to make ping work from HSR demo after some modifications (Mostly by removing stuff related to HSR).
    It works also but with timeout issues, probably due to debug traces I've added in libs for debug purposes.

    Do you know where ping is located in PRP demo?
    Is it in LwIP or somewhere else?
    In lwipcfg.h, I can see "#define LWIP_PING_APP    0", so if ping works, it should be something else.

  • we do not recommend making modification to HSR driver as it may effect the functionality.

    ping is located in lwip. May I know what is it that you are trying to implement.

  • Hi Nilabh,

    Following your previous suggestion, I'm using HSR demo project as a basis to connect our own EtherNet/IP stack, including our own DLR implementation.
    As we won't use HSR at all, I removed it and only keep LwIP and ICSS-EMAC.

    My first goal is to be able to Send/Receive frames using LwIP and ICSS-EMAC, that's why I'm trying to use Ping.

    I also want to manage Link Status using MDIO in Manual Mode following the recommendations for issue i2329 related to MDIO interface corruption.

    BR,
    Ludovic

  • Hi Nilabh,

    In HSR-PRP demo project, during ICSS-EMAC config, we can see this:

    icssEmacParams.callBackObject.customRxCallBack.callBack = (ICSS_EMAC_CallBack)RedRxPktGet;
    icssEmacParams.callBackObject.customRxCallBack.userArg = (void*)(hsrPrphandle);
    icssEmacParams.callBackObject.customTxCallBack.callBack = (ICSS_EMAC_CallBack)RedTxPacket;
    icssEmacParams.callBackObject.customTxCallBack.userArg = (void*)(hsrPrphandle);
    ....
    Then call to:
    emachandle = ICSS_EMAC_open(CONFIG_ICSS_EMAC0, &icssEmacParams);

    I wonder what is the event to call customRxCallBack.callBack and customTxCallBack.callBack compared to  rxRTCallBack.callBack and  rxNRTCallBack.callBack.callBack?

    Thanks,
    Ludovic

  • No problem, I've found the answer to my question.
    customRxCallBack and customTxCallBack are called respectively from ICSS_EMAC_rxPktGet() and ICSS_EMAC_txPacket() regardless of the priority of the packets and regardless the priority Q the packet come from.

  • Hi Ludovic,

    Glad to know. Will close this thread

  • Hi Nilbah,

    Not yet, please.
    I have one question about the MDIO software workaround i2329:

    In i2329, it is said in the "Note" that there may be significant CPU or PRU loading impact to implement the run-time workaround due to required polling interval for link status check.
    Link: AM64x/AM243x Processor Silicon Revision 1.0, 2.0 (Rev. G) (ti.com)

    In HSR demo there is no polling implemented; the link change is detected through an interrupt with the call to ICSS_EMAC_linkISR() configured in ICSS_EMAC_osInit().

    Note:
    I load the MDIO FW in Manual mode and EtherNet/IP PRU FW (in replacement to HSR PRU FW) because in the future, we plan to use DLR.

    Question:
    Why is there no polling implemented in HSR project contrary to what is explained in i2329?
    My understanding was to implement a polling from R5 core to check the link change.
    Is the polling of link status done internally by the MDIO FW loaded in manual mode which generates the ISR caught by the R5 core in ICSS_EMAC_linkISR()?

  • Hi Ludovic,

    Why is there no polling implemented in HSR project contrary to what is explained in i2329?
    My understanding was to implement a polling from R5 core to check the link change.
    Is the polling of link status done internally by the MDIO FW loaded in manual mode which generates the ISR caught by the R5 core in ICSS_EMAC_linkISR()?

    The link change status is still monitored by MDIO HW IP using RX_LINK pins from PHY (MII0_RXLINK and MII1_RXLINK pins). On link change, using the information from these pins, the MDIO HW IP generates link change interrupt on which ICSS_EMAC_linkISR() is called to serve the interrupt. Only the MDIO Communication with PHYs is impacted by errata i2329, so that is being handled by PRU FW.

  • Hi Ludovic,

    Let me know if above discussion resolved your doubts so that I can close the thread. 

  • Hi Himanshu,
    Yes, this answer the doubts that I had.
    Thanks for your help.