Skip to content
| Marketplace
Sign in
Visual Studio Code>Education>SPIKE Prime CNew to Visual Studio Code? Get it now.
SPIKE Prime C

SPIKE Prime C

Jiaxing Rong

|
2 installs
| (0) | Free
Beginner-friendly VS Code workflow for building and running SPIKE Prime C projects.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

SPIKE Prime C for VS Code

Beginner-friendly VS Code commands for creating, building, uploading, and running SPIKE Prime C projects.

Commands

  • SPIKE Prime: New Project
  • SPIKE Prime: Build
  • SPIKE Prime: Upload
  • SPIKE Prime: Build and Run
  • SPIKE Prime: Select Hub
  • SPIKE Prime: Configure SPIKE-RT Tools
  • SPIKE Prime: Open SPIKE-RT Build Folder

First milestone

This scaffold creates a JavaScript VS Code extension and a starter C project template. The generated project can build directly against a local SPIKE-RT checkout with make.

Second milestone

The next milestone is a SPIKE-RT-native project flow:

  1. Run SPIKE Prime: New/Open SPIKE-RT App.

  2. Choose an app name, for example line_follower.

  3. The extension creates or registers the app inside the local SPIKE-RT checkout.

  4. The extension configures the real SPIKE-RT build folder:

    /Users/jax/spike-rt/build/obj-primehub_line_follower
    
  5. VS Code opens that generated build folder.

  6. Edit, build, upload, and run from the SPIKE-RT build folder.

This flow is less tidy than a standalone project folder, but it is closer to SPIKE-RT's documented build model. It should also reuse shared SPIKE-RT build artifacts more naturally:

/Users/jax/spike-rt/build/obj-primehub_kernel
/Users/jax/spike-rt/build/obj-primehub_pybricks

The first build may still take several minutes because SPIKE-RT has to compile Pybricks, the kernel, TECS-generated sources, and the app firmware. Later builds, and additional apps that reuse the same SPIKE-RT build cache, should usually be faster.

Local development

  1. Open this folder in VS Code.
  2. Press F5 to launch an Extension Development Host.
  3. In the new VS Code window, run SPIKE Prime: New Project.
  4. Open the generated project folder.
  5. Run SPIKE Prime: Build or run make in the project folder.

Real SPIKE-RT setup

SPIKE-RT's documented Mac workflow builds inside Docker and flashes the hub from the host machine with PyUSB/libusb. New projects generated by this extension wrap that workflow so the project folder itself can be built with make.

Before real upload on macOS:

  1. Install Docker Desktop.

  2. Install the SPIKE-RT source tree and submodules.

  3. Pull the SPIKE-RT Docker image:

    docker pull ghcr.io/spike-rt/spike-rt:rich
    
  4. Install libusb:

    brew install libusb
    
  5. In the SPIKE-RT repo, create the Python environment expected by SPIKE-RT:

    python3 -m venv ./tools/python
    ./tools/python/bin/pip install pyusb
    
  6. Open a generated SPIKE Prime C project folder.

  7. Run SPIKE Prime: Build.

For upload, put the hub in DFU mode first: turn the hub off, hold the Bluetooth button, plug in USB, and keep holding until the light flashes.

On this machine, the detected SPIKE-RT checkout is:

/Users/jax/spike-rt

Known build folders include:

/Users/jax/spike-rt/build/obj-primehub_motor
/Users/jax/spike-rt/build/obj-primehub_led
/Users/jax/spike-rt/build/obj-primehub_button
/Users/jax/spike-rt/build/obj-primehub_pybricks

To test a real upload path, open a generated project folder, build it, put the hub in DFU mode, then run SPIKE Prime: Upload.

For Docker builds, the generated project mounts both the project folder and the full SPIKE-RT checkout into the container. This is required because generated build folders reference files such as /Users/jax/spike-rt/asp3/kernel/Makefile.kernel.

Settings

  • spikePrimeC.makeCommand: build command, default make
  • spikePrimeC.uploadCommand: upload command, default make deploy-dfu
  • spikePrimeC.outputFile: firmware file used by upload commands, default .spike-rt/build/obj-primehub_main/asp.bin
  • spikePrimeC.uploadRunsInTerminal: run upload in a terminal, default true
  • spikePrimeC.showDfuInstructions: show DFU reminder before upload, default true
  • spikePrimeC.spikeRtRoot: local SPIKE-RT checkout, default /Users/jax/spike-rt

References

  • SPIKE-RT repository: https://github.com/spike-rt/spike-rt
  • SPIKE-RT environment notes: https://github.com/spike-rt/spike-rt/blob/main/docs/ja/Env.md
  • SPIKE-RT application development notes: https://github.com/spike-rt/spike-rt/blob/main/docs/ja/DevelopApp.md
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft