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-AM263X: Data transmission with EST using lwip

Part Number: MCU-PLUS-SDK-AM263X

Hi,

I'm using AM263x-cc EVM with SDK version "mcu_plus_sdk_am263x_08_02_01_08".

I want to check the EST effect with UDP or TCP protocol.

Hence, I integrated the example est+lwip, and also enabled vlan tag and pcp in lwip.

Now I can send udp packet with different pcp, but it seems the packet transmission time doesn't meet the gate control setting.

My gate control setting list below:

And I also attach the packet capture file for your reference:

AM26EVM_LWIP_EST_500us_Cycle.zip

I sent udp packet with pcp 0,2,4,6 recursively in the same time.

Do you have any suggestion about my test?

 

Thanks,

Josh

  • Hi Josh,

    I suggest you to move to latest version of MCU+ SDK which is mcu_plus_sdk_am263x_08_03_00_23.
    You can download the same at - MCU-PLUS-SDK-AM263X Software development kit (SDK) | TI.com
    Also, do let us know if the problem is recurring on the latest version of MCU+ SDK ?

    Thanks and Regards,

    Aakash

  • Josh,

    Could you please confirm if you are setting the following config params?

    hostPortCfg->rxVlanRemapEn = true;
    hostPortCfg->rxDscpIPv4RemapEn = true;
    hostPortCfg->rxDscpIPv6RemapEn = true;

    Also, note that Wireshark timestamps are not very accurate. Preferable to use specialized equipment if available.

  • Hi Misael,

    Yes, I added the cpswcfg in LwipApp_init()

    // Josh
    static void EnetApp_portLinkStatusChangeCb(Enet_MacPort macPort,
                                               bool isLinkUp,
                                               void *appArg)
    {
        EnetAppUtils_print("MAC Port %u: link %s\r\n",
                           ENET_MACPORT_ID(macPort), isLinkUp ? "up" : "down");
    }
    
    static void EnetApp_mdioLinkStatusChange(Cpsw_MdioLinkStateChangeInfo *info,
                                             void *appArg)
    {
        static uint32_t linkUpCount = 0U;
    
        if ((info->linkChanged) && (info->isLinked))
        {
            linkUpCount++;
        }
    }
    
    static void EnetApp_initCpswCfg(Cpsw_Cfg *cpswCfg)
    {
        CpswAle_Cfg *aleCfg = &cpswCfg->aleCfg;
        CpswHostPort_Cfg *hostPortCfg = &cpswCfg->hostPortCfg;
        CpswCpts_Cfg *cptsCfg = &cpswCfg->cptsCfg;
    
        /* Peripheral-level config */
        cpswCfg->mdioLinkStateChangeCb     = EnetApp_mdioLinkStatusChange;
        cpswCfg->mdioLinkStateChangeCbArg  = NULL;
        cpswCfg->portLinkStatusChangeCb    = &EnetApp_portLinkStatusChangeCb;
        cpswCfg->portLinkStatusChangeCbArg = NULL;
        cpswCfg->vlanCfg.vlanAware         = true;
    
        /* ALE config */
        aleCfg->modeFlags                          = CPSW_ALE_CFG_MODULE_EN;
        aleCfg->agingCfg.autoAgingEn               = true;
        aleCfg->agingCfg.agingPeriodInMs           = 1000U;
        aleCfg->nwSecCfg.vid0ModeEn                = true;
        aleCfg->vlanCfg.aleVlanAwareMode           = TRUE;
        aleCfg->vlanCfg.cpswVlanAwareMode          = cpswCfg->vlanCfg.vlanAware;
        aleCfg->vlanCfg.unknownUnregMcastFloodMask = CPSW_ALE_ALL_PORTS_MASK;
        aleCfg->vlanCfg.unknownRegMcastFloodMask   = CPSW_ALE_ALL_PORTS_MASK;
        aleCfg->vlanCfg.unknownVlanMemberListMask  = CPSW_ALE_ALL_PORTS_MASK;
        aleCfg->policerGlobalCfg.policingEn        = false;
    
        /* Host port config */
        hostPortCfg->removeCrc         = true;
        hostPortCfg->padShortPacket    = true;
        hostPortCfg->passCrcErrors     = false;
        /* Hardware switch priority is taken from packet's PCP or DSCP */
        hostPortCfg->rxVlanRemapEn     = true;
        hostPortCfg->rxDscpIPv4RemapEn = true;
        hostPortCfg->rxDscpIPv6RemapEn = true;
    
        /* CPTS config (CPTS_RFT_CLK = 200MHz) */
        cptsCfg->cptsRftClkFreq = CPSW_CPTS_RFTCLK_FREQ_200MHZ;
    }
    
    static int32_t LwipApp_init(Enet_Type enetType)
    {
        int32_t status = ENET_SOK;
        EnetMcm_InitConfig enetMcmCfg;
        Cpsw_Cfg cpswCfg;
    #if (ENET_ENABLE_PER_ICSSG == 1)
        Icssg_Cfg icssgCfg;
    #endif
        EnetRm_ResCfg *resCfg = &cpswCfg.resCfg;
        EnetCpdma_Cfg dmaCfg;
    
    
        EnetApp_getEnetInstInfo(&gLwipIfCbObj.enetType,
                                &gLwipIfCbObj.instId,
                                gLwipIfCbObj.macPortList,
                                &gLwipIfCbObj.numMacPorts);
    
        EnetAppUtils_assert(gLwipIfCbObj.enetType == enetType);
    
        /* Set configuration parameters */
        if (Enet_isCpswFamily(gLwipIfCbObj.enetType))
        {
            cpswCfg.dmaCfg = (void *)&dmaCfg;
            Enet_initCfg(gLwipIfCbObj.enetType, gLwipIfCbObj.instId, &cpswCfg, sizeof(cpswCfg));
            EnetApp_initCpswCfg(&cpswCfg);   // Josh
            EnetApp_getCpswInitCfg(gLwipIfCbObj.enetType, gLwipIfCbObj.instId, &cpswCfg);
    
            EnetAppUtils_assert(EnetAppUtils_isDescCached() == false);
            dmaCfg.isCacheable = false;
            dmaCfg.rxInterruptPerMSec = 8;
            dmaCfg.txInterruptPerMSec = 2;
    
            enetMcmCfg.perCfg = &cpswCfg;
            resCfg = &cpswCfg.resCfg;
        }
    #if (ENET_ENABLE_PER_ICSSG == 1)
        else
        {
            Enet_initCfg(gLwipIfCbObj.enetType, gLwipIfCbObj.instId, &icssgCfg, sizeof(icssgCfg));
    
            /* Currently we only support one ICSSG port in NIMU */
            EnetAppUtils_assert(gLwipIfCbObj.numMacPorts == 1U);
    
            resCfg = &icssgCfg.resCfg;
            icssgCfg.dmaCfg = (void *)&dmaCfg;
    
            enetMcmCfg.perCfg = &icssgCfg;
        }
    #else
        else
        {
            enetMcmCfg.perCfg = NULL;
        }
    #endif
    
        EnetAppUtils_assert(NULL != enetMcmCfg.perCfg);
        EnetAppUtils_initResourceConfig(gLwipIfCbObj.enetType, EnetSoc_getCoreId(), resCfg);
    
        enetMcmCfg.enetType           = gLwipIfCbObj.enetType;
        enetMcmCfg.instId             = gLwipIfCbObj.instId;
        enetMcmCfg.setPortLinkCfg     = EnetApp_initLinkArgs;
        enetMcmCfg.numMacPorts        = gLwipIfCbObj.numMacPorts;
        enetMcmCfg.periodicTaskPeriod = ENETPHY_FSM_TICK_PERIOD_MS; /* msecs */
        enetMcmCfg.print              = EnetAppUtils_print;
    
        memcpy(&enetMcmCfg.macPortList[0U], &gLwipIfCbObj.macPortList[0U], sizeof(enetMcmCfg.macPortList));
        status = EnetMcm_init(&enetMcmCfg);
    
        return status;
    }

    And we capture the packet using Vector VN5640.

     

    Regards,

    Josh

  • Hi Aakash,

    It needs some time to do the modification to the new SDK, I'll feedback you later.

     

    Regards,

    Josh