MR24BSD1 (R24BBD1) mmWave Sensor - CRC16 checksum (Manual Improvements)

Hello and Good Day!

I had difficulties getting the UART to work with an ESP32 so I decided to hook up the sensor to my PC using a USB-TTL/Serial device. That worked for me without issue. I’m a developer and don’t mind writing an open source JavaScript library for Node.js to decode the frame/data packets from this sensor, which is what I have set out to do. However, I’m hitting some issues with the documentation.

Two issues:

  1. The C code provided in the manual PDF are images so you cannot cut and paste. The OCR provided by Mac OS incorrectly recognizes the hexadecimal strings in the lookup tables, so this would require folks to type this in manually, which is prone to errors. Could you please provide the code in the manual as text so we can copy and paste?

  2. The issue that I’m running into is with the CRC16 checksum. The lookup tables provided do not appear to be standard? It’s unclear which portion of the data frame/packet I am to checksum, and whether I must take an incremental approach to doing so. When I try to use several open source CRC16 checksum libraries to checksum the data portion of the packet, or the packet excluding the checksum bytes, they do not match the values in the 2 bytes I expect to be the checksum. Do I need to incrementally calculate it, or can I pass in the whole set of data at once?

I’m very much looking forward to exposing all the data this sensor provides as JSON.

Thanks in advanced for your time and consideration,

Adding some follow-up questions here:

  • “Length = Data Length + Function Code + Address Code 1 + Address Code 2 + Data + Checksum”… shouldn’t the start code be included in the length of the packet?