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 1: infrastructure
  • 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: 30 Aug 2026 7:37 PM Date Created
  • Views 72 views
  • Likes 4 likes
  • Comments 2 comments
  • MSPM0L1105
  • ccs
  • MSPM0
  • easyL1105
  • VS Code
  • cmake
  • MSPM0L1306
  • vscode
  • code_composer_studio
Related
Recommended

MSPM0 project with VS Code, CMake and GCC - part 1: infrastructure

Jan Cumps
Jan Cumps
30 Aug 2026

In this blog series, I plan to build a Texas Instruments MSPM0 example with VS Code as IDE, and CMake as build infrastructure.
I'm trying to use the guidelines from TI's Using CMake with TI Clang Compilers and SysConfig. But then with GCC (version 15 for embedded arm) instead of TI Clang. And using the VS Code CMake extensions. In the first part: the infrastructure to make it work 

image

The default IDE for TI controllers is Code Composer Studio. That works right away, and has good integration with the configurator and debugger.
Shabaz provided examples for Windows with Keil, Windows with GCC and Linux with GCC.

Dependencies

You 'll need:

  • VS Code
  • VS Code CMake Tools extension (released by Microsoft - install via VS Code extension button)
  • CMake installed, preferably version 4 or higher
  • Ninja
  • GCC cross compile toolchain arm-none-eabi

These can all be downloaded and installed separately. If you use VS Code with the Raspberry Pico extension, you will find CMake, Ninja and an Arm GCC compiler in its pico_sdk folder (on my computer: C:\Users\jancu\.pico-sdk)

The next posts will also use TI's MSPM0 SDK and SysConfig tools. More on that when we need them.

Create a fresh workspace, create your first project

A fresh workspace is a good idea when you're experimenting with a new controller and toolset. You won't risk contaminating your existing VS Code projects

image

Open VS Code. If you have used it before, close all windows. Then close the current workspace: File -> Close Workspace

Then we make a new workspace:

File-> Save Workspace As...
In the dialog box, navigate to a good location, and create a folder (I used C:\Users\jancu\workspace_vscode_mspm0).
Then navigate to that folder, enter a file name for the workspace (mine:workspace.code-workspace-mspm0.code-workspace)
Then Save

Let's add a folder for our first project to the workspace: File -> Add folder to workspace.
In the dialog box, navigate to that workspace you just created, and create a new folder there (I used: msmp0_cmake).
Select it, then Add

use of AI: I used Google AI to look up compiler settings for the MSPM0 architecture (see image at the top of the post). It also helped to resolve several build errors

Install and configure VS Code CMake extension

Click on the VS Code Extensions icon, and search for CMake Tools. Install it.

image

If your CMake and Ninja executables are not on your path, you can define them in the settings. If tcmake.exe and ninja.exe are on your path, you can skip the steps.

Select the Manage cogwheel, and select Settings. Select the Workspace tab.

Extensions -> Cmake Tools

Set the path to your cmake.exe in Cmake Path:

image

And add Ninja's executable as CMake Environment variable CMAKE_PROGRAM_PATH.

image

Minimal CMake File and Test Code

I lean heavily on TI's notes here. The C source is the same. The CMake file is adapted to GCC. And I left out the parts that will be covered in a follow up post.
The goal is to have a successful build. Create a binary without errors or warnings.

stub.c:

int main()
{
    return 0;
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.29)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmodules-ts -fcommon -fno-rtti -fno-exceptions --specs=nano.specs -Wl,--gc-sections")
set(CMAKE_CXX_STANDARD_REQUIRED ON)


# Cross compiling for a target system that is an embedded device
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --specs=nosys.specs  -Wl,--gc-sections")

# Create the project
project(
    stub                 # Project is named stub
    LANGUAGES C  CXX     # Uses the programming language C
)

#---------------------------------------------------------------------
# Configuration related to compiling
#---------------------------------------------------------------------
# Compiler options which specify the variant of the Arm processor in the
# system.
set(PROCESSOR_OPTIONS
    -march=armv6s-m
    -mcpu=cortex-m0plus
    -mfloat-abi=soft
    -mlittle-endian
    -mthumb
)

