Mmwave SDK User Guide
Mmwave SDK User Guide
http://www.ti.com
MMWAVE SDK User Guide
1
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
COPYRIGHT
Copyright (C) 2014 - 2018 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.
2
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
CONTENTS
3
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
LIST OF FIGURES
LIST OF TABLES
4
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
5
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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!
1. 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) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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
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.
xWR14xx This is used throughout the document where that section/component/module applies to both AWR14xx and IWR14xx
xWR16xx This is used throughout the document where that section/component/module applies to both AWR16xx and IWR16xx
xWR1xxx This is used throughout the document where that section/component/module applies to all the part: AWR14xx, IWR14xx,
AWR16xx and IWR16xx
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
AWR1443
AWR1642
IWR1443
IWR1642
EVM links (These pages have links for datasheet and TI EVM user guides that this document refers to)
7
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
AWR1443BOOST
AWR1642BOOST
IWR1443BOOST
IWR1642BOOST
MMWAVE-DEVPACK
8
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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 xWR14xx/xWR16xx 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: mmwave_sdk_<ver>\packages\ti\demo\<platform>\mmw\docs\doxygen\html\index.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. DS3 LED on TI EVM is turned on when the sensor is started successfully and turned
off when the sensor is stopped successfully. SW1 switch press on TI EVM will start/stop the demo (sensor needs to be configured atleast
once using the CLI). The version of the mmWave Demo running on TI mmWave EVM can be obtained from the Visualier app using the
HelpAbout menu.
Following sections describe the general procedure for booting up the device with the demos and then executing it.
3. 1. Programming xWR14xx/xWR16xx
Here is a little insight into the mmWave devices and the programmable cores they offer. For more detailed information, please refer to the
Technical reference manual for the respective mmWave device. These details are needed when loading the binaries using CCS and/or to
understand the various terminologies that exist in the "Getting started" section.
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
xWR16xx has 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 execuables 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 only exception to this is the Mailbox unit test named "test_mss_dss_msg_exchange" and mmWave unit tests under full and
minimal.
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 xWR14xx/xWR16xx EVM). Use the mmwave_sdk_<ver>
/packages/ti/demo/<platform>/<demo> /<platform>_<demo>.bin as the METAIMAGE1 file name.
2. Remove the "SOP2" jumper 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.
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
9
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
boot-up sequence
When the xWR1xxx 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 xWR1xxx development phase, 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
(xWR16xx only) directly via CCS in the xWR14xx/xWR16xx functional mode.
Refer to Help inside Code Composer Studio (CCS) to learn more about connecting, loading, running the cores, in general.
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.
10
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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.
1. At this point, this app will automatically try to connect to the target (mmWave Sensor). If it 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.
2. After the App is connected to the target, you can select the configuration parameters in this App (Frequency Band, Platform,
etc) in the "Scene Selection" and "Object Detection" area of the CONFIGURE tab.
3. 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.
4. Once the configuration is selected, you can send the configuration to the device (use "SEND CONFIG TO MMWAVE
DEVICE" button).
5. 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.
6. 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
1. If Platform is changed: make sure the COM ports match the TI EVM/platform you are trying to configure and
visualizer
2. If SDK version is changed: make sure the mmW demo running on the connected TI EVM matches the selected
SDK version in the GUI
3. 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.
11
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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).
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 ont 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.
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) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
13
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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\mmwavelink\docs\doxygen\html\index.html.) Additionally, users can refer to the chirp diagram below to understand the chirp and
profile related parameters.
Configuration command Command details Command Parameters Usage in mmW demo Usage in mmW demo
xwr14xx xwr16xx
adcCfg
14
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
ADC config message to RadarSS. See <numADCBits> only 16-bit is supported only 16-bit is supported
mmwavelink doxgen for details. Number of ADC bits (0 for
12-bits, 1 for 14-bits and 2
The values in this command should not change for 16-bits)
between sensorStop and sensorStart.
<adcOutputFmt> only complex modes are supported only complex modes are supported
Reboot the board to try config with different set of Output format :
values in this command 0 - real
1 - complex 1x (image band
This is a mandatory command. filtered output)
2 - complex 2x (image band
visible))
0-8 for xWR16xx (conditions n (i.e. any values in the range 1-8):
apply, see description in "Us Set to n unless..
age in mmW demo 1. n exceeds what is determined
xwr16xx" column) to be possible maximum based on
0 interpretation above.
only 1 for xWR14xx
In such case, the demo app will cap
the value to the max with a
diagnostic warning message that
threshold has been capped to max.
2. n does not meet divisibility
requirement stated above and in
this case, demo app will throw an
assert.
78.1
<idleTime> any value as per mmwavelink any value as per mmwavelink
"Idle Time" in u-sec (float doxgen/device datasheet but doxgen/device datasheet but
values allowed) represented in usec represented in usec
Examples:
7.15
15
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
Examples:
7.34
<rampEndTime> any value as per mmwavelink any value as per mmwavelink
"Ramp End Time" in u-sec doxgen/device datasheet but doxgen/device datasheet but
(float values allowed) represented in usec represented in usec
Examples:
58
216.15
<txOutPower> only value of '0' has been tested only value of '0' has been tested
Tx output power back-off
code for tx antennas
<txPhaseShifter> only value of '0' has been tested only value of '0' has been tested
tx phase shifter for tx
antennas
<freqSlopeConst> any value greater than 0 as per any value greater than 0 as per
"Frequency slope" for the mmwavelink doxgen/device mmwavelink doxgen/device
chirp in MHz/usec (float datasheet but represented in MHz datasheet but represented in MHz
values allowed) /usec /usec
Examples:
68
16.83
<txStartTime> any value as per mmwavelink any value as per mmwavelink
"TX Start Time" in u-sec doxgen/device datasheet but doxgen/device datasheet but
(float values allowed) represented in usec represented in usec
Examples:
1
2.92
<numAdcSamples> any value as per mmwavelink any value as per mmwavelink
number of ADC samples doxgen/device datasheet doxgen/device datasheet but with
collected during "ADC multiplicity of 4 required due to
Sampling Time" as shown in windowing library function
the chirp diagram above requirement and ADCBuf channel
offset requirement (since samples
Examples: are complex)
256
224
<digOutSampleRate> any value as per mmwavelink any value as per mmwavelink
ADC sampling frequency in doxgen/device datasheet doxgen/device datasheet
ksps.
(<numAdcSamples> /
<digOutSampleRate> =
"ADC Sampling Time")
Examples:
5500
<hpfCornerFreq1> any value as per mmwavelink any value as per mmwavelink
HPF1 (High Pass Filter 1) doxgen/device datasheet doxgen/device datasheet
corner frequency
0: 175 KHz
1: 235 KHz
2: 350 KHz
3: 700 KHz
<hpfCornerFreq2> any value as per mmwavelink any value as per mmwavelink
HPF2 (High Pass Filter 2) doxgen/device datasheet doxgen/device datasheet
corner frequency
0: 350 KHz
1: 700 KHz
2: 1.4 MHz
3: 2.8 MHz
<rxGain> any value as per mmwavelink any value as per mmwavelink
OR'ed value of RX gain in doxgen/device datasheet doxgen/device datasheet
dB and RF gain target (See
mmwavelink doxgen for
details)
16
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
frequency slope variation in only value of '0' has been tested only value of '0' has been tested
kHz/us (float values allowed)
idle time variation in u-sec only value of '0' has been tested only value of '0' has been tested
(float values allowed)
ADC start time variation in u- only value of '0' has been tested only value of '0' has been tested
sec (float values allowed)
tx antenna enable mask See note under "Channel Cfg" See note under "Channel Cfg"
(Tx2,Tx1) e.g (10)b = Tx2 command above. command above.
enabled, Tx1 disabled. Individual chirps should have either Individual chirps should have
only one distinct Tx antenna enabled either only one distinct Tx antenna
(MIMO) or same TX antennas enabled (MIMO) or same TX
should be enabled for all chirps antennas should be enabled for all
chirps
Every frame consists of alternating chirps with <subFrameIdx> n/a For legacy mode, that field should
pattern TX1_Tx2 and TX1-TX2. This is alternate subframe Index (exists only be set to -1 whereas for advanced
configuration to TDM-MIMO scheme and in xwr16xx mmW demo) frame mode, it should be set to
provides SNR improvement by running 2Tx either the intended subframe
simultaneously.When using this scheme, user number or -1 to apply same config
should enable both the azimuth TX in the to all subframes.
chirpCfg. See profile_2d_bpm.cfg profile in the
<enabled> n/a all values supported
xwr16xx mmW demo profiles directory for
example usage.
0-Disabled
1-Enabled
This config is supported only for xWR16xx <chirp0Idx> n/a value should have a corresponding
valid chirpCfg
BPM enabled:
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 (TX0+ , TX1+).
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 [chirp
0Idx..chirp1Idx]
<chirp1Idx> value should have a corresponding
valid chirpCfg
BPM enabled:
If BPM is enabled, this is
the chirp index for the
second BPM chirp.
It will have phase 0 on TX0
and phase 180 on TX1
(TX0+ , TX1-). 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 [chirp
0Idx..chirp1Idx].
17
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
number of loops (1 to 255) any value as per mmwavelink any value as per mmwavelink
doxgen/device datasheet but should doxgen/device datasheet but
be a power of 2 should be a power of 2 and should
have a minimum value of 16 due to
DSP Library requirements
number of frames (valid any value as per mmwavelink any value as per mmwavelink
range is 0 to 65535, 0 doxgen doxgen
means infinite)
frame periodicity in ms (float any value as per mmwavelink any value as per mmwavelink
values allowed) doxgen and represented in msec. doxgen and represented in msec.
However frame duration should not However frame should not have
have more than 50% duty cycle (i.e. more than 50% duty cycle (i.e.
active chirp time should be <= 50% active chirp time should be <= 50%
of frame period) and should allow of frame period) and should allow
enough time for selected UART enough time for selected UART
output to be shipped out (selections output to be shipped out (selections
based on guiMonitor command) based on guiMonitor command)
trigger select only option for Software trigger is only option for Software trigger is
1: Software trigger selected selected
2: Hardware trigger.
Frame trigger delay in ms any value as per mmwavelink any value as per mmwavelink
(float values allowed) doxgen and represented in msec. doxgen and represented in msec.
18
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
The values in this command can be changed <subFrameIdx> doesn’t exist For legacy mode, that field should
between sensorStop and sensorStart and even subframe Index (exists only be set to -1 whereas for advanced
when the sensor is running. in xwr16xx mmW demo) frame mode, it should be set to
either the intended subframe
This is a mandatory command. number or -1 to apply same config
to all subframes.
<procDirection> only Range direction is supported all values supported; 2 separate
Processing direction: commands need to be sent; one for
0 – CFAR detection in Range and other for doppler
range direction
1 – CFAR detection in
Doppler direction
<mode> all values supported all values supported
CFAR averaging mode:
0 - CFAR_CA (Cell
Averaging)
1 - CFAR_CAGO (Cell
Averaging Greatest Of)
2 - CFAR_CASO (Cell
Averaging Smallest Of)
<noiseWin> supported supported
noise averaging window
length:
Length of the noise
averaged cells in samples
<guardLen> supported supported
guard length in samples
19
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
With peak grouping scheme enabled, instead of <subFrameIdx> doesn’t exist For legacy mode, that field should
reporting a cluster of detected neighboring points, subframe Index (exists only be set to -1 whereas for advanced
only one point, the highest one, will be reported, in xwr16xx mmW demo) frame mode, it should be set to
this reducing the total number of detected points either the intended subframe
per frame. Only the points between start and end number or -1 to apply same config
range index are considered. Detected points to all subframes.
falling outside this range are dropped and not
<scheme> only option 1 is supported both options are supported
shipped out as part of point cloud.
1–
MMW_PEAK_GROUPING_
The values in this command can be changed
DET_MATRIX_BASED
between sensorStop and sensorStart and even
Peak grouping is based on
when the sensor is running.
peaks of the neighboring
bins read from detection
This is a mandatory command.
matrix. CFAR detected peak
is reported if it is greater
than its neighbors, located in
detection matrix.
2–
MMW_PEAK_GROUPING_
CFAR_PEAK_BASED
Peak grouping is based on
peaks of neighboring bins
that are CFAR detected.
CFAR detected peak is
reported if it is greater than
its neighbors, located in the
list of CFAR detected peaks.
20
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
Antenna coupling signature dominates the range <subFrameIdx> doesn’t exist For legacy mode, that field should
bins close to the radar. These are the bins in the subframe Index (exists only be set to -1 whereas for advanced
range FFT output located around DC. in xwr16xx mmW demo) frame mode, it should be set to
either the intended subframe
When this feature is enabled, the signature is number or -1 to apply same config
estimated during the first N chirps, and then it is to all subframes.
subtracted during the subsequent chirps.
<enabled> supported supported
Enable DC removal using
During the estimation period the specified
first few chirps
bins (defined as [negativeBinIdx, positiveBinIdx])
0 - disabled
around DC are accumulated and averaged. It is
1 - enabled
assumed that no objects are present in the
vicinity of the radar at that time. <negativeBinIdx> supported supported
negative Bin Index (to
This procedure is initiated by the following CLI remove DC from farthest
command, and it can be initiated any time while range bins)
radar is running. Note that the maximum number
of compensated bins is 32. Maximum negative range
FFT index to be included for
The values in this command can be changed compensation. Negative
between sensorStop and sensorStart and even indices are indices wrapped
when the sensor is running. around from far end of 1D
FFT.
This is a mandatory command.
Ex: Value of -5 means last 5
bins starting from the
farthest bin
<positiveBinIdx> supported supported
positive Bin Index (to
remove DC from closest
range bins)
Maximum positive range
FFT index to be included for
compensation
21
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
1 - enabled
<startRangeIndex> n/a supported
22
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
CQRxSatMonitor enable
/disable
1:enable
0: disable
<sigImgBand> all values supported all values supported
CQSigImgMonitor enable
/disable
1:enable
0: disable
23
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
Controls HW streaming.
Specifies the HW streaming
data format.
0-HW STREAMING
DISABLED
1-ADC
2-CP_ADC
3-ADC_CP
4-CP_ADC_CQ
<enableSW> n/a all values supported
24
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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 stand
alone 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 Figure 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 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 place
jumpers on pins marked as SOP2 and SOP0 .
25
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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.
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.
Assuming you have updated the device support package and Emulation pack as mentioned in the section above, follow the steps mentioned
below to create a target configuration file in CCS.
26
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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 AWR1642 or AWR1443 and check the box. Click Save and the file
will be created.
Follow steps in above section to create a ccxml file. Once created, the target configuration file will be seen in the "Target Configurations" list
and you can launch the target by selecting it and with right-click select the "Launch Selected Configuration" option. This will launch the target
and the Debug window will show all the cores present on the device. You can connect to the target with right-click and doing "Connect
Target".
27
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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 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
28
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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. 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.
# 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 mono. 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
29
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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 xWR14xx/xWR16xx EVM".
REM For example to build the mmw demo for awr14xx or iwr14xx
cd %MMWAVE_SDK_INSTALL_PATH%/ti/demo/xwr14xx/mmw
gmake clean
gmake all
REM This will create xwr14xx_mmw_demo_mss.xer4f & xwr14xx_mmw_demo_mss.bin binaries under
REM %MMWAVE_SDK_INSTALL_PATH%/ti/demo/xwr14xx/mmw folder
REM For example to build the mmw demo for awr16xx or iwr16xx
cd %MMWAVE_SDK_INSTALL_PATH%/ti/demo/xwr16xx/mmw
gmake clean
gmake all
REM This will create xwr16xx_mmw_demo_mss.xer4f, xwr16xx_mmw_demo_dss.xe674 & xwr14xx_mmw_demo.bin
REM binaries under %MMWAVE_SDK_INSTALL_PATH%/ti/demo/xwr16xx/mmw folder
# Incremental build
make 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.
30
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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.
To clean build driver, control or alg component and its unit test, first make sure that the environment is setup as detailed in earlier section.
Then run the following commands
REM For example to build the adcbuf lib and unit test
cd %MMWAVE_SDK_INSTALL_PATH%/ti/drivers/adcbuf
gmake clean
gmake all
REM If MMWAVE_SDK_DEVICE is set to awr14xx or iwr14xx, the commands will create
REM libadcbuf_xwr14xx.aer4f library under ti/drivers/adcbuf/lib folder
REM xwr14xx_adcbuf_mss.xer4f unit test binary under ti/drivers/adcbuf/test/xwr14xx folder
REM If MMWAVE_SDK_DEVICE is set to awr16xx or iwr16xx, the commands will create
REM libadcbuf_xwr16xx.aer4f library for MSS under ti/drivers/adcbuf/lib folder
REM xwr16xx_adcbuf_mss.xer4f unit test binary for MSS under ti/drivers/adcbuf/test/xwr16xx folder
REM libadcbuf_xwr16xx.ae674 library for DSS under ti/drivers/adcbuf/lib folder
REM xwr16xx_adcbuf_dss.xe674 unit test binary for DSS under ti/drivers/adcbuf/test/xwr16xx folder
REM Above paths are relative to %MMWAVE_SDK_INSTALL_PATH%/
REM For example to build the mmwavelink lib and unit test
cd %MMWAVE_SDK_INSTALL_PATH%/ti/control/mmwavelink
gmake clean
gmake all
REM If MMWAVE_SDK_DEVICE is set to awr14xx or iwr14xx, the commands will create
REM libmmwavelink_xwr14xx.aer4f library under ti/control/mmwavelink/lib folder
REM xwr14xx_link_mss.xer4f unit test binary under ti/drivers/control/mmwavelink/test/xwr14xx folder
REM If MMWAVE_SDK_DEVICE is set to awr16xx or iwr16xx, the commands will create
REM libmmwavelink_xwr16xx.aer4f library for MSS under ti/control/mmwavelink/lib folder
REM xwr16xx_link_mss.xer4f unit test binary for MSS under ti/control/mmwavelink/test/xwr16xx folder
REM libmmwavelink_xwr16xx.ae674 library for DSS under ti/control/mmwavelink/lib folder
REM xwr16xx_link_dss.xe674 unit test binary for DSS under ti/control/mmwavelink/test/xwr16xx folder
REM Above paths are relative to %MMWAVE_SDK_INSTALL_PATH%/
REM Additional build options for each component can be found by invoking make help
gmake help
31
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
# Additional build options for each component can be found by invoking make help
make help
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 drivers are supported for all devices. List of supported drivers for each device is listed in the Release Notes.
32
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
By default, the SDK build uses "–emit_warnings_as_errors" option to help users identify certain common mistakes in code that are flagged as
warning but could lead to unexpected results. If user desires to disable this feature, then please set the flag
MMWAVE_DISABLE_WARNINGS_AS_ERRORS to 1 in the above mentioned setenv.bat or setenv.sh and invoke that file again to update
the build environment.
33
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
5. 1. System Deployment
5. 1. 1. xWR14xx
A typical mmWave application using xWR14xx would perform these operations:
1. xWR14xx program code is downloaded from the serial flash memory attached to xWR14xx (via QSPI)
2. Optional high level control from remote entity
3. Sends low speed data output (objects detected) to remote entity
2. Hybrid xWR14xx sensor + Controller
1. Serial flash is attached/in-built to external controller and SPI interface exists between xWR14xx and controller
2. High level control from controller (code download, GPIO toggling, etc)
3. Sends low speed data output (objects detected) to controller.
3. Satellite xWR14xx sensor + DSP
1. Program code is either in serial flash memory attached to xWR14xx (via QSPI) or downloaded via the control interface
between xWR14xx and DSP (ex: via SPI)
2. High level control from DSP
3. Sends high speed data output (1D/2D FFT output) to DSP
34
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
Note that the software architecture presented above demonstrates only the mmWave SDK components running on the external devices –
MCU, DSP, PC. There are other software components running on those external devices which are part of the ecosystem of those devices
and out of scope for this document. The mmWave SDK package would provide, in future, sample code for the mmWave API running on
these external devices but the porting of this layer onto these external device ecosystem is the responsibility of system integrator/application
code provider.
5. 1. 2. xWR16xx
A typical xWR16xx application would perform these operations:
1. xWR16xx program code for MSS and DSP-SS is downloaded from the serial flash memory attached to xWR16xx (via QSPI)
2. Optional high level control from remote entity
3. Sends low speed data output (objects detected) to remote entity
4. Optional high speed data (debug) sent out of device over LVDS
35
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
Using mmWave SDK the above chain could be realized as shown in the following figure for xWR14xx and xWR16xx. 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 AR device
or would run entirely on the external processor.
Figure 8: Typical mmWave radar processing chain using xWR14xx mmWave SDK
36
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
Figure 9: Typical mmWave radar processing chain using xWR16xx mmWave SDK
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. Control Path
The control path in the above processing chain is depicted by the following blocks.
37
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
Following set of figures shows how an application programming sequence would be for setting up the typical control path - init, config, start.
This is a high level diagram simplified to highlight the main sofwtare 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\<platf
orm>\mmw folder.
5. 3. 1. 1. xWR14xx (MSS<->RADARSS)
On xWR14xx, the control path runs on the Master subsystem (Cortex-R4F) and the application can simply call the mmwave APIs in the SDK
to realize most of the functionality.
38
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
39
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
5. 3. 1. 2. xWR16xx
On xWR16xx, the control path can run on MSS only, DSS only or in "co-operative" mode where the init and config are initiated by the MSS
and the start is initiated by the DSS after the data path configuration is complete. In the figures below, control path runs on MSS entirely and
MSS is responsible for properly configuring the RADARSS (RF) and DSS (data processing). The co-operative mode can be seen in the
MMW demo. The mmWave unit tests provide a sample implementation of all 3 modes.
40
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
41
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
5. 3. 2. Data Path
5. 3. 2. 1. xWR14xx
In xWR14xx, the data path in the above processing chain is depicted by the following blocks running on the MSS (Cortex-R4F).
5. 3. 2. 2. xWR16xx
In xWR16xx, the data path in the above processing chain is depicted by the following blocks running primarlity on the DSS (C674x).
42
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
5. 4. 1. 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 . 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>.ae 674 for DSP.
ADCBUF xWR14xx All features of IP (ADCBUF, CQ) are implemented in the driver
R4F
xWR16xx
R4F
xWR16xx
DSP
43
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
MD5
SHA-1
SHA-224
SHA-256
EDMA xWR14xx All features of IP are implemented in the driver except "privilege" feature
R4F
xWR16xx
R4F
44
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
xWR16xx
DSP
ESM xWR14xx Default ESM FIQ Interrupt handler for R4F and hook function for DSP's NMI
R4F
Provide application to register callback functions on specific ESM errors.
xWR16xx
R4F
xWR16xx
DSP
xWR16xx
R4F
xWR16xx
R4F
xWR16xx
R4F
xWR16xx
DSP
OSAL xWR14xx Provides an abstraction layer for some of the common OS services:
R4F Semaphore
Mutex
xWR16xx Debug
R4F Interrupts
Clock
xWR16xx Memory
DSP
PINMUX xWR14xx All Pinmux fields can be set and all device pad definitions are available
R4F
xWR16xx
R4F
xWR16xx
R4F
xWR16xx
R4F
xWR16xx
R4F
SOC xWR14xx Provides abstracted APIs for system-level initialization. See section "mmWave SDK - System
R4F Initialization" for more details.
xWR16xx
R4F
45
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
xWR16xx
DSP
SPI (MIBSPI) xWR14xx All features of IP are implemented in the driver including:
R4F 4-wire Slave and master mode
3-wire Slave and Master mode
xWR16xx both polling mode and DMA mode for read/write
R4F char length 8-bit and 16-bit.
xWR16xx
R4F
xWR16xx
R4F
xWR16xx
DSP
5. 4. 2. 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. 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 on xWR16xx 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. 3. 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, xWR16xx
only). 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.
46
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
Following figure shows the various interfaces/APIs of the mmWaveLink component. The source code for mmWaveLink is present in the mmw
ave_sdk_<ver>\packages\ti\control\mmwavelink folder. Documentation of the API is available via doxygen and placed at mmwave_sdk_<ver
>\packages\ti\control\mmwavelink\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\mmwavelink\test\ .
5. 4. 4. 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 xWR16xx, 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 and placed at mmwave_sdk_<ver>\packages\ti\control\mmwave\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\mmwave\test\.
47
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
There are two modes of configurations which are provided by the mmWave module.
5. 4. 4. 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:
48
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
MMWave_addChirp
MMWave_delChirp
Profile Management:
MMWave_addProfile
MMWave_delProfile
Currently API rlSetBpmChirpConfig and rlSetBpmCommonConfig are not handled by the mmWave API layer as part of the full configuration.
Users desiring this functionality can call these APIs between MMWave_config and MMWave_start.
5. 4. 4. 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 xWR16xx, the application is responsible for passing the
configuration between the MSS and DSS if required.
49
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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\do
cs\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.
5. 4. 5. mmWaveLib
50
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
mmWaveLib is a collection of algorithms that provide basic functionality needed for FMCW radar-cube processing. This component is
available for xWR16xx only and 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 and placed at mmwave_sdk_<ver>\packages\ti\alg\mmwavelib\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\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
Optimized and available for xWR16xx C674x DSP only
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.
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.
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 power accumulation: accumulates signal powers in floating point version.
Histogram: mmwavelib_histogram right-shifts unsigned 16-bit vector and calculates histogram.
Right shift operation on signed16-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.
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: multiplies a 16-bit complex vector and a 32-bit complex vector element by element, and
outputs to the 32-bit complex output vector.
Sum of absolute value of 16-bit vector elements
51
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
5. 4. 6.
Group Tracker
The algorithm is designed to track multiple targets, where each target is represented by a set of measurement points (point cloud output of
CFAR detection layer). Each measurement point carries detection informations, for example, range, angle, and radial velocity. Instead of
tracking individual reflections, the algorithm predicts and updates the location and dispersion properties of the group. The group is defined as
the set of measurements (typically, few tens; sometimes few hundreds) associated with a real life target. This algorithm is provided for
xWR16xx device only but is supported for both R4F and C674x. The source code for gtrack is present in the mmwave_sdk_<ver>\packages\ti
\alg\gtrack folder. Documentation of the API is available via doxygen and placed at mmwave_sdk_<ver>\packages\ti\alg\gtrack\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>\pa
ckages\ti\alg\gtrack\test\ .
5. 4. 7. RADARSS Firmware
This is a binary (mmwave_sdk_<ver>\firmware\radarss) that runs on Radar subsystem of the xWR14xx/xWR16xx and realizes the mmWave
front end. It exposes configurability via a set of messages over mailbox which is understood by the mmWaveLink component running on the
MSS. RADARSS firmware is responsible for configuring RF/analog and digital front-end in real-time, as well as to periodically schedule
calibration and functional safety monitoring. This enables the mmWave front-end to be self-contained and capable of adapting itself to handle
temperature and ageing effects, and to enable significant ease-of-use from an external host perspective. Features/enhancements information
can be found under firmare/radarss/mmwave_radarss_release_notes.pdf
5. 4. 10. 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
>\packages\ti\drivers\esm \docs\doxygen\html\index.html to understand the API specification.
5. 4. 10. 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>\packa
ges\ti\drivers\soc \docs\doxygen\html\index.html to understand the API specification. It primarily takes care of following things:
DSP un-halt
This applies for xWR16xx only. 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 xWR16xx MSS provides this functionality under its hood.
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.
52
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
Note that this function assumes that the crystal frequency is 40MHz.
MPU or Memory Protection Unit needs to be configured on the Cortex R4F of xWR14xx and xWR16xx 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.
MPU has been implemented in the SOC module as a private function SOC_mpu_config() that is called by public API SOC_init(). 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.
A build time option called DOWNLOAD_FROM_CCS has been added which when set to yes prevents program space from being
protected. 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.
The cacheability property of the various regions as seen by the DSP (C674x in xWR16xx) 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. 10. 3. Pinmux
Pinmux module is provided under mmwave_sdk_<ver>\packages\ti\drivers\pinmux with API documentation and available device pads
located at mmwave_sdk_<ver>\packages\ti\drivers\pinmux\docs\doxygen\html\index.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. 11. Usecases
The data path processing on mmWave device for 1D, 2D and 3D processing consists of a coordinated execution between the MSS, HWA
/DSS and EDMA. This is demonstrated as part of millimeter wave demo. The demo runs in real-time and has all the associated framework
for RADARSS control etc with it.
The “HWA_EDMA” for xwr14xx and "DSP_EDMA" for xwr16xx tests (located at mmwave_sdk_<ver>\packages\ti\drivers \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 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 mmw demo documentation.
The “HWA_EDMA” and "DSP_EDMA" 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 “HWA_EDMA” and "DSP_EDMA" 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\driver
s\test\<test_dir>\docs\doxygen\html\index.html.
53
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
IWR14xx device has a high speed CSI-2 transmit interface that can be used to ship ADC data or 1D/2D processed data out of the device. An
example usecase on how to program the front end to generate the ADC samples and tie it up to CBUFF/CSI-2 interface for data shipment is
provided under mmwave_sdk_<ver>\packages\ti\drivers\test\csi_stream. Refer to the doxygen documentation located at mmwave_sdk_<ver>
\packages\ti\drivers\test\csi_stream\docs\doxygen\html\index.html for more details.
5. 4. 11. 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>\packages\ti\drivers\test\mem_capture\docs\doxygen\html\index.html for more details.
54
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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 mmw
ave_sdk_<ver>\packages\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\reg_*.h. The system level registers (RCM, TOPRCM, etc) are available under the SOC module (mmwave_sdk_<ver>\packages\ti\driv
ers\soc\include\reg_*.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 :
55
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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\l
inux for merging the MSS .xer4f, DSS .xe674 and RADARSS RPRC binaries into one metaImage and appending correct CRC. The RPRC
56
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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:
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
"xWR1xxx 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 mmw
ave_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
xWR14xx/xWR16xx EVM). Refer to "xWR1xxx 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;
57
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
Set the target as explained in the demo documentation and update the mmwave_sdk_<ver>\packages\ti\demo\xwr16xx\mmw\profiles
\profile_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\xwr16xx\mmw\profi
les\profile_calibration.cfg.
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 "Range/Angle Bias compensation
config" textbox in the Visualizer and any new profile generated by the Visualizer will use these values. 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>\packa
ges\ti\ common\mmwave_sdk.mak.
2. On C674X, compile portions of code that are not in compute critical path with appropriate -msX option. The -ms0 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 xWR16xx, using ms0 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 "ms" 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 mmwave (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 at ti/demo/xwr16xx/mmw.
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:
1. one time/first time only program code can be overlaid with data memory buffers used after such code is executed. This is
illustrated in the mmw demo on C674X code for xWR16xx and on R4F code for xWR14xx where such code is overlaid with
(load time uninitialized) radar cube data in L3 RAM, refer to the file mmwave_sdk_<ver>\packages\ti\demo\xwr16xx\mmw\d
ss\dss_mmw_linker.cmd and mmwave_sdk_<ver>\packages\ ti\demo\xwr14xx\mmw\mss_mmw_linker.cmd (Note: Ability to
place code at function granularity requires to use the aforementioned -mo option).
2. 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. On the mmw demo, the
L1D SRAM is used to allocate some buffers involved in data path processing whereas the L1P SRAM has 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
58
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
7.
would like to support using mmW demo, record the heap usage/free metrics for L1D, L2 and L3 heaps on 'sensorStart'. These
values can then be used to resize or re-allocate gMmwL1, gMmwL2 and gMmwL3 in mmwave_sdk_<ver>\packages\ti\demo\xwr16xx
\mmw\dss\dss_data_path.c. The freed up space could be used as follows:
1. Free heap space in L1D could be used to move some of the L2 buffers to L1D. Refer to section "EDMA versus Cache
based Processing" in mmwave_sdk_<ver>\packages\ti\demo\xwr16xx\mmw\docs\doxygen\html\index.html documentation
for overview of data buffer layout. The freed L2 space can be used for code/data.
2. Free heap space in L2 could be trimmed by changing the 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).
3. Free heap space in L3 could be trimmed by changing the gMmwL3 definition and used for code/data space. One caveat is
that L3 in mmW demo is un-cached and hence one could see some cycles impact but this is a decision each application
developer can make depending on the memory and compute (MIPS) needs.
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:
obj_xwr14xx/
main.oer4f 5191 0 263980
data_path.oer4f 8441 0 65536
config_hwa_util.oer4f 4049 0 0
post_processing.oer4f 2480 0 0
mmw_cli.oer4f 2308 0 0
config_edma_util.oer4f 1276 0 0
sensor_mgmt.oer4f 1144 0 24
+--+-------------------------------+--------+---------+---------+
Total: 24889 0 329540
6. 10. How to add a .const (table) beyond L3 heap in mmW demo where overlay is
enabled
In mmW demo for xWR16xx, L3 heap is overlaid with the code to be copied into L1P at init time. To achieve this overlay, 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 dss_data_path.c file:
#define TABLE_LENGTH 4
#define TABLE_ALIGNMENT 8 /* bytes */
59
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
In dss_mmw_linker.cmd file:
.l3data_garray: load=L3SRAM PAGE 0 (HIGH)
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:
dss_mmw.mak
dssDemo: C674_CFLAGS += --cmd_file=$(BUILD_CONFIGPKG)/compiler.opt \
/* include path for DSP_fft16x16 *
/ \
-i$(C64Px_DSPLIB_INSTALL_PATH)/packages/ti/dsplib/src/DSP_fft16x16
/c64P \
/* include path for DSP_fft32x32 */ \
-i$(C64Px_DSPLIB_INSTALL_PATH)/packages/ti/dsplib/src/DSP_fft32x32
/c64 \
-i$(C674x_MATHLIB_INSTALL_PATH)/packages \
In dss_data_path.c:
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.
60
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
A variant (not illustrated in mmw demo) 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
dssDemo: C674_CFLAGS += --cmd_file=$(BUILD_CONFIGPKG)/compiler.opt \
-i$(C64Px_DSPLIB_INSTALL_PATH)/packages \
-i$(C674x_MATHLIB_INSTALL_PATH)/packages \
dss_data_path.c
#include <ti/dsplib/src/DSP_fft16x16/c64P/DSP_fft32x32.h>
#include <ti/dsplib/src/DSP_fft16x16/c64P/DSP_fft16x16.h>
dss_mmw.mak
dssDemo: C674_CFLAGS += --cmd_file=$(BUILD_CONFIGPKG)/compiler.opt \
-i$(C64Px_DSPLIB_INSTALL_PATH)/packages \ <-- C64P dsplib
-i$(C674x_DSPLIB_INSTALL_PATH)/packages \ <-- C674x dsplib
-i$(C674x_MATHLIB_INSTALL_PATH)/packages \
In dss_data_path.c:
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 xWR14xx, when 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).
61
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
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. 13. 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.
Continuous refresh:
62
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
63
Copyright (C) 2018, Texas Instruments Incorporated
http://www.ti.com
MMWAVE SDK User Guide
64