The bootloader is piece of software on the board that is responsible for flashing the rest of the board with the program from the user. Many of the Adafruit M0 and M4 boards, as well as others, now come with a UF2 bootloader. The UF2 bootloader emulates a USB (or pen / thumb / flash) drive and lets you flash the board by simply copying a UF2 file onto the drive presented by the board.
Are you trying to build a MakeCode Arcade for Raspberry Pi 0? Try this guide instead.
With MakeCode Arcade, we go a step further and let you use the same UF2 file on many different boards, which differ only in the pinout (how things are mapped). To do that, the bootloader contains a small amount of configuration data that specifies which pin is connected to which button, and which pins are connected to the screen. The Arcade program then probes this data at runtime and configures itself accordingly. This way, the same Arcade binary game (UF2 file) could run on a device made of an ItsyBitsy M4, a Feather M4, or another completely custom board that uses the ATSAMD51 microcontroller (MCU).
This is the screen image displayed by the bootloader for an ATSAMD51-based MCU. "D51" is the code name with a green background, and this image helps you configure the MakeCode Arcade editor.
The screen also displays the drive name, ARCD-D51 in this case.
If you have an ItsyBitsy M4, that's great! However, the bootloader that comes with it by default doesn't have the configuration data needed for MakeCode Arcade, mostly because we don't know where you want to connect things beforehand!
This means you'll need to update the bootloader on your ItsyBitsy M4; it's very fast and painless to do so. Just follow the steps below:
- Connect your ItsyBitsy M4 to a computer with a USB cable. Then make sure the ITSYBOOT drive is visible. If it is not appearing, you might need to double-click the reset button for it to show up on your list of drives.
- Download the UF2 file (below) and copy (or drag) it onto the ITSYBOOT drive.
- After a few seconds, the LEDs should start blinking on the ItsyBitsy M4, and you can reset it then.
- Once completed, the ARCD-D51 drive should show up on your computer, which means you have successfully turned your ItsyBitsy M4 into an Arcade MCU!
If you want to use a Feather M4 to build your arcade, instead of the ItsyBitsy M4, use the bootloader below. Drop it on the Patcher site to see the pinout!
Earlier, we mentioned that configuration data is necessary for the bootloader. You can view the configuration data by dragging and dropping the UF2 file onto our page here: https://microsoft.github.io/uf2/patcher/
When you do this with any of the bootloaders we've provided above, you will see how buttons and the screen are to be connected, such as this example below:
PIN_BTN_A = PIN_SCL
PIN_BTN_B = PIN_D7
PIN_BTN_DOWN = PIN_D12
PIN_BTN_LEFT = PIN_D11
PIN_BTN_MENU = PIN_SDA
PIN_BTN_RIGHT = PIN_D9
PIN_BTN_UP = PIN_D10
PIN_DISPLAY_BL = PIN_A5
PIN_DISPLAY_CS = PIN_A2
PIN_DISPLAY_DC = PIN_A3
PIN_DISPLAY_MISO = PIN_MISO
PIN_DISPLAY_MOSI = PIN_MOSI
PIN_DISPLAY_RST = PIN_A4
PIN_DISPLAY_SCK = PIN_SCK
If you decide to use other pins, just copy the configuration lines you want to change to the text area on top of the page, change the setting, and hit the **Apply my patch** button. This will generate a new bootloader updater, that you can apply just like those we've provided above.