# Build the executable from source files in the project
add_executable(
    stub                 # Executable is named stub
    stub.c               # Has one source file
    nofilesystem.c       # temporary function definitions until we add sdk libs
)

I also created a C file to define a few of dummy filesystem operations. Else, the linker throws warnings for a set of missing functions. Once the MSPM0 library is linked in (next post), we can remove this file.

nofilesystem.c:

#include <sys/stat.h>

int _close(int file) {
    (void)file;
    return -1;
}

int _fstat(int file, struct stat *st) {
    (void)file;
    st->st_mode = S_IFCHR;
    return 0;
}

int _isatty(int file) {
    (void)file;
    return 1;
}

int _lseek(int file, int ptr, int dir) {
    (void)file; (void)ptr; (void)dir;
    return 0;
}

int _read(int file, char *ptr, int len) {
    (void)file; (void)ptr; (void)len;
    return 0;
}

int _write(int file, char *ptr, int len) {
    (void)file; (void)ptr; (void)len;
    return len;
}

Use CMake Tools to configure the project and run a build

Open CMake Tools. Select your project folder.

image

If your arm cross is on the path, you can directly select it as a kit in the Configure node. If not, press the Select a Kit pencil, and scan recursively for toolchains.
In the dialog that pops up, navigate to the root directory of your GCC arm-none-eabi kit. If you use the Raspberry Pico extension for VS Code, you will find at least one GCC version in its toolchain subfolder.

Complete configuration by pressing the Configure button:

image

You should see output similar to this:

[main] Configuring project: msmp0_cmake
[proc] Executing command: C:/Users/jancu/.pico-sdk/cmake/v4.2.1/bin/cmake.exe -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=c:\Users\jancu\Documents\toolchains\arm-gnu-toolchain-15.2.rel1-mingw-w64-i686-arm-none-eabi\bin\arm-none-eabi-gcc.exe -DCMAKE_CXX_COMPILER:FILEPATH=c:\Users\jancu\Documents\toolchains\arm-gnu-toolchain-15.2.rel1-mingw-w64-i686-arm-none-eabi\bin\arm-none-eabi-g++.exe --no-warn-unused-cli -S C:/Users/jancu/workspace_vscode_mspm0/msmp0_cmake -B c:/Users/jancu/workspace_vscode_mspm0/msmp0_cmake/build -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Configuring done (0.0s)
[cmake] -- Generating done (0.0s)
[cmake] -- Build files have been written to: C:/Users/jancu/workspace_vscode_mspm0/msmp0_cmake/build

Then build the project:

image

The output should have no errors and warnings

[main] Building folder: c:/Users/jancu/workspace_vscode_mspm0/msmp0_cmake/build
[build] Starting build
[proc] Executing command: C:/Users/jancu/.pico-sdk/cmake/v4.2.1/bin/cmake.exe --build c:/Users/jancu/workspace_vscode_mspm0/msmp0_cmake/build --config Debug --target all --
[build] [2/3  33% :: 0.127] Building C object CMakeFiles/stub.dir/stub.c.obj
[build] [2/3  66% :: 0.144] Building C object CMakeFiles/stub.dir/nofilesystem.c.obj
[build] [3/3 100% :: 0.262] Linking C executable stub
[driver] Build completed: 00:00:00.319
[build] Build finished with exit code 0

Let's check if the executable is built: yes Slight smile

image

In the next post, I try to set up linking with the SDK libraries. And then a first real project...

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

  • Sign in to reply
  • shabaz
    shabaz 12 hours ago in reply to Jan Cumps

    Looking forward to trying this! I'd much prefer this setup (i.e. SDK + VS Code), rather than install TI's IDE.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps 2 days ago

    All works. It can build firmware (also .hex file compatible with shabaz ' bootloader).

    And the debugger works from within VS Code Heart :

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
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