TI專家很好。
AM437x上的CPSW端口(千兆端口)和兩個PRU-ICSS端口)有一個需要同時使用100米的項目,但現(xiàn)在有NIMU_BasicExample和NIMU_ICSS_BasicExample
PRU-ICSS1網(wǎng)絡(luò)端口配置代碼如下
/* icss-emac port 1初始化* /
EMAChandle1=(icss_emachandle ) malloc ) sizeof (icss _ emac config );
switchemaccfg1=(icss _ emacinitconfig * ) malloc ) sizeof(icss_emacinitconfig );
switchEmacCfg1-phyAddr[0]=0;
switchEmacCfg1-phyAddr[1]=0;
sitchemaccfg1- port mask=icss _ emac _ mode _ MAC 1;
switchemaccfg1- ethprioqueue=icss _ emac _ queue 1;
switchemaccfg1- halfduplexenable=1;
switchemaccfg1- enableintrpacing=icss _ emac _ enable _ pacing;
switchemaccfg1- icss _ emacintrpacingmode=icss _ emac _ intr _ pacing _ mode 1;
switchemaccfg1- pacing threshold=100;
switchEmacCfg1-learningEn=0;
switchEmacCfg1-rxIntNum=52; //PRU_ICSS1_EVTOUT0
switchEmacCfg1-linkIntNum=58; //PRU_ICSS1_EVTOUT6
socctrlgetportmacaddr(1,MacAddr1; 獲取//MAC地址
switchEmacCfg1-macId=MacAddr1;
icssemacdrvinit (emac手持機1,1;
(ICSS_EmacObject* ) emacHandle1-object )-pruIcssHandle=pruIcssHandle;
(ICSS_EmacObject* ) emacHandle1-object )-emacInitcfg=switchEmacCfg1;
//中斷和EMAC模式配置
pruicss _ intcinitdatapruss _ intc _ initdata=pr USS _ intc _ initdata;
ICSS_emacinit(EMAChandle1,pruss_intc_initdata,icss _ emac _ mode _ MAC1| icss _ emac _ mode _ du du du du du al MAC )
創(chuàng)建//rx接收事件
Task_Params taskParams;
task_Params_init(taskParams );
taskParams.priority=10;
task params.instance-name=(char * ) ' port1_rxTaskFnc ';
taskParams.stackSize=0x1000;
任務(wù)params.arg0=(uarg ) emacHandle1;
(ICSS_EmacObject* ) emacHandle1-object )-rxtaskhandle=task _ create (icss _ emacosrxtaskfnc,taskParams,nula
PRU-ICSS2的網(wǎng)關(guān)配置代碼如下:
/* icss-emac port 2初始化* /
EMAChandle2=(icss_emachandle ) malloc ) sizeof (icss _ emac config );
switchemaccfg2=(icss _ emacinitconfig * ) malloc ) sizeof(icss_emacinitconfig );
switchEmacCfg2-phyAddr[0]=1;
switchEmacCfg2-phyAddr[1]=0;
sitchemaccfg2- port mask=icss _ emac _ mode _ MAC 2;
switchemaccfg2- ethprioqueue=icss _ emac _ queue 3;
switchemaccfg2- halfduplexenable=1;
switchemaccfg2- enableintrpacing=icss _ emac _ disable _ pacing;
switchemaccfg2- pacing threshold=100;
switchEmacCfg2-learningEn=0;
switchEmacCfg2-rxIntNum=53; //PRU_ICSS1_EVTOUT1
switchEmacCfg2-linkIntNum=59; //PRU_ICSS1_EVTOUT7
socctrlgetportmacaddr(2,MacAddr2; 獲取//MAC地址
switchEmacCfg2-macId=MacAddr2;
icssemacdrvinit (emac手持機2,1 );
(ICSS_EmacObject* ) emacHandle2-object )-pruIcssHandle=pruIcssHandle;
(ICSS_EmacObject* ) emacHandle2-object )-emacInitcfg=switchEmacCfg2;
//中斷和EMAC模式配置
pruicss _ intcinitdatapruss _ intc _ initdata=pr USS _ intc _ initdata;
ICSS_emacinit(EMAChandle2,pruss_intc_initdata,icss _ emac _ mode _ MAC2)
創(chuàng)建//rx接收事件
Task_Params taskParams;
task_Params_init(taskParams );
taskParams.priority=10;
task params.instance-name=(char * ) ' port2_rxTaskFnc ';
taskParams.stackSize=0x1000;
任務(wù)params.arg0=(uarg ) emacHandle2;
(ICSS_EmacObject* ) emacHandle2-object )-rxtaskhandle=task _ create (icss _ emacosrxtaskfnc,taskParams,nula
三個網(wǎng)絡(luò)端口與NIMUDeviceTable的對應(yīng)關(guān)系如下。
配置NIMUDeviceTable門戶
OS drv _ addnetifentry ((nimuinitfn ) EmacInit,emacHandle1); //PRU-ETH0
OS drv _ addnetifentry ((nimuinitfn ) EmacInit,emacHandle2); //PRU-ETH1
OS drv _ addnetifentry ((nimuinitfn ) CpswEmacInit,0 ); //CPSW
//TCP
語音網(wǎng)絡(luò)(
{
//創(chuàng)建our local servers
hecho=daemonnew(sock_streamNC,0,502,dtask_tcp_echo,
OS_TASKPRINORM,OS_TASKSTKNORM,0,3;
}
問題是,上述配置完成后,可以進行ping,但無法進行TCP通信,并且dtask_tcp_echo沒有任何響應(yīng)。 如果刪除了CPSW入口,dtask_tcp_echo將成功運行,并且單獨運行NIMU_BasicExample例程沒有問題。
我想請TI專家回答,問題在哪里? 我應(yīng)該怎么找?