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.

Compiler/IWR6843ISK-ODS: how to transfer feature vectors to pc

Part Number: IWR6843ISK-ODS
Other Parts Discussed in Thread: IWR6843

Tool/software: TI C/C++ Compiler

Hi Team

I am using multiple gesture and motion detection demo of iwr6843. The toolbox is  mmwave_industrial_toolbox_4_4_1 .

in the mss_data_path.h: #define SEND_FEATURE_VECTORS_OUT_ON_UART  1


in the dss_main.c : MmwDemo_dssSendProcessOutputToMSS ,I modified as follows:(blue )

#if 0
        gestureMetrics[idx] = 0x1234; idx ++;
        gestureMetrics[idx] = gestureCntr++; idx ++;
        gestureMetrics[idx] = gfeatures.pWtdoppler; idx ++;
        gestureMetrics[idx] = gfeatures.pWtdopplerPos; idx ++;
        gestureMetrics[idx] = gfeatures.pWtdopplerNeg; idx ++;
        gestureMetrics[idx] = gfeatures.pwtaz_mean; idx ++;
        gestureMetrics[idx] = gfeatures.pwtel_mean; idx ++;
        gestureMetrics[idx] = gfeatures.pNumDetections; idx ++;
        gestureMetrics[idx] = gfeatures.pwtaz_std; idx ++;
        gestureMetrics[idx] = gfeatures.pwtel_std; idx ++;
        gestureMetrics[idx] = gfeatures.pWtrange; idx ++;
        gestureMetrics[idx] = gfeatures.numCycles; idx ++;//idx = 12
  #else
       gestureMetrics[idx] = 0x1234; idx ++;
        gestureMetrics[idx] = 0x5678; idx ++;
        gestureMetrics[idx] = 0x1234; idx ++;
        gestureMetrics[idx] = 0x5678; idx ++;
        gestureMetrics[idx] = 0x1234; idx ++;
        gestureMetrics[idx] = 0x5678; idx ++;
        gestureMetrics[idx] = 0x1234; idx ++;
        gestureMetrics[idx] = 0x5678; idx ++;
        gestureMetrics[idx] = 0x1234; idx ++;
        gestureMetrics[idx] = 0x5678; idx ++;
        gestureMetrics[idx] = 0x1234; idx ++;
        gestureMetrics[idx] = 0x5678; idx ++;
  #endif

 mss_main.c :MmwDemo_mboxReadTask (),send feature vector to uart

{

#if SEND_FEATURE_VECTORS_OUT_ON_UART
                /* Send the  feature vectors. */
                UART_writePolling(gMmwMssMCB.loggingUartHandle,
                    (uint8_t*)SOC_translateAddress(message.body.detObj.tlv[0].address,
                        SOC_TranslateAddr_Dir_FROM_OTHER_CPU, NULL),
                    message.body.detObj.tlv[0].length);
#endif

}

But I received the data as shown below, not 0x1234 and 0x5678, can you help me explain the reason?

Because we want to send the feature vector to the pc and send it to the neural network for processing,

