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.
Recommended extensions¶
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:
- When it asks you if you would like to configure the project, select 'yes'.
- 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.
Note
If your compilers do not show up here, it's easy to tell VS Code where they are.
- Your project will configure.
- If it asks you if you want to auto-configure IntelliSense, select 'yes'.
- Any time you want to build, just press the build button on the bottom (or press F7).
- 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.
- Navigate to the
.vscode
directory (make it if it does not exist.) - Download this template file (right-click, Save Link As) into this
.vscode
directory. - Modify the respective entries for the compilers to where your compiler is stored.
- 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.