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.

NDK not working occationally

Other Parts Discussed in Thread: SYSBIOS

Hello 

some problems of NDK:

1.  At the first time system starts , sometimes my NDK will work and response to ping command, but sometimes 

my NDK will not work and doesn't response to ping command.  I used wireshark to check the ethernet packet, and it showed that PC is sending ARP request repeatedly but NDK doesn't response at all.

2. Sometimes NDK starts working, and the TCP communication between PC and NDK works well. But if PC stops TCP communication for a while, and than PC try to start another TCP connection again, NDK failed to response. No communication between PC and NDK is possible after that point.

I don't known why sometimes NDK works but sometimes NDK doesn' t work. 

my platform: 

C6474, NDK 2.1.0

L2 cache: 32K 

 

  • Hi,

    How are you validating NDK stack stopped sometime when using TCP?
    Did you check with CCS, where is it hanging the code?
    Might be this issue cause of memory, You can also create the new thread in TI-RTOS forum as per below link, so that you can get fast response from expert.
    http://e2e.ti.com/support/embedded/tirtos/default.aspx
    Right now I do not have the C6474 based board to test this issue. I can suggest if you provide some more details.

  • Hi,

    How you tested and confirmed this issue? The IP address lost the ping while you sending the packets through TCP socket long time. I can suggest you to check with NDK helloworld example, this have configured the IP address for Board, you just run this example on EVM using CCS/Emulator, do not use UDP or TCP to send or receive the packet. Just ping the IP address, check the ping lost is there if yes, where it is halt the program.

  • Thanks for your reply !

    For the second issue:

    Now I check the second issue again, and found out that NDK does not response to ping after sending through TCP socket long time is cause by other tasks. Some of the task in my program will block in a loop and keep the DSP busy in that loop.Hence NDK naturally will not work.

    But for the first issue,the problem remains:

    Sometimes my NDK will not work and doesn't response to ping command. I use CCS to check which point the program is running. I found that it is either in Hwi_checkStack() at Hwi_statck.c or in ti_sysbios_knl_Idle_loop_E at Idle.c.
    I try to unplug the ethernet cable and plug it again. The NDK doesn't reconnect the ethernet again.
    This doesn't always happen. Sometimes it will work and sometimes it will fail.

      

     

     

  • Now  I ping the DSP 4 times, the first 3 times NDK response well. At the fourth time, the NDK failed to response. And I found that DSP is stuck in the code with red color below.

    In ethdriver.c

    void HwTxInt(void)
    {
     Uint32 i;
     CSL_SemVal response;

        if (hEMAC)
        {
            i = EMAC_TxServiceCheck(hEMAC);

      if(i)
      {
       if (i == EMAC_ERROR_MACFATAL)
        emac_fatal_error++;
       else
        csl_errors++;
      }

      /* Check Whether Handle opened Successfully and then read module status*/
      if(hSemHandle1!= NULL)
      {
             /* Check whether semaphore resource is Free or not*/
            do {
                 /* Get the semaphore*/
              CSL_semGetHwStatus(hSemHandle1,CSL_SEM_QUERY_DIRECT,&response);
             } while (response.semFree != CSL_SEM_FREE);

             /* write the EOI register */
       EMAC_txEoiWrite(coreNum);

          /* Release the semaphore*/
          CSL_semHwControl(hSemHandle1, CSL_SEM_CMD_FREE_DIRECT,NULL);
         }
        }

        return;
    }

  • Hi,

    Please test the helloworld example on EVM C6474 based, if you have it. Make sure you are not use UDP or TCP for send/receive. In this case ping the board IP and let us know the status. Are you using the customized application code in your test setup? I hope, you found the cause of  ping failed when use the TCP connection, you can manage the task memory, priority to make the success for TCP send/receive.