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.

TDA4VM: Enet Loopback example: Failed to open Enet DMA RX channel

Part Number: TDA4VM

Tool/software:

Hi Sudheer,

Hope you are doing well.

Unfortunately, I was unable to continue the discussion because of my vacations.

Coming back to the topic, I have changed the CPSW2G default configuration to change the resource partition by changing the .coreId to IPC_MCU2_0.
Build the enet_example_utils_baremetal as I am not using freertos. But got the same error which I was getting earlier about UDMA channel pairing failed.

Any suggestion on what could be the possible reason for having this error?

Best regards,
Hasan

  • Hi,

    TI SDK doen't have loopback baremetal example.

    We have "enet_loopback_test_freertos" only from SDK.

    If you have created a own application, you need to take care by referring the TI SDK examples.

    If you are using TI SDK example, then please refer to below E2E where I have mentioned how to build for MCU2_0. It was working at my end.
    e2e.ti.com/.../tda4vm-failed-to-open-enet-dma-rx-channel

    Best Regards,
    Sudheer

  • Hi Sudheer,

    I have modified "enet_loopback_example" according to "enet_helloworld_example"(pdk_jacinto_09_01_00_22). And the enet libraries can be build for MCU1_0 and MCU2_0. I didn't have any issues running the example on MCU1_0. Everything with DMA went smoothly and I was able to transmit and receive ethernet packets.

    The error I am getting is UDMA channel pairing failed. 

    I am suspicious that it has nothing to do with example build for freertos or baremetal. Error is because of the wrong allocation of UDMA resources for MCU2_0.
    Is there a way to allocate the UDMA resources for MCU2_0? If yes, then are the steps to follow?

    What are the UDMA resources necessary for cpsw ethernet frames transmission and reception ?

    Looking forward to hearing back from you.


    Best regards,
    Hasan

  • Hi,

    As pointed in below E2E.
    e2e.ti.com/.../tda4vm-failed-to-open-enet-dma-rx-channel

    If you are facing similar DMA channel allocation Issue.
    You need to modify the resources and build "enet_example_utils_baremetal" for MCU2_0 core if using hello word example, if using loopback need to follow steps in above E2E.

    After build example utils, need to build the actual application.
    If you follow the steps as mentioned you will not face any resource issue.

    If you have made some changes to applications and not handled make files properly, then it may fail.

    Better to build example utils for baremetal & freertos after modifying the rmconfig as mentioned above E2E and then build your application.

    if still facing issue, please share the Error log with us.

    Best Regards,
    Sudheer

  • Hi Sudheer,

    Thank you for the response.

    It will follow the steps suggested and will come back to you.

    In the meantime, can you provide me the information about the UDMA resources necessary for cpsw ethernet frames transmission and reception ?

    Best regards,
    Hasan

  • Hi,

    In the meantime, can you provide me the information about the UDMA resources necessary for cpsw ethernet frames transmission and reception ?

    For Transmission you need Tx channel.
    For Reception you need Rx channel and Rx flows.
    For Interrupts we need Virtual Interrupts mapped to core running the enet example, EVENTS from UDMA.
    Rings for handling both Tx & Rx descriptor List.

    Best Regards,
    Sudheer

  • Hi Sudheer,

    What I can see from "rm-cfg.c" file (link to e2e ticket: "https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1097038/faq-tda4vm-workflow-and-resource-allocation-build-flow-for-sysconfig-tool") that for MAIN R5F core (referred as MCU2_0 in TI PDK) has RX flows only allocated to MCU NAVSS UDMA. No Rx flow is allocated to MAIN NAVSS UDMA. In that scenario, it is feasible from MCU2_0 to use MAIN NAVSS UDMA for CPSW2G ethernet frame transfers ?

    Best regards,
    Hasan

  • Hi,

    ) that for MAIN R5F core (referred as MCU2_0 in TI PDK) has RX flows only allocated to MCU NAVSS UDMA. No Rx flow is allocated to MAIN NAVSS UDMA. In that scenario, it is feasible from MCU2_0 to use MAIN NAVSS UDMA for CPSW2G ethernet frame transfers ?

    Main Domain Cores can use MCU NAVSS DMA and similar MCU Domain cores can use MAIN NAVSS DMA.

    Also, 
    In case of loopback example MCU2_0/MCU_21 from Main Domain used MAIN NAVSS DMA for CPSW.

    Allocation of resources will be taken care by UDMA Driver, no need to worry about the resource information.

    Note:
    I have already confirmed loopback example from TI on MCU2_0 with changes mentioned in below E2E.
    e2e.ti.com/.../tda4vm-failed-to-open-enet-dma-rx-channel

    Best Regards,
    Sudheer

  • Hi,

    Sudheer said:
    I have already confirmed loopback example from TI on MCU2_0 with changes mentioned in below E2E.
    e2e.ti.com/.../tda4vm-failed-to-open-enet-dma-rx-channel

    Which PDK version did you use to confirm loopback example?

    Best regards,
    Hasan

  • HI,

    Sudheer said:
    I have already confirmed loopback example from TI on MCU2_0 with changes mentioned in below E2E.
    e2e.ti.com/.../tda4vm-failed-to-open-enet-dma-rx-channel

    Which PDK version did you use to confirm loopback example?

    I have tested on SDK 8.6.
    It will be same for higher SDK versions as well.

    Best Regards,
    Sudheer

  • Hi Sudheer,

    In case of loopback example MCU2_0/MCU_21 from Main Domain used MAIN NAVSS DMA for CPSW.
    What changes do I need to make to use MCU NAVSS DMA for CPSW2G from MCU2_0?

    Best regards,
    Hasan

  • Hi,

    We are always using Main Domain DMA for Main Domain Cores and MCU DMA for MCU Domain cores?
    If you required you can try by changing the DMA instance from Main to MCU from "EnetAppUtils_getNavSSInstanceId"and check.

    TI recommend to use respective domain as per SDK reference.

    Best Regards,
    Sudheer

  • Hi Sudheer,

    Coming back to the original discussion: I have asked that I am not able to access UDMA from MCU2_0 and for that you suggested some changes for UDMA resource allocation (https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1349527/tda4vm-failed-to-open-enet-dma-rx-channel). I am getting the error which I had previously and I am attaching a screenshot of UART log for your reference.




    Can you suggest the possible reason of failure of this failure and what needs to be done in order to solve this error?

    Looking forward to hearing back from you.

    Best regards,
    Hasan

  • Hi,

    Can you please share your changes and build command. 

    I have tested loopback on mcu2_0 for CPSW2G, and shared the steps to build and sequence in e2e shared with you. 

    If you are creating own application & using different UDMA instance you have to take care of all required things, for this refer existing examples from TI SDK. 

    Best Regards, 

    Sudheer

  • Hi Sudheer,

    I am using MAIN NAVSS. 

    Build Commands:

    1. gmake -s BOARD=j721e_evm SOC=j721e CORE=mcu2_0 TREAT_WARNINGS_AS_ERROR=no enet
    2. gmake -s BOARD=j721e_evm SOC=j721e CORE=mcu2_0 TREAT_WARNINGS_AS_ERROR=no enetphy
    3. gmake -s BOARD=j721e_evm SOC=j721e CORE=mcu2_0 TREAT_WARNINGS_AS_ERROR=no enetsoc
    4. gmake -s BOARD=j721e_evm SOC=j721e CORE=mcu2_0 TREAT_WARNINGS_AS_ERROR=no enet_example_utils_baremetal

    Changes:

        gEnetLpbk.enetType        = ENET_CPSW_2G;
        gEnetLpbk.instId          = 0U;
        gEnetLpbk.macPort         = ENET_MAC_PORT_1;
        gEnetLpbk.macMode         = RGMII;
        gEnetLpbk.boardId         = ENETBOARD_LOOPBACK_ID;



    static EnetRm_ResPrms gEnetAppRmDefCfg_2G =
    {
        .coreDmaResInfo =
        {
            [0] =
            {
                .coreId        = IPC_MPU1_0,
                .numTxCh       = 2U,
                .numRxFlows    = 2U,
                .numMacAddress = 1U,
            },
            [1] =
            {
                .coreId        = IPC_MCU2_0,//IPC_MCU2_1,
                .numTxCh       = 2U,
                .numRxFlows    = 2U,
                .numMacAddress = 1U,
            },
            [2] =
            {
                .coreId        = IPC_MCU1_0,
                .numTxCh       = 4U,
                .numRxFlows    = 4U,
                .numMacAddress = 1U,
            },
        },
        .numCores = 3,
    };



    Uart Logs:




    Looking forward to hearing back from you.

    Best regards,
    Hasan

  • Hi,

    • gmake -s BOARD=j721e_evm SOC=j721e CORE=mcu2_0 TREAT_WARNINGS_AS_ERROR=no enet
    • gmake -s BOARD=j721e_evm SOC=j721e CORE=mcu2_0 TREAT_WARNINGS_AS_ERROR=no enetphy
    • gmake -s BOARD=j721e_evm SOC=j721e CORE=mcu2_0 TREAT_WARNINGS_AS_ERROR=no enetsoc
    • gmake -s BOARD=j721e_evm SOC=j721e CORE=mcu2_0 TREAT_WARNINGS_AS_ERROR=no enet_example_utils_baremetal

    Use Make file similar to loopback example and build the application.
    From above build commands I could not find loopback example build.

    Please use TI SDK as is along with changes suggested to run on MCU2_0 first, later you can modify the application as needed.

    Best Regards,
    Sudheer

  • Hi Sudheer,

    I have an application build on my side using loopback example. I debug my application and may be the root cause of this "Udma [Error] RM PSI pairing failed"  error is lies in the sciclient_rm.c . When sciclient request from sciserver, in response what I received is message not acknowledged. I am attaching the screenshot below.



    Can you have a look and suggest me when I am getting this error and how to get rid of this error?

    Looking forward to hearing back from you.

    Best regards,
    Hasan   

  • Hi,

    Are you using MCUNAVSS DMA from Main R5F? If so, we have not tested this.
    We are always using MCU NAVSS for MCU R5F cores and Main NAVSS for Main R5F cores.

    If you are using TI SDK as is along with changes suggested for Porting to MCU2_0. You should not observe any issue.

    As informed above, please enable first TI SDK as is with MCU2_0 and then make your own changes as required on tip of it.

    Best Regards,
    Sudheer

  • Hi Sudheer,

    I am using MAIN NAVSS from MAIN R5F core. In case of using MCU NAVSS from MCU R5F I am not having any issues.

    I am only having issues in pairing PSIL in case of using MAIN NAVSS from MAIN R5F. 

    I am using baremetal for development. I have modified loopback example in the main functional call in MAIN R5F.
    I am running the sciserver in MCU R5F and the sciclient is initialized in MAIN R5F core and from MAIN R5F I am request for PSIL pairing.
    The request is not acknowleged and I am getting in response 0 flags.

    Best regards,
    Hasan

  • Hi,

    I am using baremetal for development. I have modified loopback example in the main functional call in MAIN R5F.

    I am not sure what changes you have made in your application.

    I am running the sciserver in MCU R5F and the sciclient is initialized in MAIN R5F core and from MAIN R5F I am request for PSIL pairing.
    The request is not acknowleged and I am getting in response 0 flags.

    UDMA should be initialized before the PSIL pair mapping request.
    Also, is Sciserver is from TI SDK or not? If not check whether your are using proper one or not?
    As far as I know SciServer is RTOS based application.

    Check the call trace in case of MCU R5F as it is working for you.
    Also, check the call trace of Main R5F and compare both.

    Also, check the UDMA instance being used while running your application.


    Best Regards,
    Sudheer

  • Hi Sudheer,

    I am sharing you the changes I have made in the application. Please have a look in the code attached.

    UDMA is initialized with UDMA_INST_ID_0 in case of MAIN R5F core. The sciserver I am using is from TI PDK v8.02.

    void main()
    {
    
        /* init the sci client */
        Sciclient_ConfigPrms_t  sciClientCfg;
        Sciclient_configPrmsInit(&sciClientCfg);
        Sciclient_init(&sciClientCfg);
    
        EnetBoard_init();
    
    
        gEnetLpbk.enetType        = ENET_CPSW_2G;
        gEnetLpbk.instId          = 0U;
        gEnetLpbk.macPort         = ENET_MAC_PORT_1;
        gEnetLpbk.macMode         = RGMII;
        gEnetLpbk.boardId         = ENETBOARD_LOOPBACK_ID;
    
        EnetOsal_Cfg osalCfg;
        EnetUtils_Cfg utilsCfg;
        Enet_IoctlPrms prms;
        uint32_t status;
    
        /* Local core id */
        gEnetLpbk.coreId = EnetSoc_getCoreId();
    
        /* Initialize Enet driver (use default OSAL and utils) */
        Enet_initOsalCfg(&osalCfg);
        Enet_initUtilsCfg(&utilsCfg);
        Enet_init(&osalCfg, &utilsCfg);
    
        /* Open Enet driver */
        status = EnetLpbk_openEnet();
        if (status != ENET_SOK)
        {
            EnetAppUtils_print("Failed to open Enet driver: %d\n", status);
        }
        
    }
    
    uint32_t EnetLpbk_openEnet(void)
    {
        Cpsw_Cfg cpswCfg;
        EnetUdma_Cfg dmaCfg;
    
        Enet_IoctlPrms prms;
        EnetPer_PortLinkCfg portLinkCfg;
        CpswMacPort_Cfg macCfg;
        uint32_t status = ENET_SOK;
    
        cpswCfg.dmaCfg = &dmaCfg;
    
        /* Initialize peripheral config */
        EnetLpbk_initCpswCfg(&cpswCfg);
        if (gEnetLpbk.enetType == ENET_CPSW_2G)
        {
            EnetAppUtils_print("CPSW_2G Test on MAIN NAVSS\n");
        }
    
        /* Set DMA receive channel priority as default */
        dmaCfg.rxChInitPrms.dmaPriority = UDMA_DEFAULT_RX_CH_DMA_PRIORITY;
    
        /* App should open UDMA first as UDMA handle is needed to initialize CPSW RX channel */
        gEnetLpbk.hUdmaDrv = EnetAppUtils_udmaOpen(gEnetLpbk.enetType, NULL);
        EnetAppUtils_assert(NULL != gEnetLpbk.hUdmaDrv);
        
        /* Global DMA driver handle */
        dmaCfg.hUdmaDrv = gEnetLpbk.hUdmaDrv;
    
        /* Set Enet global runtime log level */
        Enet_setTraceLevel(ENET_TRACE_DEBUG);
    
        /* Open the Enet driver */
        gEnetLpbk.hEnet = Enet_open(gEnetLpbk.enetType, gEnetLpbk.instId, &cpswCfg, sizeof(cpswCfg));
        if (gEnetLpbk.hEnet == NULL)
        {
            EnetAppUtils_print("Failed to open Enet driver\n");
            status = ENET_EFAIL;
        }
    
        /* Setup link open parameters */
        if (status == ENET_SOK)
        {
            EnetMacPort_LinkCfg *linkCfg = &portLinkCfg.linkCfg;
            EnetMacPort_Interface *mii = &portLinkCfg.mii;
            EnetPhy_Cfg *phyCfg = &portLinkCfg.phyCfg;
    
            /* Set port link params */
            portLinkCfg.macPort = gEnetLpbk.macPort;
            portLinkCfg.macCfg = &macCfg;
    
            /* Enable MAC loopback */
            CpswMacPort_initCfg(&macCfg);
            macCfg.loopbackEn = true;
    
            /* No PHY loopback */
            phyCfg->phyAddr = ENETPHY_INVALID_PHYADDR;
    
            /* Regular RGMII for everything else */
            mii->layerType    = ENET_MAC_LAYER_GMII;
            mii->sublayerType = ENET_MAC_SUBLAYER_REDUCED;
            mii->variantType  = ENET_MAC_VARIANT_FORCED;
            macCfg.sgmiiMode  = ENET_MAC_SGMIIMODE_INVALID;
    
    
            /* Set up link params */
            linkCfg->speed     = ENET_SPEED_100MBIT; //ENET_SPEED_1GBIT
            linkCfg->duplexity = ENET_DUPLEX_FULL;
        }
    
        /* Overwrite the ENET control set by board lib */
        EnetBoard_setEnetControl(gEnetLpbk.enetType, gEnetLpbk.instId, gEnetLpbk.macPort, gEnetLpbk.macMode);
        
        /* Open port link */
        if (status == ENET_SOK)
        {
            ENET_IOCTL_SET_IN_ARGS(&prms, &portLinkCfg);
    
            status = Enet_ioctl(gEnetLpbk.hEnet, gEnetLpbk.coreId, ENET_PER_IOCTL_OPEN_PORT_LINK, &prms);
            if (status != ENET_SOK)
            {
                EnetAppUtils_print("Failed to open port link: %d\n", status);
            }
        }
    
        return status;
    }



    Best regards,
    Hasan

  • Hi,

    If you look at loopback example we are having open DMA for enabling of Tx & Rx channels
    ALE configuration for packet forwarding and recpetion.
    Along with above Task for Tx & Rx hadndling.

    I could not found above in your examples.

    As informed earlier, First test TI SDK as is and then modify the TI SDK as per your requirement.

    May I know what you want to do by modifying the loopback example.

    Best Regards,
    Sudheer