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.

AWR2944EVM: The communication failure between MSS and DSS by DPM_ioctl in the high-end corner radar demo

Part Number: AWR2944EVM

Hi

     In the high-end corner radar demo, the function DPM_ioctl  realizes some of the DPC control.In this demo, the  function sendResultsExportedCommand calls the function DPM_ioctl  as belows:

void sendResultsExportedCommand(DPM_Buffer *ptrResult){
    int32_t retVal;
    DPC_ObjectDetection_ExecuteResult *dpcResults;
    DPC_ObjectDetection_ExecuteResultExportedInfo exportInfo;
    uint8_t temp[8];
    UART_Transaction  trans;
    UART_Transaction_init(&trans);

    /* Validate DPC results buffer */
    DebugP_assert (ptrResult->size[0] == sizeof(DPC_ObjectDetection_ExecuteResult));

    /* Translate the address: */
    dpcResults = (DPC_ObjectDetection_ExecuteResult *) AddrTranslateP_getLocalAddr((uint32_t)ptrResult->ptrBuffer[0]);

        /*****************************************************************
     * Send notification to data path after results are handled
     *****************************************************************/
    /* Indicate result consumed and end of frame/sub-frame processing */
  
    exportInfo.subFrameIdx = dpcResults->subFrameIdx;
    retVal = DPM_ioctl (gMmwMssMCB.objDetDpmHandle,
                             DPC_OBJDET_IOCTL__DYNAMIC_EXECUTE_RESULT_EXPORTED,
                        &exportInfo,
                        sizeof (DPC_ObjectDetection_ExecuteResultExportedInfo));
    Commandtime=(CycleCounterP_getCount32()-Commandtime)/300;
   
    if (retVal < 0) {
        test_print ("Error: DPM DPC_OBJDET_IOCTL__DYNAMIC_EXECUTE_RESULT_EXPORTED failed [Error code %d]\n",
                    retVal);
        MmwDemo_debugAssert(0);
    }

}

In the test, I conduct this problem, the return value retVal is zero in the MSS demo,but the  DPC_ObjectDetection_ioctl don't recevie any command in the DSS demo.That is to say the MSS has send an command sucessfully by DPM_ioctl , but the DSS demo doesn't receive any data. What is the reason of this?How should I solve it?

Thanks,

BR

