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.

IWR1642BOOST: MATLAB error while running demo code from industrial tool box

Part Number: IWR1642BOOST
Other Parts Discussed in Thread: IWR1642

Hi all,

I am working on iwr1642. I tried to run matlab gui for people count demo from industrial toolbox 3.1.1. I have used the demo bin file to flash the EVM. When I try to run main_pplcount_viz.m from C:\ti\mmwave_industrial_toolbox_3_1_1\labs\lab0011-pplcount\lab0011_pplcount_gui I get the following errors.

Error using webcamlist (line 20)
MATLAB Support Package for USB Webcams has not been installed. Open Add-Ons Explorer to install the Webcam Support
Package.

Error in setup>popupWebcam_CreateFcn (line 612)
hObject.String = webcamlist();

Error in gui_mainfcn (line 95)
feval(varargin{:});

Error in setup (line 42)
gui_mainfcn(gui_State, varargin{:});

Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)setup('popupWebcam_CreateFcn',hObject,eventdata,guidata(hObject))
No appropriate method, property, or field 'UserData' for class 'matlab.graphics.GraphicsPlaceholder'.

Error in setup>btnConnect_Callback (line 264)
controlSerialPort = hUARTPort.UserData.strPort;

Error in gui_mainfcn (line 95)
feval(varargin{:});

Error in setup (line 42)
gui_mainfcn(gui_State, varargin{:});

Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)setup('btnConnect_Callback',hObject,eventdata,guidata(hObject))
Error using uiwait (line 81)
Error while evaluating UIControl Callback.

I cannot connect to com ports too. But I can see them detected.

I dont have webcam on my system so i tried to comment out the statement involving webcams but still can't connect the com ports.

How do i get this to work?

