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.

IWR6843ISK-ODS: Unable to parse TLV's from UART Data for 3D People Counting Demo

Part Number: IWR6843ISK-ODS

Hi TI Team, 

We have written one c application which reads data coming from device and parse the TLV's. We are using IWR6843ISK-ODS antenna and Sense and Direct HVAC control  demo. Our application is able to parse the TLV's for Sense and Direct HVAC Control Demo with the same antenna. 

We tried to modify the application for 3D people counting demo but everytime the header comparison is getting failed so we are not able to parse the TLV's for it.

Following is the snippet for reading data coming from UART , parsing the header  and comparing it with expected Header.

uint16_t magic[4] = {0x0102,0x0304, 0x0506, 0x0708};     // expected Header

while (1) {
memset(&newdata, 0 , sizeof(dataPacket_t));
memset(buff, 0, sizeof(buff));
readBytes = read(g_mmw.datacom_fd, &buff, 1500);
if (memcmp(buff, magic, 8) == 0) {                                     // when expected header received in data
memset(header, 0, HEADERLEN);
memcpy(header, buff, HEADERLEN);
while (readBytes < (header->totalPacketLen)) {
bufPos = readBytes;
numPendBytes = header->totalPacketLen - readBytes;
memset(tmpbuf, 0, sizeof(tmpbuf));
tempBytes = read(g_mmw.datacom_fd, &tmpbuf, numPendBytes);
readBytes += tempBytes;
memcpy((buff+bufPos), tmpbuf,tempBytes);
}
} else {
continue;
}

May i learn any difference in header format for Sense_and_Direct_HVAC Control  and 3D People Counting Demo?

Could you please assist regarding this ?

Thanks 

Shraddha

 

  • Hi Shradda,

    Please see the file in the visualizer source - oob_parser.py. This file contains code that parses the header of both the 3D People Counting demo, and the HVAC demo. You can see the differences in parsing there.

    Regards,

    Justin

  • Hi Justin, 

      We checked the oob_parser.py file, there is no difference in the magic comparison, only the difference with header members (in sequence), we have modified the header format accordingly and checked.

    We observed that the baudrate for data COM port is different for 3D-people counting Demo , we modified it accordingly and checked.

    cfsetispeed(&SerialPortSettings,921600*2);
    cfsetospeed(&SerialPortSettings,921600*2);

    But still magic comparison is failing always, so it is not able to parse any TLV's.

    please find the magic comparison snippet as shown :

    char buff[1500] = {0};

    uint16_t magic[4] = {0x0102,0x0304, 0x0506, 0x0708};

    while (1) {
    memset(buff, 0, sizeof(buff));
    readBytes = read(g_mmw.datacom_fd, &buff, 1500);
    i = 0;
          while (i < readBytes) {
                 if (memcmp(buff+i, magic, 8) == 0) {    
                        printf("Magic Found i = %d\n", i);
                        printf(" %hx %hx %hx %hx %x %x\n", *(buff+i), *(buff+i+2), *(buff+i+4), *(buff+i+6), *(buff+i+10), *(buff+i+14));
                        break;
                 }
         i++;
         }
    }

     we are able to observe the readbytes, but magic comparison is always failing.

    Could you please assist us regarding this issue ?

    Thanks 

    Shraddha

  • Hi Shradda,

    Because the TI device is Little Endian, the Magic word will be output as:

    x0201 x0403 x0605 x0807

    I noticed you have a printf statement in you source, what does this show when you see the magic word?

    Regards,
    Justin