Rata

  • Hi Rata,

    If the demo is working correctly, this command must be getting sent to the DSS. I say this because the otherwise the lab will fail an assertion statement and crash.

    DPC_ObjectDetection_frameStart is called at the start of every frame:
    static void DPC_ObjectDetection_frameStart (DPM_DPCHandle handle)
    {
        ...
        
        /* Check if previous frame (sub-frame) processing has completed */
        DPC_Objdet_Assert(objDetObj->dpmHandle, (objDetObj->interSubFrameProcToken == 0));
        objDetObj->interSubFrameProcToken++;
    
        ...
    }
    You can see that objDetObj->interSubFrameProcToken must be zero. objDetObj->interSubFrameProcToken is also set to 1 in the same function later.
    objDetObj->interSubFrameProcToken is set back to 0 when the DSS receives the DPC_OBJDET_IOCTL__DYNAMIC_EXECUTE_RESULT_EXPORTED command. You can see this in datapath/dpc/objectdetection/objdethwaDDMA/objectdetection.c file:
    else if (cmd == DPC_OBJDET_IOCTL__DYNAMIC_EXECUTE_RESULT_EXPORTED)
        {
            ...
    
            /* mark end of processing of the frame/sub-frame by the DPC and the app */
            objDetObj->interSubFrameProcToken--;
        }
    DSS also triggers the rangeproc DPU for the next frame when it receives this command, which is also essential for the lab to keep working.
     
    Can I suggest placing a global volatile counter in this if condition to confirm that you are indeed getting this command on the DSS side once for every frame?
    Regards,
    Aayush
  • Hi Aayush,

       Thanks for your reply.I know what you said, I  done like this below:

        Firstly I change the DPC_ObjectDetection_ExecuteResultExportedInfo  defination  in the MSS and DSS demo:

    typedef struct DPC_ObjectDetection_ExecuteResultExportedInfo_t
    {
        /*! @brief      Sub-frame index, this is in the range [0..numSubFrames - 1].
         *              This is the sub-frame whose results have been exported.
         *              Although this DPC implementation knows what sub-frame to expect as the exports
         *              are expected to be sequential in sub-frames, this field helps
         *              in error checking when for example the application could miss
         *              exporting/consuming a sub-frame in a timely manner or have out of order
         *              export/consumption. */
        uint32_t        framecount;
        uint8_t         subFrameIdx;
    } DPC_ObjectDetection_ExecuteResultExportedInfo;

    The value framecount is added as a  frame counter. 

    Secondly, in the function sendResultsExportedCommand framecount is increased by one and then send to DSS(we can see the framecount value by printf ), the framecount is send to computer by UART:

      void sendResultsExportedCommand(DPM_Buffer *ptrResult){
         ...
        framecount++;
        exportInfo.subFrameIdx = dpcResults->subFrameIdx;
        exportInfo.framecount =framecount;
        retVal = DPM_ioctl (gMmwMssMCB.objDetDpmHandle,
                            DPC_OBJDET_IOCTL__DYNAMIC_EXECUTE_RESULT_EXPORTED,
                            &exportInfo,
                            sizeof (DPC_ObjectDetection_ExecuteResultExportedInfo));
        Commandtime=(CycleCounterP_getCount32()-Commandtime)/300;
        temp[0]=0x55;
        temp[1]=(uint8_t)(framecount>>24);
        temp[2]=(uint8_t)(framecount>>16);
        temp[3]=(uint8_t)(framecount>>8);
        temp[4]=(uint8_t)(framecount>>0);
        temp[5]=(uint8_t)(framecount>>0);
        trans.buf   = (uint8_t*)temp;
        trans.count =6;
        UART_write(gMmwMssMCB.commandUartHandle,&trans);

        if (retVal < 0) {
            test_print ("Error: DPM DPC_OBJDET_IOCTL__DYNAMIC_EXECUTE_RESULT_EXPORTED failed [Error code %d]\n",
                        retVal);
            MmwDemo_debugAssert(0);
        }
    }

    static void DPC_ObjectDetection_frameStart (DPM_DPCHandle handle)
    {
       ...
        if(objDetObj->interSubFrameProcToken != 0){
            printf("chain crashed:%d\n",framecount);
            DPC_Objdet_Assert(objDetObj->dpmHandle, 0);
        }
       ...
    }

    Thirdly I run the demo, when the demo fails, I will see that  in the MSS demo, if the framecount is n, while in the DSS demo, the framecount is n-1.That is to say, the MSS has send the command to DSS sucessfully(the returned retVal is zero ), but the DSS hasn't received the command. It  looks like DPM fails.  Can you provide any suggestion for that?

    BR

    Rata

  • Hi Rata,

    The best place to put the counter on the DSS side would be in DPC_ObjectDetection_ioctl that is here:

    else if (cmd == DPC_OBJDET_IOCTL__DYNAMIC_EXECUTE_RESULT_EXPORTED)
        {
            ...
    
            /* mark end of processing of the frame/sub-frame by the DPC and the app */
            objDetObj->interSubFrameProcToken--;
        }

    Could you put the counter here to ensure that all DPM commands are being received?

    Regards,

    Aayush

  • Hi Aayush,

       The reason that I do like that is that I want to confirm whether the sending data has been received by DSS. If I put the counter in the place you said, I can not know how many times the MSS send the command.

        I want to know if DPM fails, what should I do to solve this probelm?

    BR

    Rata

  • Hi Rata,

    The place that I suggest adding the counter to will be directly called by the DPM commands, as it is part of the DPC_ObjectDetection_ioctl function, which is configured to be invoked by the DPM to handle all DPM_ioctl commands.

    I am wondering if there is some miscommunication here?

    Regards,

    Aayush

  • Hi Aayush,

          In the high corner  radar demo,I change the frame period as100ms, the default time is 250. It is  the reson for the discommunication between MSS and DSS? How long is the communication time (ms's or us's)?

    BR

    Rata

  • Hi Rata,

    The lab indeed requires 250ms to function. This is for real driving scenarios. The frame time can likely be reduced significantly if it is being tested indoors. If the DSS does not fail the assertion in DPC_ObjectDetection_frameStart, it means that the frame time configured was sufficient. If it fails this assertion, it is an indicator that the frame time configured was not enough for the processing (either on MSS or DSS side).

    Regards,

    Aayus

  • Hi Aayus,

        The method to shorten the  frame period is to reducing the range bin number or doppler bins. If  I change the range bins as 256 (the default value is 384), the period will be reduced on the DSS.But it seems like that the DSS  always fail the assertion. Generally, the processing time on the DSS has little change once the range and doppler bins are chosen. The most time-consuming part is on the MSS,is that right?

     BR,

    Rata

  • Hi Rata,

    In the high end corner radar demo, there is also some dependence on the number of points and targets seen.

    Regards,

    Aayush

  • Hi Aayush,

        Yes,you are right. Now I encounter this problem in this situation:I seprate the lab0015_high_end_corner_radar into two parts: DSS and MSS projects. Then build the two projects seprately and then debug the demo,the failure will appear. If I bulid the demo in the CMD command as provided in the reference, the failure will never be generated even if I set the frame period as 80ms.Maybe when I seperate the demo,maybe there are some situations that I have not considered,which leads to this failre.

    BR

    Rata

  • Hi Rata,

    Yes, if the MSS is not running, DPC_OBJDET_IOCTL__DYNAMIC_EXECUTE_RESULT_EXPORTED will not get sent to the DSS, causing an assertion failure in the next frame start callback.

    Regards,

    Aayush