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.

6678 SGMII0连接网口无法与PC通信(无法ping通 STK测试显示wait for port 0 phy link)

现象描述:

使用第三方的硬件板,设计与EVM一致(DDR时钟与SRIO时钟),但在网口上使用的是SGMII0,而EVM板使用的是SGMII1。我曾经在硬件板上测试网口是可以通信的,但是放置一段时间后,由于没有留存先前代码,重新建立工程测试,发现已经无法和PC通信了。

 

我的代码来源以及调试过程如下:

首先,我修改了PDK目录(pdk_C6678_1_1_2_6\packages\ti\platform\evmc6678l\)下的6678平台库中的platform.c文件,将Init_SGMII(1)修改为Init_SGMII(0),因为时钟和EVM板一致,故没有做其他的修改,rebuild此库。然后,我在MCSDK提供的Helloworld程序中,修改了IP地址,让PC和DSP处于同一网段内,以及禁用了DHCP,rebuild工程,下载。打印输出如下信息:

--------------------------------------------------------------------

[C66xx_0] QMSS successfully initialized
CPPI successfully initialized
PA successfully initialized

TCP/IP Stack 'Hello World!' Application

TCP/IP Stack 'Hello World!' Application

PASS successfully initialized
Ethernet subsystem successfully initialized
Ethernet eventId : 48 and vectId (Interrupt) : 7
Registration of the EMAC Successful, waiting for link up ..
Network Added: If-1:169.254.98.1

------------------------------------------------------------------

但是使用PC ping却无法ping通 ,结果如下:

我排查了网线的问题(连接两台PC是可以ping通的)

 

此外,我使用了STK中的GE程序,进行回环测试,都是通过的。然后进行如下代码修改,切换到DSP0到DSP1的测试模式,

/*select between internal/external loopback test or test between two DSPs*/
//GE_Test_Data_Path test_data_path= GE_TEST_SERDES_LOOPBACK;//modify
GE_Test_Data_Path test_data_path= GE_TEST_DSP0_TO_DSP1;

/*select between 10/100/1000Mbps or auto negotiation mode*/
//Ethernet_Mode ethernet_mode = ETHERNET_1000M_FULLDUPLEX;//modify
Ethernet_Mode ethernet_mode = ETHERNET_AUTO_NEGOTIAT_SLAVE;
//The port connection state for the test
GE_Port_Connection port_connect[GE_NUM_ETHERNET_PORT]=
{

        GE_PORT_CABLE_CONNECT, //SGMII port 0
        GE_PORT_NOT_USED  //SGMII 1
        
};

并且将目标MAC也修改为PC的MAC。

rebuild,load之后。则打印信息显示wait for port 0 phy link ,如图:

 

发现是在如下代码中一直循环:

while(0==(gpMDIO_regs->LINK_REG&(1<<i)))
{
        if(TSC_count_cycle_from(uiStartTSC)>0x3FFFFFFF)
        {
                printf("Wait for port %d PHY link...\n", i);
                uiStartTSC= TSCL;
        }
}

检查gpMDIO_regs->LINK_REG的值,为0;

但是上述程序,在EVM板上则是完全可以跑通的,可以实现与PC的通信。

在论坛上看了很多帖子,发现很多人都遇到这个问题,我理解的是:这个现象大致是DSP与PHY芯片之间没有link成功。但是是什么原因导致link不成功,不太明确,我现在遇到这个问题也是非常头疼,完全没有解决的思路~

 

烦请各位大佬拨冗指导一下!非常感谢

 

其他信息:

芯片型号:6678

MCSDK/Processor SDK版本:mcsdk_2_01_02_06  pdk_C6678_1_1_2_6

CCS版本:6.2

OS:windows 10

  • 请查看下面的FAQ和附件代码关于如何使能EMAC0。

    Q: Where and how to enable the EMAC0 on C6678 EVM's AMC connector?

    A:C6678 processor has support for two EMAC interfaces, one of which EMAC1 is connected to Gigabit RJ-45 connector of Shannon C6678 EVM whereas EMAC0 had been connected to AMC connector of Shannon C6678 EVM.

    By default, NIMU driver does not have a support for EMAC0 on AMC connector, TI has provided the files for enabling EMAC0 on EVM's AMC connector in the following attachment.

    Please note that the current NIMU driver doesn't support simultaneous NDK support on both EMAC ports.The attached code is based on "mcsdk_2_01_02_06" release.
    4130.NIMU-EMAC0.zip