Skip to content

Working with VS Code

We recommend that you use Visual Studio Code for development as it provides IntelliSense and a debugging environment ready for you to use.

Once installed, please install the following extensions:

Extension Link
C/C++ https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
CMake Tools https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools
Cortex-Debug (optional for debugging) https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug

Building directly from VS Code

You can build directly from VS Code with the above installed.

With these extensions installed, follow these instructions on opening the project:

  1. When it asks you if you would like to configure the project, select 'yes'.
  2. The extension should scan your computer for available kits (compilers, in our case one for C and one for C++). Select your arm-none-eabi compilers; an example on Windows is shown below. selecting kit on Windows

Note

If your compilers do not show up here, it's easy to tell VS Code where they are.

  1. Your project will configure.
  2. If it asks you if you want to auto-configure IntelliSense, select 'yes'.
  3. Any time you want to build, just press the build button on the bottom (or press F7). build button
  4. Your outputted hex will be placed in the root of the directory.

Manually specifying your compilers

If you want to use a different installation of your compiler, or they were not correctly detected, it's easy to tell VS Code where they are.

  1. Navigate to the .vscode directory (make it if it does not exist.)
  2. Download this template file (right-click, Save Link As) into this .vscode directory.
  3. Modify the respective entries for the compilers to where your compiler is stored.
  4. You can now follow the steps above; just select my-arm-none-eabi when it asks you for your kit.

You're all set

You're ready to start programming the micro:bit.

Write and build your first program