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.

"Timeout waiting for reply from PA to Pa_addMac command"

I was able to successfully run the Client example on a device at work from:

C:\ti\mcsdk_2_00_05_17\examples\ndk\client

The device at work consists of a 6678 DSP.

When I merged the Client example into the device application, I included all the required libraries and header files so the project was built successfully. The heap was increased to accommodate the example usage.

Upon running the application, it always spit out the following error:

...
Timeout waiting for reply from PA to Pa_addMac command
Add_MACAddress failed
...

Any ideas what is causing that problem? Both the projects were built with the same CCS configuration but only the Client example works.

Here are my revisions:

- CCS 5.2.1.00018
- MCSDK 2.0.5.16
- MCSDK PDK (6678) 1.0.0.17
- SYS/BIOS 6.32.5.54 
- NDK 2.20.4.26

  • Hi A.S,

    This error seems to come out from the function "setmacs";  This error denotes that is not able to set the MAC address.

    You have mentioned that the client ndk example works before merging with your APP.

    After merging it doesnot work.  It is able to set the MAC address successfully when you use just the client example but it is not able to set the MAC address after you merged the code.  

    Try debugging the programs ( Just the example code VS merged code) and find what is causing the function setmac to fail. Observe the code flow in both the cases.

    Regards,

    Shankari

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

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------

  • Hi Shankari,

    The error message is coming from the function "Add_MACAddress()" located in the file "nimu_eth.c". Since this is part of the NDK library, I cannot step into the code while debugging.

    All I know is that the loop exited after 100 iterations:

    /* Poll on the PA response queue to see if response from PA has come */
    for (j = 0; j < 100; j++)
    {
    platform_delaycycles (1000);

    /* Verify if we got empty Tx completion Q*/
    count = Qmss_getQueueEntryCount (gTxCmdReturnQHnd);

    if (count != 0) {

    if ((QMSS_QPOP (gTxCmdReturnQHnd, QHANDLER_QPOP_FDQ_ATTACHEDBUF, (Cppi_HostDesc **)&pHostDesc)) != NULL)
    {
    ret_val = -1;
    goto return_fail;
    }

    /* Restore the states */
    Cppi_setSoftwareInfo(Cppi_DescType_HOST, (Cppi_Desc *)pHostDesc, (uint8_t *)myswinfo_orig);
    Cppi_setPSData (Cppi_DescType_HOST, (Cppi_Desc *)pHostDesc, NULL, NULL);
    Cppi_setData (Cppi_DescType_HOST, (Cppi_Desc *)pHostDesc, NULL, NULL);
    Cppi_setOriginalBufInfo (Cppi_DescType_HOST, (Cppi_Desc *)pHostDesc, NULL, NULL);
    Cppi_setPacketLen (Cppi_DescType_HOST, (Cppi_Desc *)pHostDesc, NULL);
    pHostDesc->buffLen = 0;

    QMSS_QPUSHDESCSIZE (gTxCmdFreeQHnd, pHostDesc, SIZE_HOST_DESC);
    }

    if (Qmss_getQueueEntryCount (gPaCfgCmdRespQHnd) > 0)
    {

    /* We have a response from PA PDSP for the command we submitted earlier for
    * MAC address addition.
    */
    if ((QMSS_QPOP (gPaCfgCmdRespQHnd, QHANDLER_QPOP_FDQ_NO_ATTACHEDBUF, (Cppi_HostDesc **)&pHostDesc)) != NULL)
    {
    ret_val = -1;
    goto return_fail;
    }

    if (pHostDesc->softwareInfo0 != cmdReplyInfo.replyId)
    {
    platform_write ("Found an entry in PA response queue with swinfo0 = 0x%08x, expected 0x%08x\n",
    pHostDesc->softwareInfo0, cmdReplyInfo.replyId);
    pHostDesc->buffLen = pHostDesc->origBufferLen;
    QMSS_QPUSH (gTxCmdFreeQHnd, pHostDesc, pHostDesc->buffLen, SIZE_HOST_DESC, Qmss_Location_TAIL);
    ret_val = -1;
    goto return_fail;

    }

    retVal = Pa_forwardResult (res_mgr_get_painstance(), (Ptr)pHostDesc->buffPtr, &retHandle, &handleType, &cmdDest);
    if (retVal != pa_OK)
    {
    platform_write ("PA sub-system rejected Pa_addMac command\n");
    ret_val = -1;
    goto return_fail;
    }

    /* Reset the buffer length and put the descriptor back on the Rx free queue */
    pHostDesc->buffLen = pHostDesc->origBufferLen;
    QMSS_QPUSH (gRxFreeQHnd, pHostDesc, pHostDesc->buffLen, SIZE_HOST_DESC, Qmss_Location_TAIL);
    break;
    }
    }

    if (j == 100)
    {
    platform_write ("Timeout waiting for reply from PA to Pa_addMac command\n");
    ret_val = -1;
    }


    Any ideas? Thanks again.
  • I managed to debug the function "Add_MACAddress()" from the file "nimu_eth.c" and discovered the following line is never true:

         if (Qmss_getQueueEntryCount (gPaCfgCmdRespQHnd) > 0) 

         ... where gPaCfgCmdRespQHnd is the PA Command Response Queue


    So, this means there is no response from the PA PDSP. Also, I got the following error:

    [C66xx_0] NIMUIOCTL Failed with error code: -22

    My questions:

    1) Does that mean the QMSS / CPPI / PA modules were not initialized properly? There is no error during their initializations.

    2) What could be preventing the response from the PA module?

  • Hi,
    Are you using any "Software core reset" in your application code that you merged with "client" app ?
    What are all the stuff that you have in your app code ?
    Have you modified the *.cfg of client app for merging the app code into it?


    When I merged the Client example into the device application, I included all the required libraries and header files so the project was built successfully. The heap was increased to accommodate the example usage.

    Just increased the heap alone in *.cfg ?
  • Hi Titus,

    No, there is no soft reset code in my application and it is used for processing imaging information which requires a lot of internal memory.

    I merged pretty much everything in the example's CFG file that was missing in my application's CFG file. This would include the QMSS, CPPI, PA and NDK libraries. Also the heap was increased to 0x300000 as in the example along with the stack for the task to be using 0x1400.

    At the point, I am out of ideas how to get to work without seeing the following errors when the initialization are fine:

    Timeout waiting for reply from PA to Pa_addMac command
    [C66xx_0] NIMUIOCTL Failed with error code: -22

  • Hi,
    I will try to reproduce this problem at my side and let me update.
    I also faced this error when I did "software reset" , that means, we get into this problem when we enable PA/QMSS/CPPI peripheral when its already enabled.
  • I also executed the GEL file "Global_Default_Setup" before the app started.

  • In what conditions would the function Qmss_getQueueEntryCount() return a count of zero?

    Especially when all initializations are successful and the parameters passed to the QMSS_QPUSH and QMSS_QPOP were all correct.

    Anyone with any ideas? TIA

  • Hi,

    The function Qmss_getQueueEntryCount() returns the number of packets that are currently queued on the queue which is the queue entry count and this API polls/reads the queue’s status register until it returns a non-zero count.

    To my knowledge, if Qmss_queueOpen function() API is not called before calling Qmss_getQueueEntryCount() which is a precondition that fails, it may return a zero count and also if there are no packets currently queued on the queue, therewhich, it returns the queue entry count is zero.

    To know more on QMSS API description, preconditions and return values, please refer the C6678 API ref. html doc. available in the MCSDK 2.0 installation path as below:

    C:\ti\Keystone_MCSDK_02_01\pdk_C6678_1_1_2_6\packages\ti\drv\qmss\docs\doxygen\html\group___q_m_s_s___l_l_d___f_u_n_c_t_i_o_n.html

    Also, you could refer the QMSS/CPPI LLD SDS doc. from the MCSDK installation path as below:

    C:\ti\Keystone_MCSDK_02_01\pdk_C6678_1_1_2_6\docs\CPPI_QMSS_LLD_SDS.pdf

    Thanks & regards,

    Sivaraj K

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

    Please click the Verify Answer button on this post if it answers your question.

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