I’m using the LEAPS UWBS firmware on the QM31120WDK2.
| API command | UWBS | gateway |
|---|---|---|
| leaps_usr_data_read | Yes | No |
| leaps_usr_data_write | Yes | No |
I want to record information about each device in the NVM. According to the table above, each API should work on UWBS.
Below is the test code. When I run the code, I get a CRC error, which is different from the expected response.
import serial
import time
def build_usr_data_read_tlv():
Type = 0x19 # leaps_usr_data_read
Length = 0x01 # 1 byte value
Value = 0x02 # type=2 (NVM)
tlv = bytes([Type, Length]) + bytes([Value])
return tlv
def build_usr_data_write_tlv():
Type = 0x1A # leaps_usr_data_write
Length = 0x05 # 5 byte value
Value = 0x02 # type=2 (NVM)
Data = bytes([0xAA, 0xBB, 0xCC, 0xDD]) # Data to write
tlv = bytes([Type, Length]) + bytes([Value]) + Data
return tlv
def send_and_receive(port="/dev/ttyUSB0", baud=115200):
tlv = build_usr_data_read_tlv()
print("TX TLV:", tlv.hex(" "))
ser = serial.Serial(port, baudrate=baud, timeout=0.01)
ser.write(tlv)
ser.flush()
time.sleep(0.1)
rx = ser.read(256)
print("RX RAW:", rx.hex(" "))
ser.close()
if __name__ == "__main__":
send_and_receive("COM27", 115200)
The result of the operation is: ‘6’ (checksum error).
(READ)
TX TLV: 19 01 02
RX RAW: 40 01 06 a0
(WRITE)
TX TLV: 1a 05 02 aa bb cc dd
RX RAW: 40 01 06 a0
What could be causing this error? I remember the DWM1001 had a shell mode command to write and read from nvm, but it seems to be missing on this model.
@leapslabs Do you know what is causing this problem or how to fix it?

