element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Blog MSPM0 project with VS Code, CMake and GCC - part 3: debug
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 3 Sep 2026 9:36 AM Date Created
  • Views 22 views
  • Likes 3 likes
  • Comments 0 comments
  • MSPM0L1105
  • ccs
  • MSPM0
  • VS Code
  • MSPM0L1306
  • vscode
  • code_composer_studio
Related
Recommended

MSPM0 project with VS Code, CMake and GCC - part 3: debug

Jan Cumps
Jan Cumps
3 Sep 2026

In this blog series, I build a Texas Instruments MSPM0 example with VS Code as IDE, and CMake as build infrastructure.
Post 2 covered the software build. In this post: debugging the firmware.

If not done yet, open the TI Embedded Debugger plugin, and select install dependencies. It installs a version of GCC's GDB executable, support for the XDS110, drivers, and an OpenOCD install.

Configure Environment Variables

Set the GCC ARM toolchain used for debugging*:

The easiest way is to override what the TI VS Code extensions put in your user file. We can do that in the Workspace settings.json file.

{
	"folders": [
		{
			"path": "msmp0_cmake"
		}
	],
	"settings": {
		"cmake.cmakePath": "C:/Users/jancu/.pico-sdk/cmake/v4.2.1/bin/cmake.exe",
		"cmake.generator": "Ninja",
		"cmake.environment": {
			"CMAKE_PROGRAM_PATH": "C:/Users/jancu/.pico-sdk/ninja/v1.13.2/ninja.exe",
			"SYSCONFIG_CLI": "C:/ti/sysconfig_1.27.1/sysconfig_cli.bat"
		},
		"cmake.configureEnvironment": {
			"SDK_ROOT": "C:/ti/mspm0_sdk_2_11_00_07"
		},
		"cmake.enableTraceLogging": false,
		"cmake.loggingLevel": "info",
		"ti-embedded-debug.armToolchainPath": "c:/Users/jancu/Documents/toolchains/arm-gnu-toolchain-15.2.rel1-mingw-w64-i686-arm-none-eabi/bin",
		"cortex-debug.armToolchainPath": "c:/Users/jancu/Documents/toolchains/arm-gnu-toolchain-15.2.rel1-mingw-w64-i686-arm-none-eabi/bin"
	}
}

* the ti-embedded-debug.armToolchainPath setting is used to find the GDB executables. TI defaults it to a TI GCC toolchain installed with their TI Embedded Debug extension. I prefer to have it point to the same toolchain that I use for building the firmware. Sometimes, there are incompatibilities when you debug firmware that's built with a newer version of the GCC tools.

My current setup requires me to set up a number of links to different locations. If I find the energy, I may replace that with a set of variables, and then relative paths in the scripts. Less room for mistakes, and less work when changing toolchain versions ....

    Debug Project

    Prepare a launch.json script, and place it in your project's .vscode folder:

        "version": "0.2.0",
        "configurations": [
            {
                "cwd": "${workspaceFolder}",
                "executable": "${command:cmake.launchTargetPath}",
                "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/jancu/AppData/Local/Texas Instruments/ti-embedded-debug/openocd/1.5.0.75/share/openocd/scripts"
                ],
                "runToEntryPoint": "main",
                "showDevDebugOutput": "none",
                "deviceName": "MSPM0L1306"
            }
        ]
    }

    Point the OpenOCD searchDir to script folder of where the TI Extension installed its tools (or yopur own OpenOCD install, if you have one). You can find that location in the settings.json script you just edited.

    Now all is ready. Press Run and Debug in the left toolbar. Select the debug configuration you just created. Then press the green button.

    image

    If all is well, the debugger programs the MSPM0, then starts execution and stops on the first line of main:

    image

    If you also installed TI's extension Cortex-Debug: Device Support Pack - Texas Instruments MSPM0, you can also see the Peripheral registers. To do that, select View -> Open View -> xPeripherals:

    image

    Post 2:  MSPM0 project with VS Code, CMake and GCC - part 2: build a real project 

    • Sign in to reply
    element14 Community

    element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

    • Members
    • Learn
    • Technologies
    • Challenges & Projects
    • Products
    • Store
    • About Us
    • Feedback & Support
    • FAQs
    • Terms of Use
    • Privacy Policy
    • Legal and Copyright Notices
    • Sitemap
    • Cookies

    An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

    Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

    Follow element14

    • X
    • Facebook
    • linkedin
    • YouTube