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.

[FAQ] LP-AM261: Running gPTP TimeSync applications on AM261x LaunchPad

Part Number: LP-AM261

Tool/software:

Hi experts,

Can you help me figure out the answers to the following questions about running gPTP (IEEE802.1AS) examples on AM261x-LP using the v10.02 SDK.

  1. When running the gPTP examples with DP83826 Industrial PHY Add-on board, I do not see any Time Sync?
  2. When running the gPTP examples with both MAC Ports enabled (like in case of AM263x and AM263Px), I run into some asserts in ti_board_config.c)?

  • On AM261x-LP PROC E1 and PROC E2 revisions, there are known connectivity issues in RMII interface. When testing using the DP83826 Industrial Add-on-PHY, It is recommended to try it in 100M MII interface mode. This needs some basic changes and checks in the SDK.

    Step-1: In the following file (mcu_plus_sdk_am261x_10_02_00_15\source\networking\tsn\tsn-stack\tsn_combase\tilld\sitara\lldenet.c), replace the function (LLDEnetGetLinkInfo()) with the below definition, to enable MII mode support.

    int LLDEnetGetLinkInfo(LLDEnet_t *hLLDEnet, uint8_t portNum,
        uint32_t *speed, uint32_t *duplex)
    {
    #if !ENET_ENABLE_PER_ICSSG
        EnetPhy_GenericInArgs phyInArgs;
     
        EnetMacPort_LinkCfg phyOutArgs;
     
        Enet_IoctlPrms prms;
     
        int32_t status;
     
        if ((hLLDEnet == NULL) || (speed == NULL) || (duplex == NULL)) {
            return LLDENET_E_PARAM;
        }
     
        /* Get port link state (speed & duplexity) from PHY */
     
        phyInArgs.macPort = (Enet_MacPort)(ENET_MACPORT_NORM(portNum));
     
        ENET_IOCTL_SET_INOUT_ARGS(&prms, &phyInArgs, &phyOutArgs);
     
        ENET_IOCTL(hLLDEnet->hEnet, hLLDEnet->coreId,
     
        ENET_RPHY_IOCTL_GET_LINK_MODE, &prms, status);
     
    #else
     
        Enet_MacPort phyInArgs;;
        EnetMacPort_LinkCfg phyOutArgs;
        Enet_IoctlPrms prms;
        int32_t status;
     
        if ((hLLDEnet == NULL) || (speed == NULL) || (duplex == NULL)) {
            return LLDENET_E_PARAM;
        }
     
        /* Get port link state (speed & duplexity) from PHY */
        phyInArgs = (Enet_MacPort)(ENET_MACPORT_NORM(portNum));
        ENET_IOCTL_SET_INOUT_ARGS(&prms, &phyInArgs, &phyOutArgs);
        ENET_IOCTL(hLLDEnet->hEnet, hLLDEnet->coreId,
        ENET_PER_IOCTL_GET_PORT_LINK_CFG, &prms, status);
     
    #endif
        if (status != ENET_SOK) {
            UB_LOG(UBL_ERROR,"Failed to get link info: %d\n", status);
            return LLDENET_E_IOCTL;
        }
     
        if (phyOutArgs.speed == ENET_SPEED_10MBIT) {
            *speed = 10;
        } else if (phyOutArgs.speed == ENET_SPEED_100MBIT) {
            *speed = 100;
        } else if (phyOutArgs.speed == ENET_SPEED_1GBIT) {
            *speed = 1000;
        } else {
            *speed = 0;
        }
     
        if (phyOutArgs.duplexity == ENET_DUPLEX_FULL) {
            *duplex = 1;
        } else {
            *duplex = 0;
        }
     
        return LLDENET_E_OK;
    }

    Step-2: Rebuild the TSN stack using the following commands:

    # TO CLEAN
    gmake -sj -f makefile.am261x tsn_combase-freertos_r5f.ti-arm-clang_clean
    gmake -sj -f makefile.am261x tsn_gptp-freertos_r5f.ti-arm-clang_clean
    gmake -sj -f makefile.am261x tsn_unibase-freertos_r5f.ti-arm-clang_clean
    gmake -sj -f makefile.am261x tsn_uniconf-freertos_r5f.ti-arm-clang_clean
     
    # TO BUILD
    gmake -sj -f makefile.am261x tsn_combase-freertos_r5f.ti-arm-clang
    gmake -sj -f makefile.am261x tsn_gptp-freertos_r5f.ti-arm-clang
    gmake -sj -f makefile.am261x tsn_unibase-freertos_r5f.ti-arm-clang
    gmake -sj -f makefile.am261x tsn_uniconf-freertos_r5f.ti-arm-clang
     
    add PROFILE=debug flag for a debug build

    Step-3: If using Both MAC Ports, In the example.syscfg of the gptp_cpsw_app, make sure MAC Port-2 is enabled and pinmux is set as well (you should see all the checkbox ticked for both ports). If using only 1 port, make sure the required port is selected in syscfg and other is disabled. At run-time, make sure that the MAC Port link up is seen with PHY Alive logs.

    Step-4: In example.syscfg, change the MAC address assignment to manual if you observe asserts in ti_board_config.c line 408. This indicates that the MAC Address assignment from EEPROM is failing.

    Step-5: In example.syscfg, make sure MII mode is selected in Enet(CPSW) pinmux for DP83826 Industrial add-on-board

    Step-6: Re-build your application to use the updated stack

    Step-7: Test with AM261x.

    To know more about testing the gPTP, follow the detailed FAQ on AM261x gPTP Testing: e2e.ti.com/.../faq-am2612-how-to-test-gptp-on-am261x-launchpad

    Regards,
    Shaunak