Downloading and Flashing

Getting your code into your device is very easy with MakeCode. You do not need to install any software on your machine and the process takes two steps:

  • Step 1: Connect your board via USB
  • Step 2: Compile and Download the .uf2 file into your board drive

We are going to go through these two steps in detail.

Step 1: Connect your board via USB

Connect your board to your computer via a USB cable. You should see a MAKECODE drive appear in your file explorer/finder. If your board is in bootloader mode, you will see drive names like METROBOOT or GEMMABOOT. We will call those boardnameBOOT.

If it is your first time running MakeCode or if you have previously installed Arduino or CircuitPython, you may need to double press the reset button to get your board into bootloader mode.

Step 2: Test your code in the simulator

Let's first verify that our code compiles properly in MakeCode.

MakeCode has a built-in simulator that re-loads and re-runs code when restarted. This is an easy way to both ensure that our code compiles and simulate it before moving it onto the board. The refresh button re-loads the simulator with your latest version of block code.

If you receive a "we could not run this project" error, please check over your code for errors.

Step 3: Download and flash your code

If your board is working in the simulator, it's time to download it to your actual board! Click the Download button. It will generate a .uf2 file and download it to your computer. UF2 is a file format designed by Microsoft to flash microcontrollers over USB.

General Steps to copy over your program (not specific to any Operating system)

* Ensure your board is connected via USB.
* Find the .uf2 file generated by MakeCode in your file explorer. Copy it to the MAKECODE or boardnameBOOT volume.
* The status LED on the board will blink while the file is transferring. Once it's done transferring your file, the board will automatically reset and start running your code (just like in the simulator!)

On a Mac, you can safely ignore the "Disk Not Ejected Properly" notification that may appear after copying your .uf2 file.
This guide was first published on Aug 23, 2017. It was last updated on Nov 17, 2018. This page (Downloading and Flashing) was last updated on Oct 23, 2018.