TI专家很好。
AM437x上的CPSW端口(千兆端口)和两个PRU-ICSS端口)有一个需要同时使用100米的项目,但现在有NIMU_BasicExample和NIMU_ICSS_BasicExample
PRU-ICSS1网络端口配置代码如下
/* 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 )
创建//rx接收事件
Task_Params taskParams;
task_Params_init(taskParams );
taskParams.priority=10;
task params.instance-name=(char * ) ' port1_rxTaskFnc ';
taskParams.stackSize=0x1000;
任务params.arg0=(uarg ) emacHandle1;
(ICSS_EmacObject* ) emacHandle1-object )-rxtaskhandle=task _ create (icss _ emacosrxtaskfnc,taskParams,nula
PRU-ICSS2的网关配置代码如下:
/* 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)
创建//rx接收事件
Task_Params taskParams;
task_Params_init(taskParams );
taskParams.priority=10;
task params.instance-name=(char * ) ' port2_rxTaskFnc ';
taskParams.stackSize=0x1000;
任务params.arg0=(uarg ) emacHandle2;
(ICSS_EmacObject* ) emacHandle2-object )-rxtaskhandle=task _ create (icss _ emacosrxtaskfnc,taskParams,nula
三个网络端口与NIMUDeviceTable的对应关系如下。
配置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
语音网络(
{
//创建our local servers
hecho=daemonnew(sock_streamNC,0,502,dtask_tcp_echo,
OS_TASKPRINORM,OS_TASKSTKNORM,0,3;
}
问题是,上述配置完成后,可以进行ping,但无法进行TCP通信,并且dtask_tcp_echo没有任何响应。 如果删除了CPSW入口,dtask_tcp_echo将成功运行,并且单独运行NIMU_BasicExample例程没有问题。
我想请TI专家回答,问题在哪里? 我应该怎么找?