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.

IWRL6432BOOST: Unable to read UART output using custom Python code

Part Number: IWRL6432BOOST
Other Parts Discussed in Thread: IWR1642, IWRL6432, AWR1642

Hi Experts,
I am posting this on behalf of the customer. We need your assistance on this matter.

I have a IWRL6432Boost device which I've managed to use successfully for the Motion/Presence Demo, but now when I want to read the raw data transmitted over USB UART, I get nothing but empty dictionaries. The same code works perfectly for xWR1642Boost devices so I am unsure of what I am doing wrong here.

The code snippet I'm using is below, its very small.

---

# Package imports
from serial import Serial
import serial.tools.list_ports
import numpy as np
import time
  
## Change the configuration file name
configFileName = '6432config_pr.cfg'

com_uart = {}
com_data = {}
byteBuffer = np.zeros(2**15,dtype = 'uint8')
byteBufferLength = 0

# Serial configuration scheme
# Connect to the device via serial
def serialConfig(configFilename):
    global com_uart
    global com_data
    
    # Windows configuration
    com_uart = Serial("COM4", 115200) # 4 for 6432; 7 for 1642
    com_data = Serial("COM5", 921600) # 5 for 6432; 6 for 1642

    # Read in the configuration file and transmit to the device. Instead of hardcoding the config file to the device to allow for modification
    config = [line.rstrip('\r\n') for line in open(configFileName)]
    for i in config:
        com_uart.write((i+'\n').encode())
        print(i)
        time.sleep(0.01)
        
    print('\n')
    return com_uart, com_data

# Configurate the serial port
com_uart, com_data = serialConfig(configFileName)

# Main loop 
while True:
    # Parser - separate into own function for ease
    readBuffer = com_data.read(com_data.in_waiting)
    # readBuffer = com_data.read(com_data.in_waiting)
    byteVec = np.frombuffer(readBuffer, dtype = 'uint8')
    byteCount = len(byteVec)
    
    print(readBuffer)
    time.sleep(0.03) # Sampling frequency of 30 Hz

--

 

The switches on my device are configured as follows, as recommended by the Visualizer for loading the Motion/Presence demo:

S1: 100011

S3: 0010

Thank you in advance!

Best regards,
Jonathan
  • Hi Jonathan, 

    The code you provided will not work for the IWRL6432 because the device utilizes only one COM port. Unlike the IWR1642, the data COM port is the same as the user (or uart) COM port. You see two COM ports present in the device manager because the XDS110 on the EVM exposes two ports, but the device firmware actually puts both user and data onto the user COM for this device.

    Try updating your script such that 

        com_uart = Serial("COM4", 115200) # 4 for 6432; 7 for 1642
        com_data = Serial("COM5", 921600) # 5 for 6432; 6 for 1642

    becomes something like

        com_uart = Serial("COM4", 115200) # 4 for 6432; 7 for 1642
        com_data = com_uart 

    Regards,
    Luke

  • Hi Luke,

    Thank you for your support.

    Here is the update from the customer

    Updating the script did not work as intended, but it shows that there is some functionality, since the first message received after sending the configuration file over UART is the configuration file itself, which is expected since now we're monitoring both the data and user port at the same time.
    However right after it resumes doing what it did previously and just sends empty dictionaries.

    I tried playing around with more demos and one which claims to test CLI functionality, the CCS Debug with IWRL6432 motion/detection demo. After following it correctly through to the end and pressing Resume, the expected "Debug: CLI is operational" text does not appear in the console, and the program keeps running with no changes until I turn it off manually.

    Best regards,

    Jonathan

  • Hi Luke,

    Thank you for your support. Our customer has an additional inquiry regarding this. Here is the customer's feedback below.

    I've checked out the recommended literature. I already have a functioning parsing code that works with an AWR1642 sensor, which I am ready to adapt to the 6432 devices.

    The problem is I cannot retrieve anything from the UART data port, even with the first suggested change so I can't adapt the parsing code to match.

    Best regards,

    Jonathan

  • Hi Jonathan,


    The UART data port is not used for anything. Try, rather than the change suggested above, just using the same UART control handle for read data in. For successful reference code of parsing with the 6432, please refer to the source code for our python-based visualizer, the Industrial Visualizer in the Radar Toolbox, which has a full parsing implementation for the 6432 such that it can display the caught data. The visualizer exe and the source code exists here: <RADAR_TOOLBOX_DIR>/tools/visualizers/Industrial_Visualizer/. You can pull that parsing implementation out or reference it for your own application.

    Regards,
    Luke