Mmwave SDK User Guide
Mmwave SDK User Guide
http://www.ti.com
1
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
DOCUMENT LICENSE
This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License (CC BY-SA 3.0). To view a copy of this license,
visit http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco,
California, 94105, USA.
COPYRIGHT
Copyright (C) 2014 - 2020 Texas Instruments Incorporated - http://www.ti.com
DISCLAIMER
This mmWave SDK User guide is generic and contains details about all the mmWave devices that are supported by TI in general. However, note that
not all mmWave devices may be supported in a given mmWave SDK release. Please refer to the mmWave SDK Release notes to understand the list
of devices/platforms supported in a given mmWave SDK release.
NOTICE: This software product is used to configure TI’s mmWave devices, including RF emissions parameters for such devices. Note
that many countries or regions impose regulations governing RF emissions. Users are responsible for understanding local RF emission
regulations and operating the product within those regulations.
2
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
CONTENTS
3
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
LIST OF FIGURES
4
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
LIST OF TABLES
5
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Hardware
1. mmWave TI EVM
2. Power supply cable as recommended in TI EVM user guide
3. PC
Software
1. Pre-flashed mmWave Demo running on TI EVM (See instructions in this user guide on how to update the flashed demo)
2. Chrome browser running on PC
Next, to visualize the data flowing out of TI mmWave devices, follow these steps
1. Connect the EVM to a power outlet via the power cable and to the PC via the included USB cable. EVM should be powered up and
connected to PC now.
2. On your PC, browse to https://dev.ti.com/mmWaveDemoVisualizer in Chrome browser and follow the prompts to install one-time software.
[No other software installation is needed at this time]
3. The Visualizer app should detect and connect to your device via COM ports automatically (except for the very first time where users will need
to confirm the selection via OptionsSerial Port). Select the right Platform and SDK version and start your evaluation!
a. Hint : Use HelpAbout to know your Platform and SDK version
For details on how to evaluate, any troubleshooting needs and/or to understand the know-how behind these steps, continue reading this SDK User
Guide...
If the flashed demo on the EVM is an old version and you would like to upgrade to latest demo, continue reading this SDK User Guide...
6
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
2. System Overview
The mmWave SDK is split in two broad components: mmWave Suite and mmWave Demos.
2. 1. mmWave Suite
mmWave Suite is the foundational software part of the mmWave SDK and would encapsulate these smaller components:
Drivers
OSAL
mmWaveLink
mmWaveLib
mmWave API
Data processing layer (manager, processing units)
RADARSS Firmware
Board Setup and Flash Utilities
2. 2. mmWave Demos
SDK provides demos that depict the various control and data processing aspects of a mmWave application. Data visualization of the demo's output on
a PC is provided as part of these demos. These demos are example code that are provided to customers to understand the inner workings of the
mmWave devices and the SDK and to help them get started on developing their own application.
2. 3. External Dependencies
All tools/components needed for building mmWave sdk are included in the mmwave sdk installer. But the following external components (for
debugging) are not included in the mmWave SDK.
Please refer to the mmWave SDK Release Notes for detailed information on these external dependencies and the list of platforms that are supported.
Terms Comment
used
xWR This is used throughout the document where that section/component/module applies to both AWR and IWR variants
BSS This is used in the source code and sparingly in this document to signify the RADARSS. It is also interchangeably referred to as the
mmWave Front End.
2. 5. Related documentation/links
Other than the documents included in the mmwave_sdk package the following documents/links are important references.
SoC links:
Automotive mmWave Sensors
Industrial mmWave Sensors
Evaluation Modules (EVM) links:
Automotive Evaluation modules (Booster Pack, DEVPACK)
Industrial Evaluation modules (Booster Pack, ISK)
7
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
3. Getting started
The best way to get started with the mmWave SDK is to start running one of the various demos that are provided as part of the package. TI mmWave
EVM comes pre-flashed with the mmWave demo. However, the version of the pre-flashed demo maybe older than the SDK version mentioned in this
document. Users can follow this section and upgrade/run the flashed demo version. The demos (source and pre-built binaries) are placed at mmwave_
sdk_<ver>/packages/ti/demo/<platform> folder.
mmWave Demo
This demo is located at mmwave_sdk_<ver>/packages/ti/demo/<platform>/mmw folder. The millimeter wave demo shows some of the radar sensing
and object detection capabilities of the SoC using the drivers in the mmWave SDK (Software Development Kit). It allows user to specify the chirping
profile and displays the detected objects and other information in real-time. A detailed explanation of this demo is available in the demo's docs folder
and can be browsed via mmwave_sdk_<ver>/docs/mmwave_sdk_module_documentation.html. This demo ships out detected objects and other real-
time information that can be visualized using the TI Gallery App - 'mmWave Demo Visualizer' hosted at https://dev.ti.com/mmWaveDemoVisualizer.
The version of the mmWave Demo running on TI mmWave EVM can be obtained from the Visualizer app using the HelpAbout menu.
EVM AWR1843AOP EVM xwr18xx BoosterPack IWR6843AOP EVM xWR68xx ISK IWR68xx ISK xwr16xx BoosterPack
Following sections describe the general procedure for booting up the device with the demos and then executing it.
xWR14xx
xWR14xx has one cortex R4F core available for user programming and is referred to in this section as MSS or R4F. The demos and the unit tests
executable are provided to be loaded on MSS/R4F.
xWR16xx/xWR18xx/xWR68xx/xWR64xx
These devices have one cortex R4F core and one DSP C674x core available for user programming and are referred to as MSS/R4F and DSS/C674X
respectively. The demos have 2 executables - one for MSS and one for DSS which should be loaded concurrently for the demos to work. See Running
the Demos section for more details. The unit tests may have executables for either MSS or DSS or both. These executables are meant to be run in
standalone operation. This means MSS unit test executable can be loaded and run on MSS R4F without downloading any code on DSS. Similarly,
DSS unit test execuable can be loaded and run on DSS C674x without downloading any code on DSS. The exceptions to this are the Mailbox unit test
named "test_mss_dss_msg_exchange", mmWave unit tests under full and minimal and datapath manager (DPM) unit tests.
3. 2. 1. Demonstration Mode
This mode should be used when either upgrading the factory flashed binaries on the EVM to latest SDK version using the pre-built binaries provided in
the SDK release or for field deployment of mmWave sensors.
1. Follow the procedure mentioned in the section (How to flash an image onto mmWave EVM). Use the mmwave_sdk_<ver>/packages/ti/demo
/<platform>/<demo> /<platform>_<demo>.bin as the METAIMAGE1 file name.
2. Remove the "SOP2" jumper or toggle the SOP2 switch to OFF and reboot the device to run the demo image every time on power up. No
other image loading step is required on subsequent boot to run the demo.
8
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
This mode should be used when debugging with CCS is involved and/or developing an mmWave application where the .bin files keep changing
constantly and frequent flashing of image onto the board is not desirable. This mode allows you to flash once and then use CCS to download a
different image to the device's RAM on every boot.
This mode is the recommended way to run the unit tests for the drivers and components which can be found in the respective test directory for that
component. See section mmWave SDK - TI components for location of each component's test code
boot-up sequence
When the mmWave device boots up in functional mode, the device bootloader starts executing and checks if a serial flash is attached to
the device. If yes, then it expects valid MSS application (and a valid RADARSS firmware and/or DSS application) to be present on the
flash. During development phase of mmWave application, flashing the device with the application under development for every small
change can be cumbersome. To overcome this, user should perform a one-time flash as mentioned in the steps below. The actual user
application under development can then be loaded and reloaded to the MSS program memory (TCMA) and/or DSP L2/L3 memory (only for
mmWave devices with DSP) directly via CCS in the device's functional mode.
Refer to Help inside Code Composer Studio (CCS) to learn more about connecting, loading, running the cores, in general.
3. 3. 1. mmWave Demo
1. Power on the EVM in functional mode with right binary loaded (see section above) and connect it to the PC as shown above with the USB
cable.
2. Browse to the TI gallery app "mmWave Demo Visualizer" at http://dev.ti.com/gallery or use the direct link https://dev.ti.com
/mmWaveDemoVisualizer. Use HelpREADME.md from inside this app for more information on how to run/configure this app.
9
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
2.
http://www.ti.com
a. If this is the first time you are using this App, you may be requested to install a plug-in and the TI Cloud Agent Application. This
step will also install the right XDS110 drivers needed for UART port detection.
b. Once the demo is running on the mmWave sensors and the USB is connected from the board to the PC, the app will try to
automatically detect the COM ports for your device.
i. If auto-detection doesn't work, then you will need to configure the serial ports in this App. Run the device manager on
the PC and locate the following COM ports as shown in the section "How to identify the COM ports for mmWave EVM"
below. In the Visualizer App, go to the Menu->Options->Serial Port and perform the settings as shown below.
CFG_port: Use COM port number for "XDS110 Class Application/User UART": Baud: 115200. This is the
port where CLI (command line interface) runs for all the demos.
Data_port: Use COM port "XDS110 Class Auxiliary Data port": Baud: 921600. This is the port on which
binary data generated by the processing chain in the mmWave demo will be received by the PC. This is the
detected object list and its properties (range, doppler, angle, etc). User can leverage higher baud rates than
921600 by selecting "custom" in the Baud Rates drop down and setting the desired value (max: 3125000).
Recommended values are: 1834000 or 3125000. Note that the sensor should be in stopped or rebooted state
for the changes to take effect. Visualizer communicates with the sensor over CLI port to configure it to the user
provided baud rate in this dialog box.
COM Port
Please note that the COM port numbers on your setup maybe different from the one shown below. Please
use the correct COM port number from your setup for following steps.
a. At this point, this app will automatically try to connect to the target (mmWave Sensor). Note that depending on mmWave SDK
version (mmWave SDK 3.3 and prior) running on the device, only the CFG_port will show connected on successful operation while
the DATA_port may show as "connecting..". DATA_port will be marked connected only after device is configured and sending out
detected point cloud. If CFG_port does not connect or if the connection fails, you should try to connect to the target by clicking in the
bottom left corner of this App. If that fails as well, redo the serial port configuration as shown in "First time Setup" panel above.
b. After the App is connected to the target, you can select the configuration parameters (Frequency Band, Platform, etc) in the "Setup
details" and "Scene Selection" area of the CONFIGURE tab.
c. Besides selecting the configuration parameters, you should select which plots you want to see. This can be done using the "check
boxes" in the "Plot Selection" area. Adjust the frame rate depending on number of plots you want to see. For selecting heatmap
plots, set frame rate to less than or equal to 4 fps. When selecting frame rate to be 25-30fps, for better GUI performance, select only
the scatter plot and statistics plot.
d. Once the configuration is selected, you can send the configuration to the device (use "SEND CONFIG TO MMWAVE DEVICE"
button).
e. After the configuration is sent to the device, you can switch to the PLOTS view/tab and the plots that you selected will be shown.
f. You can switch back from "Plots" tab to "Configure" tab, reconfigure your "Scene Selection", "Object Detection" and/or "Plot
Selection" values and re-send the configuration to the device to try a different profile. After a new configuration has been selected,
just press the "SEND CONFIG TO MMWAVE DEVICE" button again and the device will be reconfigured. This can be done without
rebooting the device. If you change the parameters in the "Setup Details", then you will need to take further action before trying the
new configurations
i. If Platform is changed: make sure the COM ports match the TI EVM/platform you are trying to configure and visualizer
ii. If SDK version is changed: make sure the mmW demo running on the connected TI EVM matches the selected SDK
version in the GUI
iii. If Antenna Config is changed: make sure the TI EVM is rebooted before sending the new configuration.
3. If board is rebooted, follow the steps starting from 1 above.
10
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
3.
Whenever TI EVM is power-cycled (rebooted), you will need to use the bottom left serial port connection icon inside TI gallery app
"mmWave Demo Visualizer" for disconnecting and reconnecting the COM ports. Note that if you used the CLI COM port directly to
send the commands (instead of TI gallery app) you will have to close the CLI teraterm window and open a new one on every
reboot.
Creates or reads the configuration file and sends to the mmWave device using the COM port called CFG_port. It saves the information
locally to be able to make sense of the incoming data that it will display. Refer to the CFG Section for details on the configuration file
contents.
Receives the data generated by the demo on the visualization/Data COM port and processes it to create various displays based on the
GUI configuration in the cfg file.
The format of the data streamed out of the demo is documented in mmw demo's doxygen mmwave_sdk_<ver>\packages\ti\demo\
<platform>\mmw\docs\doxygen\html\index.html under section: "Output information sent to host".
On every reconfiguration, it sends a 'sensorStop' command to the device first to stop the active run of the mmWave device. Next, it sends
the command 'flushCfg' to flush the old configuration before sending the new configuration. It is mandatory to flush the old configuration
before sending a new configuration. Additionally, it is mandatory to send all the commands for that demo/platform even if the user desires
the functionality to be disabled i.e. no commands are optional.
User can configure the device from their own configuration file or the saved app-generated configuration file by using the "LOAD CONFIG
FROM PC AND SEND" button on the PLOTS tab. Make sure the first two commands in this config file are "sensorStop" followed by
"flushCfg".
User can temporarily pause the mmWave sensor by using the "STOP" button on the plots tab. The sensor can be restarted by using the
"START" button. In this case, sensor starts again with the already loaded configuration and no new configuration is sent from the App.
User can simultaneously plot and record the processed/detected objects data coming out of the DATA_port using the "RECORD
START" button in the plots tab. Set the max limits for file size or record time as per your requirements to prevent infinite capturing of data.
The saving of data can be manually stopped using the "Record Stop" button (if the max limits are not reached). Sample python scripts to
parse the point cloud output of the demo are provided in mmwave_sdk_<ver>\packages\ti\demo\parser_scripts. mmw_demo_example_scr
ipt.py is the top level example script that uses the parser module provided in parser_mmw_demo.py. User can customize
the mmw_demo_example_script.py to parse their captured files and process it as per their requirements. As an example, the scripts
dumps the point cloud from all the frames in an xls file.
User can use the "PLAYBACK START" button to playback the data and config file recorded via "RECORD START" button in the plots
tab. User should make sure the data file and the config file used in this playback are the matching set. This feature can only be used when
sensor device is either not connected or stopped.
Once the demo has started and plots are active, user can tune the demo using the "Real Time tuning tab" or "Advanced commands" tab
and then save the tuned profile using "EXPORT TUNED PROFILE" button on the PLOTS tab.
11
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Console message window echoes the following debug information for the users
Every command that is sent to the TI mmWave EVM and the response back from the EVM
Any runtime assert conditions detected by the demo running on TI mmWave EVM after the sensor is started. This is helpful when mmW
demo is flashed onto the EVM and CCS connectivity is not available. It spits out file name and line number to allow users to browse to the
source code and understand the error.
At times, a negative error code is spit out in the error message (either in Visualizer console or in the CCS console window). To understand
or decode that error, please refer to the mmWave demo doxygen ((browse via mmwave_sdk_<ver>\docs\mmwave_sdk_module_documen
tation.html).
Init time calibration status after the first sensorStart is issued post reboot for debugging boot time or start failures
Here is an example of plots that mmWave Demo Visualizer produces based on the config that is passed to the demo application running on mmWave
sensor.
12
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
1. Power on the EVM in functional mode with right binary loaded (see section above) and connect it to the PC as shown above with the USB
cable. Connect mmWave EVM to DCA1000 EVM by following DCA1000EVM Data Capture Card User's Guide. Place SW2.5 in
CONFIG_VIA_SW mode to be able to use the remainder of the instructions specified here.
2. Browse to the TI gallery app "mmWave Demo Visualizer" at http://dev.ti.com/gallery or use the direct link https://dev.ti.com
/mmWaveDemoVisualizer.
3. Default profile in Visualizer disables the LVDS streaming. To enable it, please export the chosen profile and set the appropriate enable bits in
lvdsStreamCfg command. See "Configuration (.cfg) File Format" section for details on the command format, usage and dependencies.
lvdsStreamCfg -1 1 1 1
4. Create a JSON file with any name but with extension .json with following parameters. See section "JSON Config File"
in TI_DCA1000EVM_CLI_Software_UserGuide.pdf. Sample JSON file is shown below.
13
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
datacard_config.json
{
"DCA1000Config": {
"dataLoggingMode": "multi",
"dataTransferMode": "LVDSCapture",
"dataCaptureMode": "ethernetStream",
"lvdsMode": 2,
"dataFormatMode": 3,
"packetDelay_us": 10,
"ethernetConfig": {
"DCA1000IPAddress": "192.168.33.180",
"DCA1000ConfigPort": 4096,
"DCA1000DataPort": 4098
},
"ethernetConfigUpdate": {
"systemIPAddress": "192.168.33.30",
"DCA1000IPAddress": "192.168.33.180",
"DCA1000MACAddress": "12.34.56.78.90.12",
"DCA1000ConfigPort": 4096,
"DCA1000DataPort": 4098
},
"captureConfig": {
"fileBasePath": "C:\\mySavedData",
"filePrefix": "datacard_record",
"maxRecFileSize_MB": 1024,
"sequenceNumberEnable": 1,
"captureStopMode": "infinite",
"bytesToCapture": 1025,
"durationToCapture_ms": 1000,
"framesToCapture": 5
},
"dataFormatConfig": {
"MSBToggle": 0,
"reorderEnable": 1,
"laneFmtMap": 0,
"dataPortConfig": [
{
"portIdx": 0,
"dataType": "complex"
},
{
"portIdx": 1,
"dataType": "complex"
},
{
"portIdx": 2,
"dataType": "complex"
},
{
"portIdx": 3,
"dataType": "complex"
},
{
"portIdx": 4,
"dataType": "complex"
}
]
}
}
}
This json file should match user's setup and the profile.cfg that is used to configure the mmW demo running on mmWave EVM.
14
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. Assuming the file created in previous step is called "datacard_config.json", invoke the following commands from a command prompt (DOS or
bash) on the PC to which the DCA1000 EVM is connected:
a. Windows:
The Windows based CLI (prebuilt binary) can be obtained from mmWave Studio package. Please download and install
mmWave Studio (MMWAVE-STUDIO) version 2.1 or later from http://www.ti.com/tool/MMWAVE-STUDIO and browse to
the installed folder: C:\ti\mmwave_studio_<ver>\mmWaveStudio\PostProc.
@REM start record and wait for the data over ethernet
DCA1000EVM_CLI_Control.exe start_record datacard_config.json
b. Linux:
The Linux based CLI sourcecode can be obtained from mmWave Studio package. Please download and install mmWave
Studio (MMWAVE-STUDIO) version 2.1 or later from http://www.ti.com/tool/MMWAVE-STUDIO and browse to the
installed folder: C:\ti\mmwave_studio_<ver>\mmWaveStudio\ReferenceCode\DCA1000. Copy the 'SourceCode' folder to
a linux machine and use the instructions from C:
\ti\mmwave_studio_<ver>\mmWaveStudio\ReferenceCode\DCA1000\Docs\TI_DCA1000EVM_CLI_Software_UserGuide.
pdf to build the utility for your linux distribution.
# configure DCA1000EVM
./DCA1000EVM_CLI_Control fpga datacard_config.json
6. See previous section for details on operating the Visualizer. Configure the mmW demo running on the mmWave EVM using the Visualizer
and profile.cfg that has lvds streaming turned on. To avoid getting timeout error from DCA1000EVM_CLI_Control, execute this step from the
Visualizer within 30 secs of sending the "start_record" command using DCA1000EVM_CLI_Control.
7. With successful invocation of DCA1000EVM_CLI_Control and Visualizer, the mmWave EVM will send UART stream to get plotted on the
Visualizer and LVDS stream to PC to be saved in a file as configured in "captureConfig" JSON block.
8. Use the following command to stop the LVDS stream capture before issuing "sensorStop" to the mmW demo running on mmWave EVM. One
could send the sensorStop to mmWave EVM followed by stop_record to DCA1000EVM_CLI_Control.exe however this would generate an
errorcode related to record process not running and it can be safely ignored.
a. Windows:
Windows::Stop DCA1000EVM_CLI
b. Linux
15
b.
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Linux::Stop DCA1000EVM_CLI
ii. By default, for mmW demo, the second enabled stream (i.e. for S/W stream if H/W is also enabled) will have the
ID: HSI_HEADER_ID2 : 0x09CC0CC909CC0CC9U and hence the filename would be <File_Prefix>_hdr_0CC9_<iteration>.
bin. See below for one such example file content and its interpretation.
16
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
17
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Sample python based scripts are provided in mmwave_sdk_<ver>\packages\ti\demo\parser_scripts to help parse the demo output data file
saved by DCA1000 data card CLI. lvds_example_script.py is the top level example script that uses the parser module provided in
parser_lvds_demo_captured_file.py. User can customize the lvds_example_script.py to parse their captured files and process it as per their
requirements. As an example, the scripts dumps the point cloud from all the frames in an xls file.
Sample C code implementation of data parsing with header enabled is provided at mmwave_sdk_<ver>\packages\ti\utils\hsiheader\test\dat
a_card.cpp. Use the readme.txt in that location for build and run instructions. (Note that serialize.cpp is no longer required
if "reorderEnable" is set to 1).
data_card.out datacard_record_hdr_0ADC_0.bin
data_card.out datacard_record_hdr_0CC9_0.bin
18
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Each line in the .cfg file describes a command with parameters. The various commands and their arguments are described in the table below
(arguments are in sequence). For mmW demo, users can create their own config files from the Visualizer GUI by using the "Save Config to PC"
button or starting from the few sample profiles provided in the mmwave_sdk_<ver>\packages\ti\demo\<platform>\mmw\profiles directory.
As new versions of SDK releases are available, there are usually changes to the configuration commands that are supported in the new
release. Now, users may have some hand crafted config file which worked perfectly well on older SDK release version but will not work as
is with the new SDK release. If user desires to run the same configuration against the new SDK release, then there is a script
mmwDemo_<platform>_update_config.pl provided in the mmwave_sdk_<ver>\packages\ti\demo\<platform>\mmw\profiles directory that
they can use to convert the configuration file from older release to a compatible version for the new release. Refer to the perl file for details
on how to run the script. Note that users will need to install perl on their machine (there is no strict version requirement at this time). For any
new commands inserted by the script, there will be a comment preceeding that line which is similar to something like this: "Inserting new
mandatory command. Check users guide for details."
Most of the parameters described below are the same as the mmwavelink API specifications (see doxygen mmwave_sdk_<ver>\packages\ti\control\m
mwavelink\docs\doxygen\html\index.html.) Additionally, users can refer to the chirp diagram below to understand the chirp and profile related
parameters or the appnote http://www.ti.com/litv/pdf/swra553
xwr16xx/xwr18xx/xwr64xx
/xwr68xx
19
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
For example, in
xWR1642BOOST, the 2
azimuth antennas can be
enabled using bitmask 0x3 (i.
e. tx1 and tx2).
<cascading> n/a
SoC cascading, not applicable, set
to 0
Reboot the board to try config with different set of <adcOutputFmt> only complex modes are
values in this command Output format : supported
0 - real
This is a mandatory command. 1 - complex 1x (image band filtered
output)
2 - complex 2x (image band
visible))
20
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
txCalibEnCfg Field
Examples:
Examples:
68
Refer to the chirp diagram
16.83 shown above to understand
the relation between various
profile parameters and inter-
dependent constraints.
21
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Examples:
(<numAdcSamples> /
<digOutSampleRate> = "ADC
Sampling Time") Refer to the chirp diagram
shown above to understand
Examples: the relation between various
profile parameters and inter-
5500 dependent constraints.
idle time variation in u-sec (float only value of '0' has been
values allowed) tested within context of mmW
demo
ADC start time variation in u-sec only value of '0' has been
(float values allowed) tested within context of mmW
demo
22
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
The values in this command can be changed chirp end index (chirp start index- any value as per mmwavelink
between sensorStop and sensorStart. 511) doxgen but corresponding
chirpCfg should be defined
This is a mandatory command when
dfeOutputMode is set to 1. number of loops (1 to 255) any value as per mmwavelink
doxgen/device datasheet but
greater than or equal to 4.
23
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
example usage.
<numOfSubFrames> any value as per mmwavelink
Number of sub frames enabled in doxgen
The values in this command can be changed
this frame
between sensorStop and sensorStart.
<forceProfile> only value of 0 is supported
This is a mandatory command when Force profile
dfeOutputMode is set to 3.
<numFrames> any value as per mmwavelink
Number of frames to transmit (1 doxgen
frame = all enabled sub frames)
24
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
0 - disable
25
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
<rangeAzimuthHeatMap>
0 - disable
0 - disable
The values in this command can be changed <subFrameIdx> For legacy mode, that field
between sensorStop and sensorStart and even subframe Index should be set to -1 whereas
when the sensor is running. for advanced frame mode, it
should be set to either the
This is a mandatory command. intended subframe number or
-1 to apply same config to all
subframes.
26
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
<noiseWin> supported
noise averaging window length:
Length of the one sided noise
averaged cells in samples
<guardLen> supported
one sided guard length in samples
<divShift> CFAR_CA:
Cumulative noise sum divisor <divShift> = ceil(log2(2 x
expressed as a shift. <noiseWin>))
CFAR_CAGO/_CASO:
Sum of noise samples is divided by <divShift> = ceil(log2
2^<divShift>. Based on <mode>
and <noiseWin> , this value should (<noiseWin>))
be set as shown in next columns.
In profile_2d.cfg, value of 3
The value to be used here should means that the noise sum is
match the "CFAR averaging mode" divided by 2^3=8 to get the
and the "noise averaging window average of noise samples with
length" that is selected above. window length of 8 samples in
CFAR -CASO mode.
The actual value that is used for
division (2^x) is a power of 2, even
though the "noise averaging
window length" samples may not
have that restriction.
For example:
15
10.75
27
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Antenna coupling signature dominates the range <subFrameIdx> For legacy mode, that field
bins close to the radar. These are the bins in the subframe Index should be set to -1 whereas
range FFT output located around DC. for advanced frame mode, it
should be set to either the
When this feature is enabled, the signature is intended subframe number or
estimated during the first N chirps, and then it is -1 to apply same config to all
subtracted during the subsequent chirps. subframes.
<positiveBinIdx> supported
positive Bin Index (to remove DC
from closest range bins)
Maximum positive range FFT index
to be included for compensation
Static clutter removal algorithm implemented by <subFrameIdx> For legacy mode, that field
subtracting from the samples the mean value of the should be set to -1 whereas
input samples to the 2D-FFT subframe Index for advanced frame mode, it
should be set to either the
The values in this command can be changed intended subframe number or
between sensorStop and sensorStart and even -1 to apply same config to all
when the sensor is running. subframes.
28
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
29
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
<enabled> supported
The values in this command can be changed
1 - enable measurement. This
between sensorStop and sensorStart and even
parameter should be enabled only
when the sensor is running.
using the profile_calibration.cfg
profile in the mmW demo profiles
This is a mandatory command.
directory
0 - disable measurement. This
should be the value to use for all
other profiles.
<targetDistance> supported
distance in meters where strong
reflector is located to be used as
test object for measurement. This
field is only used when
measurement mode is enabled.
<searchWin> supported
distance in meters of the search
window around <targetDistance>
where the peak will be searched
extendedMaxVelocity Velocity disambiguation config message to <subFrameIdx> For legacy mode, that field
datapath. subframe Index should be set to -1 whereas
A simple technique for velocity disambiguation is for advanced frame mode, it
implemented. It corrects target velocities up to should be set to either the
(2*vmax). The output of this feature may not be intended subframe number or
reliable when two or more objects are present in -1 to apply same config to all
the same range bin and are too close in azimuth subframes.
plane.
<enabled> supported.
The values in this command can be changed Enable velocity disambiguation
between sensorStop and sensorStart and even technique Only disabled is supported for
when the sensor is running. 0 - disabled xwr64xx demo running on
1 - enabled IWR6843AOP device.
This is a mandatory command.
CQRxSatMonitor Rx Saturation Monitoring config message for <profile> any value as per mmwavelink
Chirp quality to RadarSS and datapath. See Valid profile Id for this monitoring doxygen but corresponding
mmwavelink doxgen for details on configuration. This profile ID should profileCfg should be defined
rlRxSatMonConf_t. have a matching profileCfg.
CQSigImgMonitor Signal and image band energy Monitoring config <profile> any value as per mmwavelink
message for Chirp quality to RadarSS and Valid profile Id for this monitoring doxygen but corresponding
datapath. See mmwavelink doxgen for details on configuraiton. This profile ID should profileCfg should be defined
rlSigImgMonConf_t. have a matching profileCfg
30
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
lvdsStreamCfg Enables the streaming of various data streams <subFrameIdx> For legacy mode, that field
over LVDS lanes. When this feature is enabled, subframe Index should be set to -1 whereas
make sure chirpThreshold in adcbufCfg is set to 1. for advanced frame mode, it
should be set to either the
The values in this command can be changed intended subframe number or
between sensorStop and sensorStart. -1 to apply same config to all
subframes.
This is a mandatory command.
<enableHeader> supported
0 - Disable HSI header for all active
streams
1 - Enable HSI header for all active
streams
<dataFmt> supported
Controls HW streaming.
Specifies the HW streaming data When choosing
format. CP_ADC_CQ, please ensure
0-HW STREAMING DISABLED that CQRxSatMonitor and
1-ADC CQSigImgMonitor commands
4-CP_ADC_CQ are provided with appropriate
values and these monitors are
enabled using analogMonitor
command.
<enableSW> supported
0 - Disable user data (SW session)
1 - Enable user data (SW session)
bpmCfg BPM MIMO configuration. <subFrameIdx> For legacy mode, that field
Every frame should consist of alternating chirps with subframe Index should be set to -1 whereas
pattern TXA+TxB and TXA-TXB where TXA and for advanced frame mode, it
TXB are two azimuth TX antennas. This is alternate should be set to either the
configuration to TDM-MIMO scheme and intended subframe number or
provides SNR improvement by running 2Tx -1 to apply same config to all
simultaneously. When using this scheme, user subframes.
should enable both the azimuth TX in the
chirpCfg. See profile_2d_bpm.cfg profile in the <enabled> supported
xwr16xx mmW demo profiles directory for 0-Disabled
example usage. 1-Enabled
This config is supported and mandatory only for <chirp0Idx> any value as per mmwavelink
demos that use Doppler DSP DPU (xwr16xx doxygen but corresponding
/xwr68xx). This config is not supported and is not chirpCfg should be defined
needed for demos that use Doppler HWA DPU BPM enabled:
(xwr18xx/xwr64xx). If BPM is enabled in previous
argument, this is the chirp index for
the first BPM chirp. It will have
phase 0 on both
TX antennas (TXA+ , TXB+). Note
that the chirpCfg command for this
chirp index must have both TX
antennas enabled.
BPM disabled:
If BPM is disabled, a BPM disable
command (set phase to zero on
both TX antennas) will be issued
for the chirps in the range
[chirp0Idx..chirp1Idx]
31
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
BPM disabled:
If BPM is disabled, a BPM disable
command (set phase to zero on
both TX antennas) will be issued
for the chirps in the range
[chirp0Idx..chirp1Idx].
Provides user to either save the boot time RF 0 - Save enabled. Application will
calibration performed by the RadarSS onto the boot-up normally and configure the
FLASH or to restore the previously saved RF RadarSS to perform all applicable
calibration data from the FLASH and instruct boot calibrations during
RadarSS to not re-perform the boot-time mmWave_open. Once the
calibration. User can either save or restore or calibrations are performed,
perform neither operations. User is not allowed to application will retrieve the
simultaneous save and restore in a given boot calibration data from RadarSS and
sequence. save it to FLASH. User need to
specify valid <flash offset>
xwr18xx/60 Ghz devices: Boot time phase shift value. <restore enable> option
calibration data is also saved along with all other should be set to 0.
calibration data.
1 - Restore disabled.
32
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
33
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
4. How-To Articles
Troubleshooting Tip
If the COM ports don't show up in the Device Manager or are not working (i.e. no demo output seen on the data port), then one of these
steps would apply depending on your setup:
1. If you want to run the Out-of-box demo, simple browse to the Visualizer (https://dev.ti.com/mmWaveDemoVisualizer) and follow
the one-time setup instructions.
2. If you are trying to flash the board, using Uniflash tool and following the cloud or desktop version installation instructions would
also install the right drivers for the COM ports.
3. If above methods didnt work and if TI code composer studio is not installed on that PC, then download and install the standalone
XDS110 drivers.
4. If TI code composer studio is installed, then version of CCS and emulation package need to be checked and updated as per the
mmWave SDK release notes. See section Emulation Pack Update for more details.
After following the above steps, disconnect and re-connect the EVM and you should see the COM ports now. See the highlighted COM ports in the Fig
ure below
COM Port
Please note that the COM port numbers on your setup maybe different from the one shown above. Please use the correct COM port
number from your setup for following steps.
Refer to the EVM User Guide to understand the bootup modes of the EVM and the SOP jumper/switch locations (See "Sense-on-Power
(SOP) Jumpers" section in mmWave device's EVM user guide). To put the EVM in flashing mode, power off the board and either place
jumpers on pins marked as SOP2 and SOP0 or toggle SOP0 and SOP2 switches to ON .
34
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
0 0 1 Functional Mode
Device Bootloader loads user application from QSPI Serial Flash to internal RAM and switches
the control to it
Device Bootloader spins in loop to allow flashing of user application to the serial flash.
2. Procure the Images
For flashing xWR1xxx devices, TI Uniflash tool should be used. Users can either use the cloud version available at https://dev.ti.com/uniflash/
or download the desktop version available at http://www.ti.com/tool/UNIFLASH. Detailed instructions on how to use the GUI are described in
the Uniflash document " UniFlash User Guide for mmWave Devices " located at http://processors.wiki.ti.com/index.php/Category:
CCS_UniFlash. This document talks about the steps from the perspective of desktop GUI but the flashing steps (except for installation)
should apply for cloud version as well. For the SDK packaged demos and ccsdebug utility, there is a bin file provided in their respective
folder: <platform>_<demo|ccsdebug>.bin which is the metaImage to be used for flashing. The metaImage already has the MSS, BSS
(RADARSS) and DSS (as applicable) application combined into one file. These bin files can be selected in Uniflash based on the working
mode. Users can use these instructions to flash the metaImage of their custom demo as well.
a. For demo mode, mmwave_sdk_<ver>\ti\demo\<platform>\mmw\<platform>_mmw_demo.bin should be selected.
b. For CCS development mode, mmwave_sdk_<ver>\ti\ utils\ccsdebug\<platform>_ccsdebug.bin should be selected.
3. Flashing procedure
Power up the EVM and check the Device Manager in your windows PC. Note the number for the serial port marked as "XDS110 Class
Application/User UART" for the EVM. Lets say for this example, it showed up as COM25. Use this COM port in the TI Uniflash tool. Follow
the remaining instructions in the " UniFlash v4 User Guide for mmWave Devices " to complete the flashing.
4. Switch back to Functional Mode
Refer to the EVM User Guide to understand the bootup modes of the EVM and the SOP jumpers (See "Sense-on-Power (SOP) Jumpers"
section in mmWave device's EVM user guide). To put the EVM in functional mode, power off the board and remove jumpers from "SOP2" pin
and leave the jumper on "SOP0" pin or toggle SOP0 switch to ON and SOP2 switch to OFF.
1. If your CCS does not already show "Target Configurations" window, do View->Target Configurations
2. This will show the "Target Configurations" window, right click in the window and select "New Target Configuration"
3. Give an appropriate name to the ccxml file you want to create for the EVM
4. Scroll the "Connection" list and select "Texas Instruments XDS110 USB Debug Probe", when this is done, the "Board or Device" list will be
filtered to show the possible candidates, find and choose the mmWave device (AWR or IWR) of interest and check the box. Click Save and
the file will be created.
35
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
36
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
4. 5. 1. Build Instructions
Follow the mmwave_sdk_release_notes instructions to install the mmwave_sdk in your development environment (windows or linux). All the tools
needed for mmwave sdk build are installed as part of mmwave sdk installer.
4. 5. 2. 1. Windows
1. Create command prompt at <mmwave_sdk_<ver> install path>\packages\scripts\windows folder. Under this folder you should see a setenv.
bat file that has all the tools environment variables set automatically based on the installation folder. Review this file and change the few build
variables shown below (if needed) and save the file. Please note that the rest of the environment variables should not be modified if the
standard installation process was followed.
@REM ###############################################################################
@REM # Build variables (to be modified based on build need)
@REM ###############################################################################
@REM Select your device. Options (case sensitive) are: awr14xx, iwr14xx, awr16xx, iwr16xx, awr18xx, iwr18xx,
iwr68xx, awr68xx
set MMWAVE_SDK_DEVICE=iwr68xx
@REM If download via CCS is needed, set below define to yes else no
@REM yes: Out file created can be loaded using CCS.
@REM Binary file created can be used to flash
@REM no: Out file created cannot be loaded using CCS.
@REM Binary file created can be used to flash
@REM (additional features: write-protect of TCMA, etc)
set DOWNLOAD_FROM_CCS=yes
@REM If using a secure device this variable needs to be updated with the path to mmwave_secdev_<ver> folder
set MMWAVE_SECDEV_INSTALL_PATH=
@REM If using a secure device, this variable needs to be updated with the path to hsimage.cfg file that
@REM has customer specific certificate/key information. A sample hsimage.cfg file is in the secdev package
set MMWAVE_SECDEV_HSIMAGE_CFG=%MMWAVE_SECDEV_INSTALL_PATH%/hs_image_creator/hsimage.cfg
Refer to the MMWAVE-SECDEV User Guide to setup environment needed for builds for high secure (HS) devices. For non secure
devices the MMWAVE_SECDEV_INSTALL_PATH environment variable should be empty.
If you see the following line in the setenv.bat file then most probably the wrong installer was used (Linux installation being
compiled under Windows)
set MMWAVE_SDK_TOOLS_INSTALL_PATH=__MMWAVE_SDK_TOOLS_INSTALL_PATH__
In a proper installation the __MMWAVE_SDK_TOOLS_INSTALL_PATH__ would have been replaced with the actual installation
folder path
Run setenv.bat
setenv.bat
This should not give errors and should print the message "mmWave Build Environment Configured". The build environment is now setup.
4. 5. 2. 2. Linux
1.
37
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
1. Open a terminal and cd to <mmwave_sdk_<ver> install path>/packages/scripts/unix. Under this folder you should see a setenv.sh file that
has all the tools environment variables set automatically based on the installation folder. Review this file and change the few build variables
shown below (if needed) and save the file. Please note that the rest of the environment variables should not be modified if the standard
installation process was followed.
###############################################################################
# Build variables (to be modified based on build need)
###############################################################################
@REM Select your device. Options (case sensitive) are: awr14xx, iwr14xx, awr16xx, iwr16xx, awr18xx, iwr18xx,
iwr68xx, awr68xx
set MMWAVE_SDK_DEVICE=iwr68xx
# If using a secure device, this variable needs to be updated with the path to mmwave_secdev_<ver> folder
export MMWAVE_SECDEV_INSTALL_PATH=
# If using a secure device, this variable needs to be updated with the path to hsimage.cfg file that
# has customer specific certificate/key information. A sample hsimage.cfg file is in the secdev package
export MMWAVE_SECDEV_HSIMAGE_CFG=${MMWAVE_SECDEV_INSTALL_PATH}/hs_image_creator/hsimage.cfg
Refer to the MMWAVE-SECDEV User Guide to setup environment needed for builds for high secure (HS) devices. For non secure
devices the MMWAVE_SECDEV_INSTALL_PATH environment variable should be empty.
If you see the following line in the setenv.sh file then most probably the wrong installer was used (Windows installation being
compiled under Linux)
export MMWAVE_SDK_TOOLS_INSTALL_PATH=__MMWAVE_SDK_TOOLS_INSTALL_PATH__
In a proper installation the __MMWAVE_SDK_TOOLS_INSTALL_PATH__ would have been replaced with the actual installation
folder path
2. Assuming build is on a Linux 64bit machine, install modules that allows Linux 32bit binaries to run. This is needed for Image Creator binaries
3. Install build-essential package for 'make'. Install mono-complete package as one of the Image Creator binaries (out2rprc.exe) is a windows
executable that needs mono to run in Linux environment
Run setenv.sh
source ./setenv.sh
This should not give errors and should print the message "mmWave Build Environment Configured". The build environment is now setup.
4. 5. 3. Building demo
To clean build a demo, first make sure that the environment is setup as detailed in earlier section. Then run the following commands. On successful
execution of the commands, the output is <demo>.xe* which can be used to load the image via CCS and <demo>.bin which can be used as the binary
in the steps mentioned in section "How to flash an image onto mmWave EVM".
38
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
REM Fill <device type> with appropriate device that supports demo in a particular release
cd %MMWAVE_SDK_INSTALL_PATH%/ti/demo/<device type>/mmw
# Fill <device type> with appropriate device that supports demo in a particular release
cd ${MMWAVE_SDK_INSTALL_PATH}/ti/demo/<device type>/mmw
# Incremental build
gmake all
Each demo has dependency on various drivers and control components. The libraries for those components need to be available in their
respective lib folders for the demo to build successfully.
4. 5. 4. Advanced build
The mmwave sdk package includes all the necessary libraries and hence there should be no need to rebuild the driver, algorithms or control
component libraries. In case a modification has been made to any of these modules then the following section details how to build these components.
39
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
cd %MMWAVE_SDK_INSTALL_PATH%/ti/<component_path_under_ti>
gmake clean
gmake all
REM For example to build the adcbuf lib and unit test
cd %MMWAVE_SDK_INSTALL_PATH%/ti/drivers/adcbuf
gmake clean
gmake all
REM For example to build the mmwavelink lib and unit test
cd %MMWAVE_SDK_INSTALL_PATH%/ti/control/mmwavelink
gmake clean
gmake all
REM Additional build options for each component can be found by invoking make help
gmake help
cd ${MMWAVE_SDK_INSTALL_PATH}/ti/<component_path_under_ti>
gmake clean
gmake all
40
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
********************************************************************
* Makefile Targets for the ADCBUF
clean -> Clean out all the objects
drv -> Build the Driver only
drvClean -> Clean the Driver Library only
test -> Builds all the unit tests for the SOC
testClean -> Cleans the unit tests for the SOC
********************************************************************
example output of make help for mmwave control and alg component
********************************************************************
* Makefile Targets for the mmWave Control
clean -> Clean out all the objects
lib -> Build the Core Library only
libClean -> Clean the Core Library only
test -> Builds all the Unit Test
testClean -> Cleans all the Unit Tests
********************************************************************
Please note that not all components are supported for all devices and not all components have unit tests. List of supported components for
each device is listed in the Release Notes.
41
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 1. System Deployment
A typical mmWave application would perform these operations:
a. Application code for MSS and DSP-SS is downloaded from the serial flash memory attached to the mmWave device (via QSPI)
b. Optional high level control from remote entity
c. Sends low speed data output (objects detected) to remote entity
d. Optional high speed data (debug) sent out of device over LVDS
The above deployment can be realized using the mmWave SDK and it components in a layered structure as shown below:
42
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Using mmWave SDK the above chain could be realized as shown in the following figure for devices with HWA or DSP as processing nodes. In the
following figure, green arrow shows the control path and red arrow shows the data path. Blue blocks are mmWave SDK components and yellow
blocks are custom application code. The hierarchy of software flow/calls is shown with embedding boxes. Depending on the complexity of the higher
algorithms (such as clustering, tracking, etc) and their memory/mips consumption, they can either be partially realized inside the mmWave device or
would run entirely on the external processor.
5. 2. 0. 0. 1Figure 9: Typical mmWave radar processing chain using mmWave SDK components
Each of the mmWave device offers different processing nodes to realize the mmwave processing. xWR14xx has HWA engine, xWR16xx has DSP
C674x core, xWR68xx and xWR18xx have HWA+DSP(C674x). For devices with multiple processing nodes, the mmWave detection processing chain
can exploit them as needed for performance and scalable reasons. Shown below is an example of detection processing chain that uses various data
processing units (DPUs) to perform the typical mmwave processing upto the point cloud. The mmwave data representation in mmWave device
memory forms an interface layer between the various DPUs. Each DPU can be realized independently using HWA or DSP processing node - the
choice is either driven by usecase or availability of that processing node on a given mmWave device. The various mmWave SDK components shown
below are described in the section "mmWave SDK - TI components" below.
43
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Please refer to the code and documentation inside the mmwave_sdk_<ver>\packages\ti\demo\<platform>\mmw folder for more details and example
code on how this chain is realized using mmWave SDK components.
5. 3. 1. RF Control Path
The control path in the above processing chain is depicted by the following blocks.
44
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Following set of figures shows how an application programming sequence would look like for setting up the typical control path - init, config, start. This
is a high level diagram simplified to highlight the main software APIs and may not show all the processing elements and call flow. For an example
implementation of this call flow, please refer to the code and documentation inside the mmwave_sdk_<ver>\packages\ti\demo\<platform>\mmw folder.
45
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 3. 1. 1. 1Figure 12: mmWave Isolation mode: Detailed Control Flow (Init sequence)
46
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 3. 1. 1. 2Figure 13: mmWave Isolation mode: Detailed Control Flow (Config sequence)
47
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 3. 1. 1. 3Figure 14: mmWave Isolation mode: Detailed Control Flow (start sequence)
48
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 3. 1. 2. 1Figure 15: mmWave Co-operative Mode: Detailed Control Flow (Init sequence)
5. 3. 1. 2. 2Figure 16: mmWave Co-operative Mode: Detailed Control Flow (Config sequence)
49
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 3. 1. 2. 3Figure 17: mmWave Co-operative Mode: Detailed Control Flow (Start sequence)
5. 3. 2. Data Path
The mmwave detection processing can be split into following layers of application code, control/management layer to manipulate the data processing
elements, processing chain that ties up individual modules to create a data flow and the low level data processing modules and interfaces.
mmWave devices present a few options on how the data processing layers can be realized using the various control/processing nodes within the
device. To allow ease of programming across these deployment types, data path manager (DPM) presents a simplified API structure to the application
while hiding the complexity of inter task and inter processor communications. As can be seen from the following figures, application would just need to
call the various DPM APIs to control the processing chain (seen as function calls in 'blue' in the ladder diagrams below) and re-act to the outcome of
these APIs in the report callback. Data processing chains (DPCs) also present a standardized API structure to the application via DPM and
encapsulate the realization of the data flow using data processing units (DPUs) within while presenting simple IOCTL based interface to configure and
trigger the data flow. Based on the usecase and the mmWave device hardware capabilities, application can choose from one of the following
deployments:
DPC runs on the same core as control core and the application can control the DPC via DPM in local mode. (See local domain config and pro
cessing figures below)
50
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
DPC runs on another core which is different from the controlling core and the application can control the DPC via DPM in remote mode. (See
remote domain config and processing figures below)
DPC is split between two cores and the application can control the DPC via DPM in distributed mode. (See distributed domain config and proc
essing figures below)
The following ladder diagrams show the flow for init, two different forms of config (one initiated on local core and other on remote core), start trigger,
chirps/frame events and stop trigger. The choice of MSS and DSS responsibilities are shown as one of the possible examples - their roles can be
interchanged as per application needs. These ladder diagrams don't show the corresponding MMWAVE/RF control calls to show independence
between RF control and datapath control. Having said that, typical application would follow the following flow for these two form of controls:
5. 3. 2. 1. 1Figure 19: Data processing flow with local domain control (init/config)
51
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 3. 2. 1. 2Figure 20: Data processing flow with local domain control (start/chirp/frame/stop)
52
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 3. 2. 2. 1Figure 21: Data processing flow with remote domain control (init/config)
5. 3. 2. 2. 2Figure 22: Data processing flow with remote domain control (start/chirp/frame/stop)
53
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 4. 1. Demos
5. 4. 1. 1. mmWave Demo
This demo is located at mmwave_sdk_<ver>/packages/ti/demo/<platform>/mmw folder. The millimeter wave demo shows some of the radar sensing
and object detection capabilities of the SoC using the drivers in the mmWave SDK (Software Development Kit). It allows user to specify the chirping
profile and displays the detected objects and other information in real-time. A detailed explanation of this demo is available in the demo's docs folder
and can be browsed via mmwave_sdk_<ver>/docs/mmwave_sdk_module_documentation.html. This section captures the high level layout of the
demo supported on various mmWave devices. For details on individual components (control layer, datapath layer, etc), refer to the remaining sub-
sections under "mmWave SDK - TI components".
54
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
xWR6843 (QM
/SIL2/ASILB)
EVM xwr18xx BoosterPack AWR1843AOP EVM IWR6843AOP EVM xWR68xx ISK IWR68xx ISK xwr16xx BoosterPack
mmWave API R4F (MSS) R4F (MSS) R4F (MSS) R4F (MSS) R4F (MSS) R4F (MSS)
/RF control
Range Proc HWA based DPU HWA based DPU (driven HWA based DPU (driven HWA based DPU HWA based DPU DSP
DPU (driven by DSP) by DSP) by R4F) (driven by R4F) (driven by R4F)
Static Clutter DSP DSP R4F (MSS) R4F (MSS) DSP DSP
Removal
Doppler Proc HWA based DPU HWA based DPU (driven HWA based DPU (driven HWA based DPU DSP DSP
DPU (driven by DSP) by DSP) by R4F) (driven by R4F)
CFAR DPU CFAR-CA HWA CFAR-CA HWA based CFAR-CA HWA based CFAR-CA HWA CFAR-CA using CFAR-CA using
based DPU (driven DPU (driven by DSP) DPU (driven by R4F) based DPU (driven DSP DSP
by DSP) by R4F)
AoA DPU HWA based DPU HWA based DPU (driven HWA based DPU using HWA based DPU DSP DSP
(driven by DSP) by DSP) 2D FFT method (driven (driven by R4F)
by R4F)
5. 4. 2. Drivers
Drivers encapsulate the functionality of the various hardware IPs in the system and provide a well defined API to the higher layers. The drivers are
designed to be OS-agnostic via the use of OSAL layer. Following figure shows typical internal software blocks present in the SDK drivers. The source
code for the SDK drivers are present in the mmwave_sdk_<ver>\packages\ti\drivers\<ip> folder. Documentation of the API is available via doxygen
and placed at mmwave_sdk_<ver>\packages\ti\drivers\<ip>\docs\doxygen\html\index.html and can be browsed easily via mmwave_sdk_<ver>/docs
/mmwave_sdk_module_documentation.html.. The driver's unit test code, running on top of SYSBIOS is also provided as part of the package mmwave_
sdk_<ver>\packages\ti\drivers\<ip>\test\. The library for the drivers are placed in the mmwave_sdk_<ver>\packages\ti\drivers\<ip>\lib directory and
the file is named lib<ip>_<platform>.aer4f for MSS and lib<ip>_<platform>.ae674 for DSP.
('all' here
excludes
xwr14xx)
55
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
ADCBUF all all All features of IP (ADCBUF, CQ) are implemented in the driver
(*By default, prebuilt CBUFF driver library only supports ADC and CP_ADC_CQ formats but the driver library can
be rebuilt for additional formats ADC_CP and CP_ADC. See CBUFF driver doxygen documentation for more
details)
CRC all all All features of IP are implemented in the driver including:
CRC-16
CRC-32
CRC-64
CRYPTO xwr16xx (HS) - The driver supports following AES mode of encryption:
MD5
SHA-1
SHA-224
SHA-256
EDMA all all All features of IP are implemented in the driver except "privilege" feature
56
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
ESM all all Default ESM FIQ Interrupt handler for R4F and hook function for DSP's NMI
HWA all except all except All features of IP are implemented in the driver
xwr16xx xwr16xx
OSAL all all Provides an abstraction layer for some of the common OS services:
Semaphore
Mutex
Debug
Interrupts
Clock
Memory
PINMUX all - All Pinmux fields can be set and all device pad definitions are available
SOC all all Provides abstracted APIs for system-level initialization. See section "mmWave SDK - System Initialization" for
more details.
SPI (MIBSPI) all - All features of IP are implemented in the driver including:
4-wire Slave and master mode
3-wire Slave and Master mode
both polling mode and DMA mode for read/write
char length 8-bit and 16-bit.
UART all all All features of IP are implemented in the driver including:
Standard Baud Rates: 9600, 14400, 19200 till 921600
Data Bits: 7 and 8 Bits
Parity: None, Odd and Even
Stop Bits: 1 and 2 bits
Blocking and Polling API for reading and writing to the UART instance
DMA support for read/write APIs
5. 4. 3. OSAL
An OSAL layer is present within the mmWave SDK to provide the OS-agnostic feature of the foundational components (drivers, mmWaveLink,
mmWaveAPI). This OSAL provides an abstraction layer for some of the common OS services: Semaphore, Mutex, Debug, Interrupts, Clock, Memory,
CycleProfiler. The source code for the OSAL layer is present in the mmwave_sdk_<ver>\packages\ti\drivers\osal folder. Documentation of the APIs
are available via doxygen and placed at mmwave_sdk_<ver>\packages\ti\drivers\osal\docs\doxygen\html\index.html. A sample porting of this OSAL
for TI RTOS is provided as part of the mmWave SDK. System integrators could port the OSAL for their custom OS or customize the same TI RTOS
port for their custom application, as per their requirements.
MemoryP module - for example, choosing from among a variety of heaps available in TI RTOS (SYSBIOS), or use own allocator.
Hardware interrupt mappings. This case is more pronounced for the C674 DSP which has only 16 interrupts (of which 12 are available under
user control) whereas the events in the SOC are much more than 16. These events go to the C674 through an interrupt controller (INTC) and
Event Combiner (for more information see the C674x megamodule user guide at http://www.ti.com/lit/ug/sprufk5a/sprufk5a.pdf). The default
OSAL implementation provided in the release routes all events used by the drivers through the event combiner. If a user chooses to route
differently (e.g for performance reasons), they may add conditional code in OSAL implementation to route specific events through the INTC
and event combiner blocks. User can conveniently use event defines in ti/common/sys_common_*.h to acheive this.
5. 4. 4. mmWaveLink
mmWaveLink is a control layer and primarily implements the protocol that is used to communicate between the Radar Subsystem (RADARSS) and
the controlling entity which can be either Master subsystem (MSS R4F) and/or DSP subsystem (DSS C674x). It provides a suite of low level APIs that
the application (or the software layer on top of it) can call to enable/configure/control the RADARSS. It provides a well defined interface for the
application to plug in the correct communication driver APIs to communicate with the RADARSS. it acts as driver for Radar SS and exposes services
of Radar SS. It includes APIs to configure HW blocks of Radar SS and provides communication protocol for message transfer between MSS/DSS and
RADAR SS.
57
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Following figure shows the various interfaces/APIs of the mmWaveLink component. The source code for mmWaveLink is present in the mmwave_sdk_
<ver>\packages\ti\control\mmwavelink folder. Documentation of the API is available via doxygen placed at mmwave_sdk_<ver>\packages\ti\control\m
mwavelink\docs\doxygen\html\index.html and can be easily browsed via mmwave_sdk_<ver>/docs/mmwave_sdk_module_documentation.html. The
component's unit test code, running on top of SYSBIOS is also provided as part of the package: mmwave_sdk_<ver>\packages\ti\control\mmwavelink\
test\ .
5. 4. 5. mmWave API
mmWaveAPI is a higher layer control running on top of mmWaveLink and LLD API (drivers API). It is designed to provide a layer of abstraction in the
form of simpler and fewer set of APIs for application to perform the task of mmWave radar sensing. In mmwave devices with dual cores, it also
provides a layer of abstraction over IPC to synchronize and pass configuration between the MSS and DSS domains. The source code for mmWave
API layer is present in the mmwave_sdk_<ver>\packages\ti\control\mmwave folder. Documentation of the API is available via doxygen placed at mmw
ave_sdk_<ver>\packages\ti\control\mmwave\docs\doxygen\html\index.html and can be easily browsed via mmwave_sdk_<ver>/docs
/mmwave_sdk_module_documentation.html.. The component's unit test code, running on top of SYSBIOS is also provided as part of the
package: mmwave_sdk_<ver>\packages\ti\control\mmwave\test\.
58
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
There are two modes of configurations which are provided by the mmWave module.
5. 4. 5. 1. Full configuration
The "full" configuration mode implements the basic chirp/frame sequence of mmWave Front end and is the recommended mode for application to use
when using the basic chirp/frame configuration. In this mode the application will use the entire set of services provided by the mmWave control
module. These features includes:-
In the full configuration mode; it is possible to create multiple profiles with multiple chirps. The following APIs have been added for this purpose:-
Chirp Management:
MMWave_addChirp
MMWave_delChirp
59
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Profile Management:
MMWave_addProfile
MMWave_delProfile
5. 4. 5. 2. Minimal configuration
For advanced users, that either need to use advanced frame config of mmWave Front End or need to perform extra sequence of commands in the
CONFIG routine, the minimal mode is recommended. In this mode the application has access to only a subset of services provided by the mmWave
control module. These features includes:-
In this mode the application is responsible for directly invoking the mmWave Link API in the correct order as per their configuration requirements. The
configuration services are not available to the application; so in mmwave devices with multiple cores (ex: xwr16xx, xwr68xx, etc), the application is
responsible for passing the configuration between the MSS and DSS if required.
5. 4. 5. 2. 1Figure 28: mmWave API - 'Minimal' Config - Sample flow (mmWave devices with MSS and DSS cores and module in co-operative mode)
60
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 4. 5. 2. 2Figure 29: mmWave API - 'Minimal' Config - Sample flow (mmWave devices with single core or when module is used in isolation mode)
mmWave API, by default, enables all init/boot time time calibrations for mmWave Front End. There is a provision for user to provide custom
calibration mask in MMWave_open API and/or to provide a buffer that has pre-stored calibration data.
When application requests the one-time and periodic calibrations in MMWave_start API call, mmWave API enables all the available one-
time and periodic calibrations for mmWave Front End.
mmWave API doesn't expose the mmwavelink's LDO bypass API (rlRfSetLdoBypassConfig/rlRfLdoBypassCfg_t) via any of its API. If this
functionality is needed by the application (either because of the voltage of RF supply used on the TI EVM/custom board or from monitoring
point of view), user should refer to mmwavelink doxygen (mmwave_sdk_<ver>\packages\ti\control\mmwavelink\docs\doxygen\html\index.
html) on the usage of this API and call this API from their application before calling MMWave_open().
mmWave_open
Although mmWave_close API is provided, it is recommended to perform mmWave_open only once per power-cycle of the sensor.
61
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
Range Processing (ADC data to Radar Cube): This processing unit performs (1D FFT+ optional DC Range Calib) processing on the chirp
(RF) data during the active frame time and produces the processed data in the radarCube. This processing unit is standardized in the
mmWave SDK. It provides implementation based on both HWA and DSP. HWA based implementation can be instantiated either on R4F or
C674x. The source code for Range DPU is present in the mmwave_sdk_<ver>\packages\ti\datapath\dpu\rangeproc folder. Documentation of
the API is available via doxygen and placed at mmwave_sdk_<ver>\packages\ti\datapath\dpu\rangeproc\docs\doxygen\html\index.html. The
component's unit test code, running on top of SYSBIOS is also provided as part of the package: mmwave_sdk_<ver>\packages\ti\ datapath\d
pu\rangeproc\test\ .
Static Clutter Processing (Radar Cube to Radar Cube): When enabled, this processing unit reads Range FFT out data from the radar cube
and performs static clutter removal before writing the data back to the radar cube during the interframe time. This processing unit is offered
as reference implementation and users of SDK could either re-use these as is in their application/processing chain or create variations of
these units based on their specific needs. It provides S/W based implementation and can be instantiated either on R4F or C674x. The source
code for StaticClutter DPU is present in the mmwave_sdk_<ver>\packages\ti\datapath\dpc\dpu\staticclutterproc folder. Documentation of the
API is available via doxygen and placed at mmwave_sdk_<ver>\packages\ti\datapath\dpc\dpu\staticclutterproc\docs\doxygen\html\index.html.
Doppler Processing (Radar Cube to Detection Matrix): This processing unit performs (2D FFT + Energy Sum) processing on the radar Cube
during the inter frame and produced detection matrix. This processing unit is offered as reference implementation and users of SDK could
either re-use these as is in their application/processing chain or create variations of these units based on their specific needs. It provides
implementation based on both HWA and DSP. HWA based implementation can be instantiated either on R4F or C674x. DSP based
implementation incorporates static clutter algorithm for optimal memory/mips usage and user can skip using the standalone static clutter
DPU. The source code for Doppler DPU is present in the mmwave_sdk_<ver>\packages\ti\datapath\dpc\dpu\dopplerproc folder.
Documentation of the API is available via doxygen and placed at mmwave_sdk_<ver>\packages\ti\datapath\dpc\dpu\dopplerproc\docs\doxyg
en\html\index.html.
CFAR + AoA (Detection Matrix to Point Cloud): They are offered as two independent DPUs and collectively run CFAR-CA algorithm, peak
grouping, field-of-view filtering, doppler compensation, max velocity enhancement and angle (azimuth+elevation) estimation on the detection
matrix during inter frame to produce the point cloud. These processing units are offered as reference implementation and users of SDK could
either re-use these as is in their application/processing chain or create variations of these units based on their specific needs. They provide
implementation based on both HWA and DSP. HWA based implementation can be instantiated either on R4F or C674x. For HWA
implementation, two different algorithms are provided for AoA processing - one is the legacy method that performs independent 1D FFT on
different antenna symbol rows to determine azimuth and elevation; other algorithm uses 2D FFT on the 2D antenna symbol array to create a
two-dimensional (azimuth and elevation dimensions) output in which peaks are searched for determining azimuth and elevation for the
detected objects.
The source code for CFAR-CA DPU is present in the mmwave_sdk_<ver>\packages\ti\datapath\dpc\dpu\cfarcaproc folder.
Documentation of the API is available via doxygen and placed at mmwave_sdk_<ver>\packages\ti\datapath\dpc\dpu\cfarcaproc\docs
\doxygen\html\index.html. The component's unit test code, running on top of SYSBIOS is also provided as part of the package: mmw
ave_sdk_<ver>\packages\ti\ datapath\dpc\dpu\cfarcaproc\test\.
The source code for AoA DPU is present in the mmwave_sdk_<ver>\packages\ti\datapath\dpc\dpu\aoaproc folder. Documentation
of the API is available via doxygen and placed at mmwave_sdk_<ver>\packages\ti\datapath\dpc\dpu\aoaproc\docs\doxygen\html\ind
ex.html. The component's unit test code, running on top of SYSBIOS is also provided as part of the package: mmwave_sdk_<ver>\p
ackages\ti\ datapath\dpc\dpu\aoaproc\test\ .
The source code for AoA DPU using 2D FFT method is present in the mmwave_sdk_<ver>\packages\ti\datapath\dpc\dpu\aoa2dproc
folder. Documentation of the API is available via doxygen and placed at mmwave_sdk_<ver>\packages\ti\datapath\dpc\dpu\aoa2dpr
oc\docs\doxygen\html\index.html.
All external DPU APIs start with the prefix DPU_. DPU unique name follows next.
Ex: DPU_RangeProcHWA_init
Standard external APIs: init, config, process, ioctl, deinit are provided by each DPU.
Init: one time initialization of DPU
Config: complete configuration of the DPU: hardware resources, static and dynamic (if supported by DPU)
62
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
A typical call flow for DPUs could be represented as follows. The timing of config and process API calls with respect to chirp/frame would vary
depending on the DPU functionality, its usage in the chain, DPC implementation and overlap of hardware resources.
Datapath control on R4F and datapath execution is split between R4F/HWA and DSP (Distributed)
Datapath control on R4F and datapath execution is on R4F using HWA (Local)
Datapath control on R4F and datapath execution is on DSP (with and without HWA) (Remote)
Datapath control on DSP and datapath execution is on DSP+HWA (Local)
Datapath control on DSP and datapath execution is on DSP (Local)
63
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
The source code for DPM is present in the mmwave_sdk_<ver>\packages\ti\control\dpm folder. Documentation of the API is available via doxygen
and placed at mmwave_sdk_<ver>\packages\ti\ control\dpm\docs\doxygen\html\index.html. The component's unit test code, running on top of
SYSBIOS is also provided as part of the package: mmwave_sdk_<ver>\packages\ti\ control\dpm\test\ .
5. 4. 10. mmWaveLib
mmWaveLib is a collection of algorithms that provide basic functionality needed for FMCW radar-cube processing. This component is available only
for those mmWave devices that have DSP/C674 cores, It contains optimized library routines for C674 DSP architecture only. This component is not
available for cortex R4F (MSS). These routines do not encapsulate any data movement/data placement functionality and it is the responsibility of the
application code to place the input and output buffers in the right memory (ex: L2) and use EDMA as needed for the data movement. The source code
for mmWaveLib is present in the mmwave_sdk_<ver>\packages\ti\alg\mmwavelib folder. Documentation of the API is available via doxygen placed at
mmwave_sdk_<ver>\packages\ti\alg\mmwavelib\docs\doxygen\html\index.html and can be easily browsed via mmwave_sdk_<ver>/docs
/mmwave_sdk_module_documentation.html. The component's unit test code, running on top of SYSBIOS is also provided as part of the package: mm
wave_sdk_<ver>\packages\ti\alg\mmwavelib\test\ .
Collection of algorithms that provide basic functionality needed for FMCW radar-cube processing.
Windowing (16-bit complex input, 16 bit complex output, 16-bit windowing real array)
Windowing (16-bit complex input, 32 bit complex output, 32-bit windowing real array)
log2 of absolute value of 32-bit complex numbers
vector arithmetic (accumulation)
CFAR-CA, CFAR-CASO, CFAR-CAGO (logarithmic input samples)
16-point FFT of input vectors of length 8 (other FFT routines are provided as part of DSPLib)
single DFT value for the input sequences at one specific index
Twiddle table generation for 32x32 and 16x16 FFTs: optimized equivalent functions of dsplib for generating twiddle factor
FFT Window coefficients generation
DFT sine/cosine table generation for DFT single bin calculation
Single bin DFT with windowing.
Variation of the windowing functions with I/Q swap since most of the fixed point FFT functions in DSPLib only support one format of
complex types.
CFAR algorithms
Floating-point CFAR-CA:
mmwavelib_cfarfloat_caall supports CFAR cell average, cell accumulation, SO, GO algorithms, with input signals in floating
point formats;
mmwavelib_cfarfloat_caall_opt implements the same functionality as mmwavelib_cfarfloat_caall except with less cycles,
but the detected objects will not be in the ascending order.
64
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
mmwavelib_cfarfloat_wrap implements the same functionality as mmwavelib_cfarfloat_caall except the noise samples for
the samples at the edges are the circular rounds samples at the other edge.
mmwavelib_cfarfloat_wrap_opt implements the same functionality as mmwavelib_cfarfloat_wrap except with less cycles,
but the detected objects will not be in the ascending order.
CFAR-OS: Ordered-Statistic CFAR algorithm
mmwavelib_cfarOS accepts fixed-point input data (16-bit log-magnitude accumulated over antennae). Search window size
is defined at compile time.
Peak pruning for CFAR post-processing
mmwavelib_cfarPeakPruning: Accepts detection matrix and groups neighboring peaks into one.
mmwavelib_cfarPeakQualifiedInOrderPruning: Accepts the list of CFAR detected objects and groups neighboring peaks
into one.
mmwavelib_cfarPeakQualifiedPruning: Same as mmwavelib_cfarPeakQualifiedInOrderPruning, but with no assumption for
the order of cfar detected peaks
Floating-point AOA estimation:
mmwavelib_aoaEstBFSinglePeak implements Bartlett beamformer algorithm for AOA estimation with single object detected, it also
outputs the variance of the detected angle.
mmwavelib_aoaEstBFSinglePeakDet implements the save functionality as mmwavelib_aoaEstBFSinglePeak without the variance of
detected angle calculation.
mmwavelib_aoaEstBFMultiPeak also implements the Bartlett beamformer algorithm but with multiple detected angles, it also
outputs the variances for every detected angles.
mmwavelib_aoaEstBFMultiPeakDet implements the same functionality as mmwavelib_aoaEstBFMultiPeak but with no variances
output for every detected angles.
DBscan Clustering:
mmwavelib_dbscan implements density-based spatial clustering of applications with noise (DBSCAN) data clustering algorithm.
mmwavelib_dbscan_skipFoundNeiB also implements the DBSCAN clustering algorithm but when expanding the cluster, it skips the
already found neighbors.
Clutter Removal:
mmwavelib_vecsum: Sum the elements in 16-bit complex vector.
mmwavelib_vecsubc: Subtract const value from each element in 16-bit complex vector.
Windowing:
mmwavelib_windowing16xl6_evenlen: Supports multiple-of-2 length(number of input complex elements), and
mmwavelib_windowing16x16 supports multiple-of-8 length.
mmwavelib_windowing16x32: This is updated to support multiple-of-4 length(number of input complex elements). It was multiple-of-
8 previously.
Floating-point windowing:
mmwavelib_windowing1DFltp: support fixed-point signal in, and floating point signal out windowing, prepare the floating point data
for 1D FFT.
mmwavelib_chirpProcWin2DFxdpinFltOut, mmwavelib_dopplerProcWin2DFxdpinFltOut: prepare the floating point data for 2D FFT,
with fixed point input. The difference is mmwavelib_chirpProcWin2DFxdpinFltOut is done per chip bin, while
mmwavelib_dopplerProcWin2DFxdpinFltOut is done per Doppler bin.
mmwavelib_windowing2DFltp: floating point signal in, floating point signal out windowing to prepare the floating point data for 2D
FFT.
Vector arithmetic
Floating-point and fixed point power accumulation: accumulates signal power. Alternate API to right shift the output vector along with
accumulation is also provided.
Histogram: mmwavelib_histogram right-shifts unsigned 16-bit vector and calculates histogram.
Right shift operation on signed 16-bit vector or signed 32-bit vector
mmwavelib_shiftright16 shifts each signed 16-bit element in the input vector right by k bits.
mmwavelib_shiftright32 shifts each signed 32-bit element in the input vector right by k bits.
mmwavelib_shiftright32to16 right shifts 32-bit vector to 16-bit vector
Complex vector element-wise multiplication.
mmwavelib_vecmul16x16: multiplies two 16-bit complex vectors element by element. 16-bit complex output written in place
to first input vector.
mmwavelib_vecmul16x32, mmwave_vecmul16x32_anylen : multiplies a 16-bit complex vector and a 32-bit complex vector
element by element, and outputs to the 32-bit complex output vector.
mmwave_vecmul32x16c: multiplies 32bit complex vector with 16bit complex constant.
Sum of absolute value of 16-bit vector elements
mmwavelib_vecsumabs returns the 32-bit sum.
Max power search on 32-bit complex data
mmwavelib_maxpow outputs the maximum power found and returns the corresponding index of the complex sample
mmwavelib_powerAndMax : Power computation combined with max power search
Peak search for Azimuth estimation on 32-bit float vector
mmwavelib_multiPeakSearch : Multiple peak search in the azimuth FFT output
mmwavelib_secondPeakSearch : Second peak search in the azimuth FFT output
DC (antenna coupling signature) Removal on 32-bit float complex vector
Vector subtraction for 16-bit vectors
Matrix utilities
Matrix transpose for 32-bit matrix: Similar to DSPLib function but optimized for matrix with rows larger than columns
65
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
of the API is available via doxygen placed at mmwave_sdk_<ver>\packages\ti\alg\gtrack \docs\doxygen<2d|3D>\html\index.html and can be easily
browsed via mmwave_sdk_<ver>/docs/mmwave_sdk_module_documentation.html.. The component's unit test code, running on top of SYSBIOS is
also provided as part of the package: mmwave_sdk_<ver>\packages\ti\alg\gtrack\test\ .
5. 4. 17. 1. ESM
ESM_init should be the first function that is called by the application in its main(). Refer to the doxygen for this function at mmwave_sdk_<ver>\packag
es\ti\drivers\esm \docs\doxygen\html\index.html to understand the API specification.
5. 4. 17. 2. SOC
SOC_init should be the next function that should be called after ESM_init. Refer to the doxygen for this function at mmwave_sdk_<ver>\packages\ti\dri
vers\soc \docs\doxygen\html\index.html to understand the API specification. It primarily takes care of following things:
DSP un-halt
This applies for mmWave devices with DSP core. Bootloader loads the DSP application from the flash onto DSP's L2/L3 memory but doesnt un-halt
the C674x core. It is the responsibility of the MSS application to un-halt the DSP. SOC_init for MSS provides this optional functionality under its hood.
It is recommended to always unhalt the DSP when application needs to use the DSP for realizing its functionality. For applications that doesnt need
DSP completely can choose to leave the DSP in its original state i.e. either in halt state when this application is running from the flash and booted by
the bootloader OR in unhalted/while 1 loop state when this application is running from CCS in development mode.
To enable selection of system frequency to use "closed loop APLL", the SOC_init function unhalts the RADARSS and then spins around waiting for
acknowledgement from the RADARSS that the APLL clock close loop calibration is completed successfully.
Note that this function assumes that the crystal frequency is 40MHz.
66
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
MPU or Memory Protection Unit needs to be configured on the Cortex R4F of mmWave device for the following purposes:
Protection of memories and peripheral (I/O) space e.g not allowing execution in I/O space or writes to program (.text) space.
Controlling properties like cacheability, buferability and orderability for correctness and performance (execution time, memory bandwidth).
Note that since there is no cache on R4F, cacheability is not enabled for any region.
Default MPU settings has been implemented in the SOC module as a private function SOC_mpu_config() that is called by public API SOC_init() when
SOC_MPUCfg_CONFIG option is passed by the application. Doxygen of SOC (mmwave_sdk_<ver>\packages\ti\drivers\soc \docs\doxygen\html\index.
html) has SOC_mpu_config() documented with details of choice of memory regions etc. When MPU violation happens, BIOS will automatically trap
and produce a dump of registers that indicate which address access caused violation (e.g DFAR which indicates what data address access caused
violation). Note: The SOC function uses as many MPU regions as possible to cover all the memory space available on the respective device. There
may be some free MPU regions available for certain devcies (ex: xWR14xx) for the application to use and program as per their requirement. See the
function implementation/doxygen for more details on the usage and availability of the MPU regions. If the application needs for the MPU are different
than the default settings, it can pass SOC_MPUCfg_BYPASS_CONFIG to SOC_init function and then it can either pre-configure or post configure the
MPU using exported SOC_MPUxxx() functions. Application is responsible for the correct MPU settings when SOC_MPUCfg_BYPASS_CONFIG mode
is chosen.
A build time option called DOWNLOAD_FROM_CCS has been added which when set to yes prevents program space from being protected
in case of SOC owned default MPU settings. This option should be set to yes when debugging using CCS because CCS, by default,
attempts to put software break-point at main() on program load which requires it to change (temporarily) the instruction at beginning main to
software breakpoint and this will fail if program space is read-only. Hence the benefit of code space protection is not there when using CCS
for download. It is however recommended to set this option to no when building the application for production so that program space is
protected.
MARs ( DSP/C674x)
The cacheability property of the various regions as seen by the DSP (C674x) is controlled by the MAR registers. These registers are programmed as
per driver needs in in the SOC module as a private function SOC_configMARs() that is called by public API SOC_init(). See the doxygen
documentation of this function to get more details. Note that the drivers do not operate on L3 RAM and HS-RAM, hence L3/HS-RAM cacheability is
left to the application/demo code writers to set and do appropriate cache (writeback/invalidate etc) operations from the application as necessary,
depending on the use cases. The L3 MAR is MAR32 -> 2000_0000h - 20FF_FFFFh and HS-RAM MAR is MAR33 -> 2100_0000h - 21FF_FFFFh.
5. 4. 17. 3. Pinmux
Pinmux module is provided under mmwave_sdk_<ver>\packages\ti\drivers\pinmux with API documentation and available device pads located at mmw
ave_sdk_<ver>\packages\ti\drivers\pinmux\docs\doxygen\html\index.html and can be easily browsed via mmwave_sdk_<ver>/docs
/mmwave_sdk_module_documentation.html.. Application should call these pinmux APIs in the main() to correctly configure the device pads as per
their hardware design.
TI Pinmux Utility
TI Pinmux Tool available at https://dev.ti.com/pinmux supports mmWave devices and can be used for designing the pinmux configuration
for custom board. It also generates code that can be included by the application and compiled on top of mmWave SDK and its Pinmux
driver.
5. 4. 18. Usecases
The unit tests located at mmwave_sdk_<ver>\packages\ti\datapath\dpc \objectdetection\<chain_type>\test) are stand-alone tests that allow data path
processing chain to be executed in non real-time. This allows developer to use it as a debug/development aid towards eventually making the data
path processing real-time with real chirping. Developer can easily step into the code and test against knowns input signals. The core data path
processing source code in object detection chain and the processing modules (DPUs) is shared between this test and the mmw demo. Most of the
documentation is therefore shared as well and can be looked up in the object detection DPC and mmw demo documentation.
The tests also provide a test generator, which allows user to set objects artificially at desired range, doppler and azimuth bins, and noise level so that
output can be checked against these settings. It can generate one frame of data. The test generation and verification are integrated into the tests,
allowing developer to run a single executable that contains the input vector and also verifies the output (after the data path processing chain), thereby
declaring pass or fail at the end of the test. The details of test generator can be seen in the doxygen documentation of these tests located at mmwave_
sdk_<ver>\packages\ti\datapath\dpc \objectdetection\<chain_type>\test\docs\doxygen\html\index.html and can be easily browsed via mmwave_sdk_<v
er>/docs/mmwave_sdk_module_documentation.html..
67
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
5. 4. 18. 3. Basic configuration of Front end and capturing ADC data in L3 memory
To access ADC data from mmWave sensors, user need to program various basic components within the device in a given sequence. In order to help
user understand the programming model needed to configure the device and generate ADC data in device's L3 memory, an example usecase is
provided under mmwave_sdk_<ver>\packages\ti\drivers\test\mem_capture. Refer to the doxygen documentation located at mmwave_sdk_<ver>\pack
ages\ti\drivers\test\mem_capture\docs\doxygen\html\index.html for more details.
68
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
6. Appendix
6. 1. Memory usage
The map files of demo and driver unit test application captures the memory usage of various components in the system. They are located in the same
folder as the corresponding .xer4f/.xe674 and .bin files. Additionally, the doxygen for mmW demo summarizes the usage of various memories
available on the device across the demo application and other SDK components. Refer to the section "Memory Usage" in the mmwave_sdk_<ver>\pac
kages\ti\demo\<platform>\mmw\docs\doxygen\html\index.html documentation.
6. 2. Register layout
The register layout of the device is available inside each hardware IP's driver source code. See mmwave_sdk_<ver>\packages\ti\drivers\<ip>\include\r
eg_*.h. The system level registers (RCM, TOPRCM, etc) are available under the SOC module (mmwave_sdk_<ver>\packages\ti\drivers\soc\include\re
g_*.h).
1. Enable the flag DebugP_LOG_ENABLED before the header inclusion as seen below.
#define DebugP_LOG_ENABLED 1
#include <ti/drivers/osal/DebugP.h>
2. Add the following lines in your SYSBIOS cfg file with appropriate setting of numEntries (number of messages) which will impact memory
space:
/* Trace Log */
var loggerBufParams = new LoggerBuf.Params();
loggerBufParams.bufType = LoggerBuf.BufType_CIRCULAR; //BufType_FIXED
loggerBufParams.exitFlush = false;
loggerBufParams.instance.name = "_logInfo";
loggerBufParams.numEntries = 100; <-- number of messages this will affect memory consumption
// loggerBufParams.bufSection = ;
_logInfo = LoggerBuf.create(loggerBufParams);
Main.common$.logger = _logInfo;
A sample ROV log looks like below after code is re-build and run with above changes :
69
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
In SDK code, one can change the environment variable MMWAVE_SDK_SHMEM_ALLOC to customize the shmem alloc settings. If this variable is
undefined, platform specific SDK common makefile (mmwave_sdk_<ver>\packages\ti\common\mmwave_sdk_<platform>.mak) will define the default
values. When this variable is changed, user should do a clean build of the demo or ccsdebug depending on the working mode. This setting will
influence
Since there is a chance for sys_common defines for the memories and metaImage bank allocation to go out of sync (due to user error such as failure
to do clean build), SOC module init does a sanity check of the hardware programmed L3 bank allocations (that are fed via metaImage header) and the
sys_common defines. If the sys_common defined memory size is greater than hardware programmed bank allocations, the module throws an assert.
The Application Image interpreted by the bootloader is a consolidated Multicore image file that includes the RPRC image file of individual subsystems
along with a Meta header. The Meta Header is a Table of Contents like information that contains the offsets to the individual subsystem RPRC images
along with an integrity check information using CRC. In addition, the allocation of the shared memory to the various memories of the subsystems also
has to be specified. The bootloader performs the allocation accordingly. It is recommended that the allocation of shared memory is predetermined and
not changed dynamically.
Use the generateMetaImage script present under mmwave_sdk_<ver>\packages\ scripts\windows or mmwave_sdk_<ver>\packages\ scripts\linux for
merging the MSS .xer4f, DSS .xe674 and RADARSS RPRC binaries into one metaImage and appending correct CRC. The RPRC image for MSS and
DSS are generated internally in this script from the input ELF formatted files for those subsystem (i.e. output of linker command - .xer4f, .xe674). Set
MMWAVE_SDK_INSTALL_PATH=mmwave_sdk_<ver>\packages in your environment before calling this script. This script needs 5 parameters:
70
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
FLASHIMAGE: [output] multicore file that will be generated by this script and should be used for flashing onto the board
SHMEM_ALLOC: [input] shared memory allocation in 32-bit hex format where each byte (left to right) is the number of banks
needed for RADARSS (BSS),TCMB,TCMA and DSS. Refer to the the TRM on details on L3 shared memory layout and "Image Creator User
Guide" in the SDK. It is advisable to pass MMWAVE_SDK_SHMEM_ALLOC environment variable here to keep the compiled code and
metaImage in sync. See Shared memory usage by SDK demos section for more details.
MSS_IMAGE_OUT: [input] MSS input image in ELF (.xer4f) format as generated by the linker. Use keyword NULL if not needed
BSS_IMAGE_BIN: [input] RADARSS (BSS) input image in RPRC (.bin) format, use keyword NULL if not needed. Use mmwave_sdk
_<ver>\firmware\radarss\<platform>_radarss_rprc.bin here. For xWR14xx, select xwr12xx_xwr14xx_radarss_rprc.bin.
DSS_IMAGE_OUT: [input] DSP input image in ELF (,xe674) format as generated by the linker. Use keyword NULL if not needed
The FLASHIMAGE file generated by this script should be used for the METAIMAGE1 during flashing step (How to flash an image onto mmWave EVM)
. Refer to "Image Creator User Guide" in the SDK docs directory for details on the internal layout and format of the files generated in these steps.
/* Some options to reduce BIOS code and data size, see BIOS User Guide section
"Minimizing the Application Footprint" */
System.maxAtexitHandlers = 0; /* COMMENT THIS FOR FIXING DebugP_Assert PRINTS */
BIOS.swiEnabled = false; /* We don't use SWIs */
BIOS.libType = BIOS.LibType_Custom;
Task.defaultStackSize = 1500;
Task.idleTaskStackSize = 800;
Program.stack = 1048; /* for isr context */
var Text = xdc.useModule('xdc.runtime.Text');
Text.isLoaded = false;
void MmwDemo_sleep(void)
{
/* issue WFI (Wait For Interrupt) instruction */
asm(" WFI ");
}
void MmwDemo_sleep(void)
{
/* issue IDLE instruction */
asm(" IDLE ");
}
Set the target as explained in the demo documentation and update the mmwave_sdk_<ver>\packages\ti\demo\<platform>\mmw\profiles\profil
e_calibration.cfg appropriately.
Set up Visualizer and mmW demo as mentioned in the section Running the Demos.
Use the "Load Config From PC and Send" button on plots tab to send the mmwave_sdk_<ver>\packages\ti\demo\<platform>\mmw\profiles\pr
ofile_calibration.cfg.
71
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
The Console messages window on the Configure tab will dump the "compRangeBiasAndRxChanPhase" command to be used for
subsequent runs where compensation is desired.
Copy and save the string for that particular mmWave sensor to your PC. You can use it in the "Advanced config" tab in the Visualizer and
tune any running profile in real time. Alternatively, you can add this to your custom profile configs and use it via the "Load Config From PC
and Send" button.
1. On R4F, compile your application with ARM thumb option (depending on the compiler use). If using the TI ARM compiler, the option to do
thumb is code_state=16 . Another relevant compiler option (when using TI compiler) to play with to trade-off code size versus speed is --
opt_for_speed=0-5 . For more information, refer to ARM Compiler Optimizations and ARM Optimizing Compiler User's Guide. The pre-
built drivers in the SDK are already built with the thumb option. The demo code and BIOS libraries are also built with thumb option. Note the
code_state=16 flag and the ti.targets.arm.elf.R4Ft target in the mmwave_sdk_<ver>\packages\ti\ common\mmwave_sdk.mak.
2. On C674X, compile portions of code that are not in compute critical path with appropriate -mfX option. The -mf3 options is presently used in
the SDK drivers, demos and BIOS cfg file. This option does cause compiler to favor code size over performance and hence some cycles
impact are to be expected. However, on mmWave device, using mf3 option only caused about 1% change in the CPU load during active and
interframe time and around 3-5% increase in config cycles when benchmarked using driver unit tests. For more details on the "mf" options,
refer to The TI C6000 compiler user guide at C6000 Optimizing Compiler Users Guide. Another option to consider is -mo (this is used in
SDK) and for more information, see section "Generating Function Subsections (--gen_func_subsections Compiler Option)" in the compiler
user guide. A link of references for optimization (both compute and memory) is at Optimization Techniques for the TI C6000 Compiler.
3. Even with aggressive code size reduction options, the C674X tends to have a bigger footprint of control code than the same C code compiled
on R4F. So if feasible, partition the software to use C674X mainly for compute intensive signal-processing type code and keep more of the
control code on the R4F. An example of this is in the mmw demo, where we show the usage of mmwave API to do configuration (of
RADARSS) from R4F instead of the C674X (even though the API allows usage from either domain). In mmw demo, this prevents linking of mm
wave (in mmwave_sdk_<ver>\packages\ ti\control ) and mmwavelink (in mmwave_sdk_<ver>\packages\ti\control ) code that is involved in
configuration (profile config, chirp config etc) on the C674X side as seen from the .map files of mss and dss located along with application
binary.
4. If using TI BIOS as the operating system, depending on the application needs for debug, safety etc, the BIOS footprint in the application may
be reduced by using some of the techniques listed in the BIOS User Guide in the section "Minimizing the Application Footprint". Some of
these are illustrated in the mmw demo on R4F and C674X. Some common ones are disabling system_printf (printf strings do contribute to
significant code size), choosing sysmin and using ROV for debugging, disabling assert (although this should be done only when variability in
driver configuration is not expected and existing configuration has been proven to function correctly). The savings from these features could
be anywhere from 2KB to 10KB but user would lose some perks of debuggability.
5. If there is no requirement to be able to restart an application without reloading, then following suggestions may be used:
a. one time/first time only program code can be overlaid with data memory buffers used after such code is executed. Note: Ability to
place code at function granularity requires to use the aforementioned -mo option.
b. the linker option --ram_model may be used to eliminate the .cinit section overhead. For more details, see compiler user guide
referenced previously. Presently, ram model cannot be used on R4F due to bootloader limitation but can be used on C674X. The
SDK uses ram model when building C674X executable images (unit tests and demos).
6. On C674X, smaller L1D/L1P cache sizes may be used to increase static RAM. The L1P and L1D can be used as part SRAM and part cache.
Smaller L1 caches can increase compute time due to more cache misses but if appropriate data/code is allocated in the SRAMs, then the
loss in compute can be compensated (or in some cases can also result in improvement in performance). In the demos, the caches are sized
to be 16 KB, allowing 16 KB of L1D and 16 KB of L1P to be used as SRAM. Typically, the L1D SRAM can be used to allocate some buffers
involved in data path processing whereas the L1P SRAM can be used for code that is frequently and more fully accessed during data path
processing. Thus we get overall 32 KB more memory. The caches can be reduced all the way down to 0 to give the full 32 KB as SRAM: how
much cache or RAM is a decision each application developer can make depending on the memory and compute (MIPS) needs.
7. When modeling the application code using mmW demo as reference code, it might be useful to trim the heaps in mmW demo to claim back
the unused portion of the heaps and use it for code/data memory. Ideally, a user can run their worst case profile that they would like to
support using mmW demo, record the heap usage/free metrics for (L1D, L2)/TCMB and L3 heaps on 'sensorStart'. These values can then be
used to resize or re-allocate heap globals (example: gDPC_ObjDetTCM, gMmwL3, etc) in mmwave_sdk_<ver>\packages\ti\demo\<platform>\
mmw. The freed up space in DSS could be used as follows:
a. Free heap space in L1D could be used to move some of the L2 buffers to L1D. The freed L2 space can be used for code/data.
b. Free heap space in L2 could be trimmed by changing the heap's global variable (ex: gMmwL2) definition and used for code/data
memory (note that code memory by default is L2 so no other change is required to get more code space).
c. Free heap space in L3 could be trimmed by changing the heap's global variable (ex: gMmwL3) definition and used for code/data
space.
When using TI compilers for both R4F and C674x, the map files contain a nice module summary of all the object files included in the application.
Users can use this as a guide towards identifying components/source code that could be optimized. See one sample snapshot below:
MODULE SUMMARY
obj_xwr14xx/
72
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
6. 10. How to add a .const (table) beyond L3 heap in mmWave application where overlay is enabled
To achieve L3 heap overlaid with the code to be copied into L1P at init time, L3 heap is in PAGE 1 and code is in Page 0. PAGE 0 is the only loadable
page whereas PAGE 1 is just a dummy page to allocate uninitialized sections to implement overlay. As a result the ".const" section (which is loadable
section) cannot simply be allocated to PAGE 1 to go after the heap. If the .const is allocated in PAGE 0, then it will overlap the heap and will be
overwritten once heap is allocated. To resolve this, the HIGH feature of the linker could be used is used to push the const table to the highest address
ensuring no overlap with L3 heap. The suggested changes would be as follows:
1. Shrink the L3 heap by the size of the table (but L3 heap must still be bigger than the size of the L1P cache).
2. Place the table in a named section and allocate the named section in the HIGH space of PAGE 0 of L3RAM.
This ensures that the table will be allocated at the high address and will not be overlapping with L3 heap or the L1P intended code which are located
at the low address.
In application C file:
#define TABLE_LENGTH 4
#define TABLE_ALIGNMENT 8 /* bytes */
Cache writeback: To maintain cache coherency between different masters (CPU, DMA, R4F, etc), content in cache needs to be written back
to memory after it is changed before triggering the other master to access that memory location.
Cache Invalidate: Before reading the content from the physical memory that was updated by another master, the content in cache needs to
be invalidated, so that updated data from memory can be loaded in cache.
APIs: User can use DSPICFGRegs directly from mmwave_sdk_<ver>/packages/ti/drivers/soc/include/reg_dspicfg.h or the TI BIOS cache
module APIs to perform these MAR settings, cache invalidates and cache writebacks.
Code in L3: mmWave code can be placed from L2 to L3 (via linker command file) with no explicit need for cache enablement and/or cache
operations during real time. The only setting that needs to be adjusted is the size of L1P cache and that should be balanced against the need
for L1P SRAM to place real time optimized functions (and avoid any cache misses, etc).
Data in L3: If data cache is enabled for L3 memory via the MAR registers, then at first, one needs to take care of cache invalidates and
writebacks for existing data structures in L3 memory. Radarcube and detection matrix are the primary data structures placed in L3 memory in
case of a typical mmwave application on our device. Typically Radarcube is accessed (read/write) only via EDMA during the Range and
Doppler FFT. Post that, it is more common for the DSP core to access the radarcube directly (i.e. no EDMA) and primarily it is a read access.
In such scenario, the Radarcube can be invalidated at the end of current frame but before the start of next frame (i.e. when EDMA master
begins to access radarcube). If the Radarcube was modified by the core directly (write operation) during the interframe time, then cache
writeback_invalidate is needed at the end of current frame but before the start of next frame. Same consideration would apply for detection
matrix. Next, mmWave internal data structures that are accessed purely by DSP can also be moved from L2 to L3 (via linker command file).
No explicit cache writeback/invalidations are required for such structures. If user chooses to place the frame results structures in L3 (point
cloud, etc) which are shared with MSS (R4F), then cache writeback+invalidate needs to be performed before signaling the MSS about
73
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
availability of frame results. Note: If the analysis of L3 data access pattern between the DSP, MSS and EDMA shows that cache writeback
/invalidate of all L3 data content can be done towards the end of the current frame, then performing writeback+invalidate on entire L1D cache
might be a better option than calling such API on individual structures.
6. 12. DSPlib integration in mmWave C674x based application (Using 2 libraries simultaneously)
The TI C674X DSP is a merger of C64x+ (fixed point) and C67x+ (floating point) DSP architectures and DSPlib offers two different flavors of library for
each of these DSP architectures. An application on C674X may need functions from both architectures. Normally this would be a straight-forward
exercise like integrating other TI components/libraries. However there is a problem during integration of the two DSPLib libraries in the same
application since the top level library API header dsplib.h has the same name and same relative path from the packages/ directory as seen below
in the installation:
C:\ti\dsplib_c64Px_3_4_0_0\packages\ti\dsplib\dsplib.h
C:\ti\dsplib_c674x_3_4_0_0\packages\ti\dsplib\dsplib.h
Typically when integrating TI components, the build paths are specified up to packages\ directory and headers are referred as below:
#include <ti/dsplib/dsplib.h>
However this will create an ambiguity when both libraries are to be integrated because the above path is same for both. There are a couple of ways to
resolve this:
In application's makefile:
dss_mmw.mak
In application C file:
dss_data_path.c
#include "DSP_fft32x32.h"
#include "DSP_fft16x16.h"
The C674P library can be integrated in the above code similar to the how the C64P has been done, this will not create any conflict.
A variant of the above could be as follows where the paths are now in the .c and .mak only refers to the installation:
dss_mmw.mak
dss_data_path.c
#include <ti/dsplib/src/DSP_fft16x16/c64P/DSP_fft32x32.h>
#include <ti/dsplib/src/DSP_fft16x16/c64P/DSP_fft16x16.h>
74
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
C:\ti\dsplib_c64Px_3_4_0_0\packages\ti\dsplib\dsplib_c64P.h [one can retain the older dsplib.h if one wants to]
C:\ti\dsplib_c674x_3_4_0_0\packages\ti\dsplib\dsplib_c674x.h [one can retain the older dsplib.h if one wants to]
In application makefile:
dss_mmw.mak
In application C file:
dss_data_path.c
#include <ti/dsplib/dsplib_c64P.h>
#include <ti/dsplib/dsplib_c674x.h>
The present dsplibs do not have name conflicts among their functions so they can both be integrated in the above manner.
In demos that use HWA as the only processing node and elevation is enabled during run-time via configuration file, the number of detected
objects are limited by the amount of HWA memory that is available for post processing.
Demo's rov.xs file is provided in the SDK package to facilitate the CCS debugging of pre-built binaries when demo is directly flashed onto the
device (instead of loading via CCS).
When using non-interleaved mode for ADCBuf, the ADCBuf offsets for every RX antenna/channel enabled need to be multiple of 16 bytes.
Output packet of mmW demo data over UART is in TLV format and its length is a multiple of 32 bytes. This enables post processing
elements on the remote side (PC, etc) to process TLV format with header efficiently.
6. 14. Data size restriction for a given session when sending data over LVDS
For the current implementation of the CBUFF/LVDS driver and its intended usage, the CBUFF data size for a given session needs to be multiple of 8.
User should take care of this restriction when writing their custom application using the SDK LVDS driver. This alignment is taken care by the HSI
header library if the application uses the headers for LVDS streaming. If no header are used while streaming data over LVDS lanes, user should
calculate the total data size in bytes for the hardware triggered session (i.e. per chirp) and make sure it follows the rules mentioned above. Similar
rules apply for the user data sent during the software triggered session.
75
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
state and the interrupt could read out some state and store in global variables that could be examined later. If code is halted using a break-point in the
interrupt, the EDMA will automatically halt but HWA will not unless HWA is waiting on EDMA, so HWA could continue to run even if the CPU is halted.
The current radar SoCs do not have the feature to halt the HWA when any of the CPUs are halted.
In case of DSP doing the inter-chirp processing, there can be a need to single-step/break the processing. However, (unlike the MSS CPU) when DSP
is halted, the RadarSS (front end) doesnt halt and the chirping activity does not stop. Because of this, the DSP will miss the chirp processing deadline
and the code is typically written to throw an exception. So basically halted debug is not useful unless a single chirp is configured and problem can be
recreated with a single chirp. There might be other limitations in the demo code that may prevent a single chirp configuration (e.g in the AWR1642
demo, minimum number of doppler bins is required to be 16 due to DSPLIB FFT function restrictions and there is an error check for this during config
validation - but this check may be disabled temporarily as it wouldn't affect the inter-chirp processing). Other techniques shown in below sections (real-
time logging, using non real-time unit test bench) may be more practical but have their own limitations. In most implementations however, 1D
processing uses a hardened component from the SDK - the range DPU - so the need for real-time debugging in the active chirping period is low.
The out of box demos based on the DPC/DPU/DPM architecture have by default the DebugP type real-time logging enabled. In order to visualize the
logs, the CCS feature of Run Time Object Viewer (ROV) can be used. Instructions of how to use this feature can be seen at http://processors.wiki.ti.
com/index.php/Runtime_Object_View_(ROV). Below is a sample log for the xwr68xx out of box demo.
76
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
During debug, there may be a need to examine registers of HWA, EDMA, external I/O peripherals etc. These can be done using View->Registers
menu and when a core is selected, the register view will display all registers that the core can see organized into various categories. An example is
shown below:
Individual hardware entities can be expanded further in the view to see registers specific to the hardware entity. The following picture illustrates
viewing a certain PARAM set in instance #0 of the EDMA (TPCC0), note how the bit fields are automatically parsed and displayed in a user friendly
manner which saves the burden of manually parsing or developing special parsing tools and facilitates quick debugging. Default number formats of bit
fields are binary which is not always convenient, this can be changed by selecting the field/fields and right-clicking to see the number format menu as
shown in the example below where the A and B counts of EDMA are about to be chosen for Decimal format. Once chosen, the GUI will remember the
user choice for that specific field so user does not have to repeat this action in future debug sessions.
77
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
In the above picture, one can also see the "Watch" menu item. If this is selected, then the two fields of interest will appear in the Expressions view, this
is a convenient way to see some fields of interest during debug without having to navigate the register structure again (although when a particular
structure such as PARAM set #16 above is expanded, if the top level TPCC0 is shrunk and expanded again, thePARAM #16 is shown expanded as
before because GUI remembers sub-structure expansion/non-expansion state).
Continuous refresh:
78
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
79
Copyright (C) 2020, Texas Instruments Incorporated MMWAVE SDK User Guide
http://www.ti.com
If a variable of enum type is used to exchange information between ARM and DSP core, then it is necessary to make sure the enum size matches for
the same variable compiled on the two cores. TI ARM compiler's default type for enum is packed, which causes the underlying enumeration type to be
the smallest integer type that accommodates the enumeration constants. By default, the TI C6000 (DSP) compiler uses a 32-bit integer to store enum
objects with enumeration values smaller than 32 bits. This could cause an enum define that takes values 1 to 4 (for example) to be of size 1 byte on
R4F and of size 4 bytes on C66x. For devices where DSP and ARM coexist such as xwr16xx, they must be set to ensure that enum types are
consistent between ARM and DSP. For devices where DSP is not present (xwr14xx), it is not necessary to force enum types to be 32bit integers and if
forced, it may increase program memory usage. In mmWave SDK command makefile, flags R4F_XSFLAGS_ENUM_TYPE and
R4F_CFLAGS_ENUM_TYPE are used in conjunction to enforce that enum types are compiled as 32bit integers. It is necessary that all libraries and
the application code for a given core are compiled with the same compiler option for enum type else there will be a linker warning and one will
encounter errors that cannot be detected until run time.
warning #16027-D: object files have incompatible enumeration types ("xxxx" = packed, "yyyy" = 32-bit)
(xxxx and yyyy will be the names of actual object files that do not have matching enum type)
Please note that the R4F custom application using mmwave SDK pre-built libraries should be compiled with "--enum_type=int" option
specified to the compiler.
80