TI Embedded Debug for VS Code
TI Embedded Debug for VS Code leverages open-source tools like OpenOCD and GDB to provide a comprehensive debugging experience across multiple TI device families, including popular platforms such as MSPM0 Microcontrollers and SimpleLink™ Wireless Connectivity Devices.
With TI Embedded Debug for VS Code, you can:
- Connect to and debug TI devices directly within your VS Code environment
- Use the familiar VS Code debugger interface to set breakpoints, step through code, inspect variables, etc.
- Utilize various debugging interfaces, including JTAG and SWD
This extension's open-source foundation ensures that you can customize and extend your debugging experience as needed.
Supported Devices
The following TI device series are supported by this extension:
MSPM0 Microcontrollers:
SimpleLink™ Wireless Connectivity Devices:
- CC26x0
- CC26x2
- CC13x0
- CC13x2
Installation
To set up everything you need to start using this extension, simply click the "Install Dependencies" button in the TI Embedded Debug for VS Code sidebar view. You will be automatically prompted to install/update this extension's dependencies upon its activation. If you want this extension to automatically keep its dependencies up-to-date, modify the TI Embedded Debug: Keep Dependencies Up To Date
configuration in your VS Code settings.
Creating a Launch Configuration
Once all dependencies have been installed, add a launch configuration to debug with OpenOCD. You can do this by clicking Run
> Add Configuration...
and selecting Cortex Debug: OpenOCD
. The example below shows what your launch configuration might look like for an MSPM0 project named my_project
:
{
...
"launch": {
...
"configurations": [
...
{
"cwd": "C:/Users/username/workspace/my_project/Debug",
"executable": "my_executable.out",
"name": "Debug with TI Embedded Debug for VS Code",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"configFiles": [
"./interface/xds110.cfg",
"./board/ti_mspm0_launchpad.cfg"
],
"searchDir": [
"C:/Users/<username>/AppData/Local/Texas Instruments/ti-embedded-debug/openocd/<version>/share/openocd/scripts"
],
"runToEntryPoint": "main",
"showDevDebugOutput": "none",
"deviceName": "MSPM0G3507"
}
...
]
...
},
...
}
Note the use of relative paths outside of the cwd
and searchDir
properties. The searchDir
property is used to look for the device-specific configuration files referenced in the configFiles
property. If searchDir
is specified, paths in configFiles
are relative to searchDir
. Otherwise, they are relative to cwd
. All other paths (namely exectuable
) are relative to cwd
.
Inclusion of the deviceName
property is necessary in order to be able to view peripheral registers while debugging. It is a known issue that this property will show up as "not allowed" in launch.json
, despite working fine.
Known Issues
CC13xx/CC26xx
When debugging a CC13xx/CC26xx device, if you fail to start a debugging session, try adding the following property to your launch configuration:
"openOCDLaunchCommands": ["adapter_khz 2000"],
C Preprocessor Directives
VS Code may complain about specific usages of the #include
preprocessor directive, and may dim usages of other directives such as #define
. Warnings associated with these for TI example projects should generally not affect your ability to run/debug said projects.
Current-Line Highlight
The highlight corresponding to the currently-executed line may be off by one in certain instances.
deviceName Property
This launch.json property will show up as "not allowed", despite being usable by Cortex-Debug and its support packs.