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.

AWR1642: Problem of Detected Object TLV Length

Part Number: AWR1642
Other Parts Discussed in Thread: UNIFLASH

I want to parse the detected object data from AWR1642 output packets. In the packets received through UART, the value of variable "length" in detected object TLV structure corresponds with the length of payload, but it doesn't correspond with the data length in SDK document. 

AWR1642 EVM was flashed by the 2.0.0.4 version srrdemo_16xx.bin using Uniflash. 

According to 2.0.0.4 SDK document, the "Length" formula of the detected object TLV is: 

Length: (size of MmwDemo_output_message_dataObjDescr_t) + (Number of detected objects) x (size of MmwDemo_detectedObj_t) 

MmwDemo_output_message_dataObjDescr_t is 4 bytes, and MmwDemo_detectedObj_t is 12 bytes

 

Therefore, the relation between number of detected objects and length should be:

Number of detected objects

Length

1

16

2

28

3

40

4

52

 

However, according to the packets I received through UART, the relation is:

Number of detected objects

Length

1

12

2

20

3

28

4

36

 

Substitute these values for the variables in "Length" formula, it seems that the MmwDemo_output_message_dataObjDescr_t is 4 bytes, but the MmwDemo_detectedObj_t is only 8 bytes. 

Nevertheless, in the SDK document, there are 6 variables which are 2 bytes in MmwDemo_detectedObj_t. I don't know how to parse these 6 variables from MmwDemo_detectedObj_t received only 8 bytes. 

   27 typedefvolatilestruct MmwDemo_detectedObj_t

   28 {

   29  uint16_t rangeIdx;

   30  int16_t dopplerIdx;

   35  uint16_t peakVal;

   36  int16_t x;

   37  int16_t y;

   38  int16_t z;

   39 } MmwDemo_detectedObj;

  

Following is one of the packets I received with header, tag, length, payload, and padding : 

0x02, 0x01, 0x04, 0x03, 0x06, 0x05, 0x08, 0x07, 0x04, 0x00, 0x00, 0x02, 0xa0, 0x00, 0x00, 0x00,

0x42, 0x16, 0x0a, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd4, 0xdf, 0xec, 0xf9, 0x03, 0x00, 0x00, 0x00,

0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,

0x03, 0x00, 0x07, 0x00, 0x00, 0x00, 0x69, 0x14, 0xb9, 0xff, 0x7f, 0x01, 0x00, 0x00, 0x07, 0x14,

0xb4, 0xff, 0x84, 0x01, 0x00, 0x00, 0xef, 0x13, 0x5a, 0x00, 0x9b, 0x02, 0x04, 0x00, 0x00, 0x00,

0x44, 0x00, 0x00, 0x00, 0x20, 0x00, 0x07, 0x00, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a,

0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a,

0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a,

0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a,

0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f

 

Number of detected objects = data[28:31] = 0x03, 0x00, 0x00, 0x00 = 3

Tag = data[40:43] = 0x01, 0x00, 0x00, 0x00 = 1    # Type == 1 represents that this TLV is the list of detected objects

Length = data[44:47] = 0x1c, 0x00, 0x00, 0x00 = 28    # However, according to the SDK document, when the number of detected objects is 3, the length should be 40, not 28, unless the MmwDemo_detectedObj_t is only 8 bytes.

 

Additionally, I've considered if the value of variable "Length" is wrong, but when I counted the length of objected object payload by the number of detected objects, the "Length" formula and variable size in SDK document, I could not interpret the next TLV correctly.

Please help to solve this problem. Thank you!

  

The following are other packets I received with 0, 1, 2, and 4 detected object(s).

Number of detected objects = 0

0x02, 0x01, 0x04, 0x03, 0x06, 0x05, 0x08, 0x07, 0x04, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00,

0x42, 0x16, 0x0a, 0x00, 0x37, 0x03, 0x00, 0x00, 0xce, 0xed, 0x56, 0xc0, 0x00, 0x00, 0x00, 0x00,

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f,

0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f

 

Number of detected objects = 1

0x02, 0x01, 0x04, 0x03, 0x06, 0x05, 0x08, 0x07, 0x04, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00,

0x42, 0x16, 0x0a, 0x00, 0x03, 0x00, 0x00, 0x00, 0xfa, 0xfe, 0xfc, 0xfa, 0x01, 0x00, 0x00, 0x00,

0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,

0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0xe2, 0x13, 0x8a, 0x00, 0xa7, 0x02, 0x0f, 0x0f, 0x0f, 0x0f

 

Number of detected objects = 2

0x02, 0x01, 0x04, 0x03, 0x06, 0x05, 0x08, 0x07, 0x04, 0x00, 0x00, 0x02, 0xa0, 0x00, 0x00, 0x00,

0x42, 0x16, 0x0a, 0x00, 0x86, 0x0a, 0x00, 0x00, 0xb0, 0x7f, 0x20, 0x42, 0x02, 0x00, 0x00, 0x00,

0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,

0x02, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1a, 0x14, 0xb7, 0xff, 0x7f, 0x01, 0x00, 0x00, 0xc0, 0x13,

0x58, 0x00, 0x9b, 0x02, 0x04, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x20, 0x00, 0x07, 0x00,

0xa1, 0x02, 0xa1, 0x02, 0xa1, 0x02, 0xa1, 0x02, 0xa1, 0x02, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a,

0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a,

0x00, 0x0a, 0x00, 0x0a, 0xfd, 0x09, 0xfd, 0x09, 0xfd, 0x09, 0xfd, 0x09, 0xfd, 0x09, 0xfd, 0x09,

0x00, 0x0a, 0x00, 0x0a, 0xfd, 0x09, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01,

0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f

 

Number of detected objects = 4

0x02, 0x01, 0x04, 0x03, 0x06, 0x05, 0x08, 0x07, 0x04, 0x00, 0x00, 0x02, 0xc0, 0x00, 0x00, 0x00,

0x42, 0x16, 0x0a, 0x00, 0x06, 0x00, 0x00, 0x00, 0xfe, 0x87, 0x37, 0xfe, 0x04, 0x00, 0x00, 0x00,

0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,

0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x5e, 0x14, 0xb8, 0xff, 0x7f, 0x01, 0x00, 0x00, 0x05, 0x14,

0xb4, 0xff, 0x84, 0x01, 0x00, 0x00, 0xeb, 0x13, 0x08, 0x00, 0xe4, 0x01, 0x00, 0x00, 0xf0, 0x13,

0x55, 0x00, 0x9c, 0x02, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x07, 0x00,

0xd2, 0xff, 0xa2, 0x01, 0x36, 0x00, 0x41, 0x00, 0x04, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00,

0x20, 0x00, 0x07, 0x00, 0x28, 0x08, 0x28, 0x08, 0x28, 0x08, 0x28, 0x08, 0x28, 0x08, 0x00, 0x0a,

0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a,

0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a,

0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x0a, 0xe2, 0x07, 0xe1, 0x07, 0xe1, 0x07, 0xe1, 0x07,

0xe1, 0x07, 0xe1, 0x07, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f

  • Hi,

    I agree with you that the documentation may not be clear/sufficient.

    Here are some pieces of information that may help

    1) The mmWave SDK documentation regarding the data format applies ONLY to the mmWave SDK demo. It does not apply to the SRR demo provided in Automotive Toolbox.

    2) For the SRR demo the following can be used to understand the data format:

    • The matlab gui that parses the data sent by the target code running on the board

                        lab0002_short_range_radar\gui\read_serial_port_and_plot_object_location.m (after line 184)

    • The src code that formats the data that is sent to the PC host:
    • SRR_DSS_SendProcessOutputToMSS() in "labs\lab0002_short_range_radar\src\dss\dss_main.c"

    Thank you

    Cesar

  • Hi Cesar,

     

    Thank you for your helpful reply!

     

    I found struct MmwDemo_detectedObjForTx in SRR_DSS_SendProcessOutputToMSS() in "dss_main.c", line 788

     

    itemPayloadLen = sizeof(MmwDemo_detectedObjForTx) * obj->numDetObj;

     

    It is claimed in "dss_data_path.h", line 206.

     

    typedef struct MmwDemo_detectedObjForTx_t

    {

        int16_t   speed;        /*!< @brief Doppler index */

        uint16_t   peakVal;     /*!< @brief Peak value */

        int16_t  x;             /*!< @brief x - coordinate in meters. Q format provides the bitwidth. */

        int16_t  y;             /*!< @brief y - coordinate in meters. Q format provides the bitwidth. */

    } MmwDemo_detectedObjForTx;

     

    Its size is 8 bytes with 4 variables which are 2 bytes. This is consistent with the length of detected object payload in packets received by UART.

     

    If there is anything I misunderstand, please tell me.

     

    Thank you very much,

    Russell

  • Hi

    Sorry, maybe I misunderstood.

    Was your question answered?

    Do you still have a question?

    Thanm you

    Cesar

  • Hi Cesar,

    I think the question was answered.

    Thank you for your help!

    Russell

  • Thank you

    Cesar