What should I disable/enable?

  • Hi Radha,

    The webcam error will not cause any detrimental behavior to the demo.  You can use the GUI from lab0015, as the error has been removed in the latest industrial toolbox (3.3).

    If you cannot connect to COM Ports, please ensure that no other programs are using these - common suspects are other Matlab applications, serial communication applications, and the OOB demo visualizer.  Please ensure the XDS110 drivers are installed on your laptop.  These install automatically with Code Composer Studio.

    Regards,

    Justin

  • Hi Justin,

    I downloaded the ITB 3.3.1 and loaded the bin file (from lab 11)and used matlab GUI from ppl count demo lab 11.

    I still get error, i cant connect to the com ports and start recieving data. So I used GUI from pplcount demo lab 15.

    I got  connected to the com ports but can't receive any data. I got the below warning and error.

    Warning: Unsuccessful read: The specified amount of data was not returned within the Timeout period..
    Index exceeds matrix dimensions.

    Error in main_pplcount_viz (line 515)
    magicBytes = typecast(uint8(rxHeader(1:8)), 'uint64');

    I also tried using the bin file from lab15 and still got the same problem.

    Thanks,

    radha.

  • Hi radha,

    While the gui can be swapped between the two devices, please only use the lab0011 binary for the IWR1642. You are getting this error because the device is not responding to the CLI commands. Please ensure you have put the device in functional mode as described in the user's guide.

    Please use a utility like tera term to connect to the UART com port and see if the device responds to commands. Baud rate is 115200.

    Regards,
    Justin
  • Hi Justin,

    I used the bin file for IWR1642 from lab 11. I used the Gui of lab 15 from ITB 3.3.1. have enabled the device in functional mode. I used Putty to check if the sensor is receiving CLI commands. It does.

    I can use the UART com port to write to sensor. But whereas in matlab, it gets connected but does not display any data. 

    Here is my matlab log:


    hObject =

    UIControl (editUART) with properties:

    Style: 'edit'
    String: 'COM3'
    BackgroundColor: [1 1 1]
    Callback: @(hObject,eventdata)setup('editUART_Callback',hObject,eventdata,guidata(hObject))
    Value: 0
    Position: [0.3046 0.7262 0.2831 0.2857]
    Units: 'normalized'

    Show all properties

    left wall: 0
    R wall: 8
    front wall: 8
    Serial port(s) already open. Re-initializing...
    Opening configuration file mmw_pplcount_demo_default.cfg ...
    trackingCfg specifies -6.981317e-01.
    GUI specifies 0. 90 will be used for azimuth in cfg.
    Sending configuration from mmw_pplcount_demo_default.cfg file to IWR16xx ...

    Serial Port Object : Serial-COM3

    Communication Settings
    Port: COM3
    BaudRate: 115200
    Terminator: 'LF'

    Communication State
    Status: open
    RecordStatus: off

    Read/Write State
    TransferStatus: idle
    BytesAvailable: 0
    ValuesReceived: 0
    ValuesSent: 0

    flushCfg
    dfeDataOutputMode 1
    channelCfg 15 5 0
    adcCfg 2 1
    adcbufCfg 0 1 1 1
    profileCfg 0 60.6 30 10 62 0 0 53 1 128 2500 0 0 30
    chirpCfg 0 0 0 0 0 0 0 1
    chirpCfg 1 1 0 0 0 0 0 4
    frameCfg 0 1 128 0 50 1 0
    lowPower 0 1
    guiMonitor 1 1 0 0
    cfarCfg 6 4 4 4 4 16 16 4 4 55 67 0
    doaCfg 600 1875 30 1 1 0
    SceneryParam 0 8 0 8
    GatingParam 3 2 2 0
    StateParam 10 5 100 100 5
    AllocationParam 250 250 0.25 30 1 2
    AccelerationParam 1 1 1
    trackingCfg 1 2 250 20 52 82 50 90
    sensorStart
    left wall: 0
    R wall: 8
    front wall: 8
    back wall: 0
    ------------------
    Warning: Unsuccessful read: The specified amount of data was not returned within the Timeout period..
    Index exceeds matrix dimensions.

    Error in main_pplcount_viz (line 515)
    magicBytes = typecast(uint8(rxHeader(1:8)), 'uint64');

    Here is screenshot of my matlab window and putty window.

  • Hi Radha,

    sensorStart would give an error if the sensor was already started. My assumption is that you started the gui and used it to send the configuration, - when the gui gave an error, you then connected with putty and sent the sensorStart command?

    After sending the sensorStart with putty, do you see data coming in through the DATA Com Port? If so, it seems the device is missing the sensorStart command sent by the gui. If you have access to edit matlab, you can add a delay between the UART writes to give the device more time to process the trackingcfg command. Otherwise, you can start the gui again after sending a sensorStart with the putty terminal. The device will ignore the configuration since it is already running and did not receive a sensorStop. Since it is already sending data, the gui will be able to start reading the UART stream.

    Regards,
    Justin
  • Hi Justin,

    Your assumption is right. That is how i did before. But I didnt check the data port before. Now i did the same and checked data port. Data port is not opened so I cant see the data coming in from sensor. I get error message in putty stating Unable to open Data Com port. And I think that is what must have happened with Matlab too. The data port is never opening. What might be the issue?

    Thanks,

    radha.

  • Hi Radha,

    It is possible that the Matlab GUI is blocking Putty from connecting to the data port - Matlab keeps the data port open, but does not keep the UART port open after sending the config. Otherwise, some other program would be connected to the data port and keeping it from opening. To test if Matlab is the culprit, you can send the whole config through putty without starting the matlab program, then connect to the data port with putty.

    Regards,
    Justin
  • Hi Justin,

    Thanks for your help. I finally got it to work.

    As you suggested, I first opened the uart port using putty and sent the entire config one by one (I sent the commands from mmw_pplcount_demo_default.cfg of lab 15 pplcount which was for IWR 68xx first but didnt work so I sent the commands from  mmw_pplcount_demo_default.cfg of lab 11 pplcount which was for IWR 1642) and then opened the data port.

    I could see data coming in. So then I started Matlab with disabling config write from serial port and just started the GUI. It receives data.

    But this takes a lot of time. So I tried to modify the mmw_pplcount_demo_default.cfg file for IWR 1642 commands and enabled config write from serial and then started Matlab. It worked after power cycling the sensor. But closing the Matlab doesnt free up the data port and i can still see data coming in data port through putty. To stop it, I need to give sensorStop. After that when I start Matlab it doesnt work. I have to power cycle it again and start over.

    Why is this so hard?

  • Hi Radha,

    The People Counting demo uses a different processing chain than the other mmwave demos.  It requires more memory, so the software does not enable sensorStop and dynamic reconfiguration like the other demos do.

    Matlab retains control of the DATA port because it expects data to come from the port.  After close the GUI, you can run "fclose(instrfind) to close all com ports.

    Regards,

    Justin

  • Hi Justin,

    Thanks for your help and clarification. I can get it to work now. 

    Thanks,

    radha.