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 {
30 int16_t dopplerIdx;
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