so enable SEND_FEATURE_VECTORS_OUT_ON_UART ,then we found  the data received by uart is not right;

 

  • Hello,

    You will need to synchronize to the message header using the magic word as shown below, skip the header and then reach the actual data buffer. So first look for the header workds inj the output packet (i.e. the platform ID and magic word) to parse the header.

        /* Clear message to MSS */
        memset((void *)&message, 0, sizeof(MmwDemo_message));
        message.type = MMWDEMO_DSS2MSS_DETOBJ_READY;
        /* Header: */
        message.body.detObj.header.platform = 0xA1642;
        message.body.detObj.header.magicWord[0] = 0x0102;
        message.body.detObj.header.magicWord[1] = 0x0304;
        message.body.detObj.header.magicWord[2] = 0x0506;
        message.body.detObj.header.magicWord[3] = 0x0708;
        message.body.detObj.header.numDetectedObj = obj->numDetObj;
        message.body.detObj.header.version = MMWAVE_SDK_VERSION_BUILD |   //DEBUG_VERSION
            (MMWAVE_SDK_VERSION_BUGFIX << 8) |
            (MMWAVE_SDK_VERSION_MINOR << 16) |
            (MMWAVE_SDK_VERSION_MAJOR << 24);
    
        /* Set pointer to HSM buffer */
        ptrCurrBuffer = ptrHsmBuffer;
    #if 1
        {
            int32_t idx, ik;
            gestureMetrics = (float*)ptrCurrBuffer;
            idx = 0;
            gestureMetrics[idx] = 1234; idx ++;
            gestureMetrics[idx] = gestureCntr++; idx ++; 
            gestureMetrics[idx] = gfeatures.pWtdoppler; idx ++;

    Please note that the gesture demo is provided as-is to demonstrate a proof of concept only.

    Regards

    -Nitin

  • Hello Nitin

    1. dss_main.c =>MmwDemo_dssSendProcessOutputToMSS 

    {

          message.body.detObj.tlv[0].length = itemPayloadLen;

          message.body.detObj.tlv[0].type = MMWDEMO_OUTPUT_MSG_DETECTED_POINTS

          message.body.detObj.tlv[0].address = (uint32_t)ptrCurrBuffer;

         ==>My point of view:
         The TLV address (data buffer)has been saved in the message structure

        ...............................................................................................

        if (retVal == 0)
        {
            message.body.detObj.header.numTLVs = tlvIdx;
            /* Round up packet length to multiple of MMWDEMO_OUTPUT_MSG_SEGMENT_LEN */
            message.body.detObj.header.totalPacketLen = MMWDEMO_OUTPUT_MSG_SEGMENT_LEN *
                ((totalPacketLen + (MMWDEMO_OUTPUT_MSG_SEGMENT_LEN - 1)) / MMWDEMO_OUTPUT_MSG_SEGMENT_LEN);
            message.body.detObj.header.timeCpuCycles = Cycleprofiler_getTimeStamp();
            message.body.detObj.header.frameNumber = gMmwDssMCB.stats.frameStartIntCounter;
            message.body.detObj.header.subFrameNumber = gMmwDssMCB.subFrameIndx;
            if (MmwDemo_mboxWrite(&message) != 0) //write mailbox
            {
                retVal = -1;
            }
        }

    }

    2. mss_main.c : MmwDemo_mboxReadTask

    {

    retVal = Mailbox_read(gMmwMssMCB.peerMailbox, (uint8_t*)&message, sizeof(MmwDemo_message));

    #if SEND_FEATURE_VECTORS_OUT_ON_UART
                    /* Send the  feature vectors. */
                    UART_writePolling(gMmwMssMCB.loggingUartHandle,
                        (uint8_t*)SOC_translateAddress(message.body.detObj.tlv[0].address, //data buffer addr
                            SOC_TranslateAddr_Dir_FROM_OTHER_CPU, NULL),
                        message.body.detObj.tlv[0].length);
    #endif

    }

    I think the address of feature vector is : (uint8_t*)SOC_translateAddress(message.body.detObj.tlv[0].address,

    so there is no need to skip the header and then reach the actual data buffer.Is this correct?

  • Yes, that is correct. But you still need to find the magic word "1234" sent by the DSS to synchronize to the output structure:

        /* Set pointer to HSM buffer */
        ptrCurrBuffer = ptrHsmBuffer;
    #if 1
        {
            int32_t idx, ik;
            gestureMetrics = (float*)ptrCurrBuffer;
            idx = 0;
            gestureMetrics[idx] = 1234; idx ++;
            gestureMetrics[idx] = gestureCntr++; idx ++; 

    You should be able to put a break point in the code and step through it when the DSS fills the buffer and see what's coming out. Similarly, put another break point where the MSS sends the message out.

    Thanks

    -Nitin

  • Hello NItin

    ok ,i see. I will have a try,thanks a lot again.