Prerequisites

Download and install the prerequisite software, and make sure they are set in your system path.

Setup

  • Open VS Code and navigate to extensions.

exten
Fig. 1. VS Code
  • Search for CMake and install the extensions CMake, CMake Tools, and CMake Language Support.

cmtools
Fig. 2. VS Code Extensions
  • You also need the extension "clangd".

cld
Fig. 3. VS Code Extension clangd
  • To import the BSP example into VS Code, click File → Open Folder and navigate to the root folder of the BSP example. The project will not be in your Explorer view.

  • Navigate back to Extensions → CMake Tools → Extension Settings → click workspace and scroll down to find Cmake Configure Args. Add the argument: "-DCMAKE_TOOLCHAIN_FILE=clang-tricore-tc18-none-eabi.cmake", without double quotes.

Building and Running your Project

  • Type CTRL + SHIFT + P to open a command palette, type cmake to filter and click CMake: Configure. The first time you do this it will give you the option to choose a toolchain. If your desired toolchain does not appear, choose the option to scan and it should appear.

CMake will use the first toolchain listed in your system variable path.
cmdp
Fig. 4. VS Code Command Palette
  • After choosing CMake: Configure, the project will be configured, you can then choose CMake: Build to build the project.

If you wish to change any settings after a complete build, you need to either use the option CMake: Delete Cache and Reconfigure, or delete the "build" folder.