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 network fails to connect host

Hi, I encountered a strange problem while using 6678 network connecting to the host(my PC). I referenced the NDK example HelloWorld to develop my own program. In the program, it tries to connect the host after the successful initialization of network. Sometimes it can connect to the host successfully, but sometimes it fails to connect to the host. When it fails to connect to the host, I check the status of the network and find everything is initialized successfully. But when I PING the board from my PC, it tells "destination-host-unreachable". So, right now, I can't locate where is the error? Can anyone give me some hints or suggestions about from where should I to solve the problem? thanks.

  • Hi,
    Able to run the NDK hello world example code successfully at all the time ?
    Able to get IP address after successful EMAC initialization ?
    What changes have you been made ?
    Did you try to revert the code and able to fix that problem ?

    Try to debug the code and see where it get hang if any.
  • Titusrathinaraj Stalin said:
    Hi,
    Able to run the NDK hello world example code successfully at all the time ?
    Able to get IP address after successful EMAC initialization ?
    What changes have you been made ?
    Did you try to revert the code and able to fix that problem ?

    Try to debug the code and see where it get hang if any.

    1. yes, HelloWorld example can run successfully each time.

    2. yes.

    3. I only change the code in the task, which use connect() function to connect the host first.

    4. How to revert the code?

    When it fails to connect to the host, the program prints the error code 65. The problem is random, I have tried to boot the program 10 times, it happens 3 times.

  • Hi,
    What is your board ?
    Custom or EVM ?
    Able to reproduce ?
    Help us to reproduce this at my end.

    2. yes.

    You said that you got IP address but not able to ping, right ?
    What is the "connect()" function.
    If you comment out the "connect" function, able to ping the C6678 from host PC all the time ?
  • Hi, the board is Custom, and I have tried other boards, the phenomenon is same.

    "connect()" is the socket function from NDK, I will try to comment it and reply you later.

    thanks.

  • Hi, I have tried to comment "connect()", the problem still exists.

    I also tried to boot the program from NAND FLASH, it had same problem. But when I compare the code of initialization of SERDES and SGMII, I found that in the GEL file evmc6678l.gel, it initialize CPSW, but in the platform_lib CPSW is not initialized. Another difference: in the GEL file, it initialized some registers of SGMII, such as SGMII_MAXLEN, but in platform_lib these registers are not initialized.
    Since the IBL does not initialize SERDES and SGMII, it only initializes PA PLL, so SERDES and SGMII are only initialized by platform_lib. But if I load the program in CCS, the SERDES and SGMII are initialized by GEL first, and when I run the program, some of their registers will be initialized second time. So, about this phenomenon, can you provide me a complete demo code or process of the initialization of network hardware. Right now I am a little confused about which registers should be initialized and which should not.
    thanks.