Skip to content
| Marketplace
Sign in
Visual Studio Code>Extension Packs>micro:bit VS Code Extension PackNew to Visual Studio Code? Get it now.
micro:bit VS Code Extension Pack

micro:bit VS Code Extension Pack

Preview

Micro:bit Educational Foundation

|
851 installs
| (0) | Free
micro:bit
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

micro:bit VS Code Extension

Preview release of VS Code support for the micro:bit codal environment

Getting started

Desktop

With VS Code installed, past this URL in a browser:

vscode://microbit.microbit-pack/clone?url=https://github.com/thegecko/microbit-v2-samples

The following should happen:

  • VS Code should open and installe the micro:bit pack if it isn't already installed
  • The repository passed should be cloned to a folder the user chooses and opened
  • The environment manager downloads and activates any tools specified in the vcpkg-configuration.json file (e.g. cmake, gcc)

Web with local files

Clone an example repository locally

git clone https://github.com/thegecko/microbit-v2-samples
  • In chrome or edge, open vscode.dev and open the folder cloned locally
  • Install the micro:bit VS Code Extension Pack (id: microbit.microbit-pack) from the marketplace

Web with github

Open this URL in chrome or edge:

https://vscode.dev/github/thegecko/microbit-v2-samples

The following should happen

  • You are asked to authenticate with github
  • The repository passed is opened from github
  • You are prompted to install the micro:bit VS Code Extension Pack if needed

Any changes pushed will be done via a fork if you don't have relevant permission on the repository

Usage

A device manager panel should be visible to select a micro:bit attached to the system.

A micro:bit panel should be visible with buttons to:

  • Build: use the builtin codal task provider to hydrate and build the project (Web WIP - see notes)
  • Run: use the Arm embedded-debug extension to flash a device via DAPLink
  • Debug: use the Arm embedded-debug extension to debug a device

When debugging, an SVD viewer panel should also be visible.

Notes

Build in web

This is a work in progress and not complete.

In order for project hydration to work, tar equivalents of dependant libraries must be served from a host with CORS disabled.

To mimic this locally, the sample above requires these files to be downloaded somewhere:

  • https://github.com/lancaster-university/codal-microbit-v2/archive/refs/heads/master.tar.gz
  • https://github.com/microbit-foundation/codal-core/archive/refs/heads/master.tar.gz
  • https://github.com/microbit-foundation/codal-nrf52/archive/refs/heads/master.tar.gz
  • https://github.com/microbit-foundation/codal-microbit-nrf5sdk/archive/refs/heads/master.tar.gz

And then served up on localhost:

npx serve --cors -p 3000

The host and port for this are configurable in the extension settings.

Debug in web

If the binary being debugged was built in a different folder structure, then the debugger needs to be told where to find the source files. This can be done using the pathMapping configuration item in launch.json, e,g,:

{
    "configurations": [
        ...
        {
            "name": "Debug Device",
            "type": "embedded-debug",
            "request": "launch",
            "serialNumber": "${command:device-manager.getSerialNumber}",
            "cmsisPack": "${command:device-manager.getDevicePack}",
            "deviceName": "${command:device-manager.getDeviceName}",
            "program": "${workspaceFolder}/build/MICROBIT",
            "debugFrom": "main",
            "pathMapping": {
                "/path/to/microbit-v2-samples/": "${workspaceFolder}/"
            }
        }
        ...
    ]
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft