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.
Tool/software: TI-RTOS
Basic Infomation:
Board:Base IDKAM437x
PDK:ti-processor-sdk-rtos-am437x-evm-03.01.00.06-Windows-x86
NDK:ndk_2_24_03_35
Hi TI Expert:
My application need to use the three ethernet port(both cpsw gigabit port and pru-icss ethernet),and I try to combine NIMU_Basic_Example and NIMU_ICSS_BasicExample project,the three ehternet port has been assigned seperate subway IP-Address ,and the command "ping xx.xx.xx.xx" works fine。
But when I use DaemonNew function to create TCP connection(just simple tcp echo),it could not establish TCP connection 。 But when i only use the two pru-icss ethernet port,the tcp connection is ok and tcp echo works fine。
Here are some code:
ICSS-EMAC Port 1 initializations
emacHandle1 = (ICSS_EmacHandle)malloc(sizeof(ICSS_EmacConfig)); switchEmacCfg1 = (ICSS_EmacInitConfig*)malloc(sizeof(ICSS_EmacInitConfig)); switchEmacCfg1->phyAddr[0]=0; switchEmacCfg1->phyAddr[1]=0; switchEmacCfg1->portMask = ICSS_EMAC_MODE_MAC1; switchEmacCfg1->ethPrioQueue = ICSS_EMAC_QUEUE1; switchEmacCfg1->halfDuplexEnable = 1; switchEmacCfg1->enableIntrPacing = ICSS_EMAC_ENABLE_PACING; switchEmacCfg1->ICSS_EmacIntrPacingMode = ICSS_EMAC_INTR_PACING_MODE1; switchEmacCfg1->pacingThreshold = 100; switchEmacCfg1->learningEn = 0; switchEmacCfg1->rxIntNum = 52; //PRU_ICSS1_EVTOUT0 switchEmacCfg1->linkIntNum=58; //PRU_ICSS1_EVTOUT6 SOCCtrlGetPortMacAddr(1,MacAddr1); //获取MAC地址 switchEmacCfg1->macId = MacAddr1; ICSSEmacDRVInit(emacHandle1, 1); ((ICSS_EmacObject*)emacHandle1->object)->pruIcssHandle = pruIcssHandle; ((ICSS_EmacObject*)emacHandle1->object)->emacInitcfg = switchEmacCfg1; PRUICSS_IntcInitData pruss_intc_initdata = PRUSS_INTC_INITDATA; ICSS_EmacInit(emacHandle1,&pruss_intc_initdata,ICSS_EMAC_MODE_MAC1|ICSS_EMAC_MODE_DUALMAC); Task_Params taskParams; Task_Params_init(&taskParams); taskParams.priority = 10; taskParams.instance->name = (char*)"port1_rxTaskFnc"; taskParams.stackSize = 0x1000; taskParams.arg0 = (UArg)emacHandle1; ((ICSS_EmacObject*)emacHandle1->object)->rxTaskHandle = Task_create(ICSS_EMacOsRxTaskFnc, &taskParams, NULL);
ICSS-EMAC PORT2 Initializations
emacHandle2 = (ICSS_EmacHandle)malloc(sizeof(ICSS_EmacConfig)); switchEmacCfg2 = (ICSS_EmacInitConfig*)malloc(sizeof(ICSS_EmacInitConfig)); switchEmacCfg2->phyAddr[0]= 1; switchEmacCfg2->phyAddr[1]= 0; switchEmacCfg2->portMask = ICSS_EMAC_MODE_MAC2; switchEmacCfg2->ethPrioQueue = ICSS_EMAC_QUEUE3; switchEmacCfg2->halfDuplexEnable = 1; switchEmacCfg2->enableIntrPacing = ICSS_EMAC_DISABLE_PACING; switchEmacCfg2->pacingThreshold = 100; switchEmacCfg2->learningEn = 0; switchEmacCfg2->rxIntNum = 53; //PRU_ICSS1_EVTOUT1 switchEmacCfg2->linkIntNum=59; //PRU_ICSS1_EVTOUT7 SOCCtrlGetPortMacAddr(2,MacAddr2); switchEmacCfg2->macId = MacAddr2; ICSSEmacDRVInit(emacHandle2,1); ((ICSS_EmacObject*)emacHandle2->object)->pruIcssHandle = pruIcssHandle; ((ICSS_EmacObject*)emacHandle2->object)->emacInitcfg = switchEmacCfg2; PRUICSS_IntcInitData pruss_intc_initdata = PRUSS_INTC_INITDATA; ICSS_EmacInit(emacHandle2,&pruss_intc_initdata,ICSS_EMAC_MODE_MAC2|ICSS_EMAC_MODE_DUALMAC); Task_Params taskParams; Task_Params_init(&taskParams); taskParams.priority = 10; taskParams.instance->name = (char*)"port2_rxTaskFnc"; taskParams.stackSize = 0x1000; taskParams.arg0 = (UArg)emacHandle2; ((ICSS_EmacObject*)emacHandle2->object)->rxTaskHandle = Task_create(ICSS_EMacOsRxTaskFnc, &taskParams, NULL);
NetifEntry and NIMUDeviceTable code
OSDRV_addNetifEntry((NIMUInitFn)&EmacInit,emacHandle1); //PRU-ETH0 OSDRV_addNetifEntry((NIMUInitFn)&EmacInit,emacHandle2); //PRU-ETH1 OSDRV_addNetifEntry((NIMUInitFn)&CpswEmacInit,0); //CPSW
My question is :
1、Does NDK support three ehternet Port(both cpsw gigabit port and pru-icss ethernet)?
2、Or is there something wrong with my code?How should I do to solve the problem?
Please help me,many thanks!
dcount107 2019.4.12