Other Parts Discussed in Thread: AWR1843BOOST, AWR2944
Tool/software:
Hi,
I’m running the out-of-the-box (OOB) demo on my AWR2944EVM, and it works as expected with TI’s online visualizer.
I’d like to use a custom workflow—similar to what I did with the AWR1843BOOST—where I read the TLV packets over CLI/UART. That way, when I add my own CLI commands into the radar’s firmware, I can parse their output directly in Python, since the online demo can’t be modified.
In TI’s documentation, each TLV frame starts with an “Output buffer magic word.” This is documented here: dev.ti.com/.../node (click the download button to see it, else it looks blank). The docs list this sequence of 16‑bit words: {0x0102, 0x0304, 0x0506, 0x0708}. On a little‑endian host that becomes the byte array [2, 1, 4, 3, 6, 5, 8, 7], which the python script successfully finds in the 1843’s UART stream.
However, the exact same code fails to locate that sequence in the AWR2944EVM’s TLV output, even though both online demos use the same UART baud rate. I’m not finding any device‑specific note in TI’s user guide about a different magic word for the 2944.
So my questions are:
- Does the AWR2944EVM use a different magic word?
- If it’s supposed to be the same, why might my script—known to work on the 1843—be failing to detect it on the 2944?
Best,
Mark
The mentioned code:
import serial
import time
import numpy as np
configFile = "C:/Users/mmpas/PycharmProjects/liveComAWR/Data/profile_onlineDemo.cfg"
COM_UART = 'COM13'
COM_AUX_DAT = 'COM12'
CLIport = serial.Serial(COM_UART, 115200, timeout=0.2)
DataPort = serial.Serial(COM_AUX_DAT,921600, timeout=0.2)
time.sleep(1.0)
CLIport.reset_input_buffer()
byteBuffer = np.zeros(2 ** 15, dtype='uint8')
byteBufferLength = 0;
def sendConfigFile(cfgFile, settle=0.05):
for line in open(cfgFile):
if not line.startswith('%'):
cmd = line.strip('\r\n')
CLIport.write((cmd + '\n').encode())
CLIport.flush()
print(cmd)
time.sleep(0.01)
def readTLV_messages(Dataport):
global byteBuffer, byteBufferLength
# Constants
OBJ_STRUCT_SIZE_BYTES = 12;
BYTE_VEC_ACC_MAX_SIZE = 2 ** 15;
MMWDEMO_UART_MSG_DETECTED_POINTS = 1;
MMWDEMO_UART_MSG_RANGE_PROFILE = 2;
maxBufferSize = 2 ** 15;
tlvHeaderLengthInBytes = 8;
pointLengthInBytes = 16;
magicWord = [2, 1, 4, 3, 6, 5, 8, 7]
# Initialize variables
magicOK = 0
dataOK = 0
frameNumber = 0
detObj = {}
readBuffer = Dataport.read(Dataport.in_waiting)
print(readBuffer)
byteVec = np.frombuffer(readBuffer, dtype='uint8')
byteCount = len(byteVec)
# Check that the buffer is not full, and then add the data to the buffer
if (byteBufferLength + byteCount) < maxBufferSize:
byteBuffer[byteBufferLength:byteBufferLength + byteCount] = byteVec[:byteCount]
byteBufferLength = byteBufferLength + byteCount
#-------------------------<<< Check for the location of the magic word use it as strat index >>>-------------------------
# Check that the buffer has some data
if byteBufferLength > 16:
# Check for all possible locations of the magic word
possibleLocs = np.where(byteBuffer == magicWord[0])[0]
# Confirm that is the beginning of the magic word and store the index in startIdx
startIdx = []
for loc in possibleLocs:
check = byteBuffer[loc:loc + 8]
if np.all(check == magicWord):
startIdx.append(loc)