![Adafruit Feather M4 Express Manual Download Page 169](http://html1.mh-extra.com/html/adafruit/feather-m4-express/feather-m4-express_manual_2845857169.webp)
UF2 Bootloader Details
Adafruit SAMD21 (M0) and SAMD51 (M4) boards feature an improved bootloader that makes it easier than ever to flash
different code onto the microcontroller. This bootloader makes it easy to switch between Microsoft MakeCode,
CircuitPython and Arduino.
Instead of needing drivers or a separate program for flashing (say,
bossac
,
jlink
or
avrdude
), one can simply
drag a
file onto a removable drive
.
The format of the file is a little special. Due to 'operating system woes' you cannot just drag a binary or hex file (trust
us, we tried it, it isn't cross-platform compatible). Instead, the format of the file has extra information to help the
bootloader know where the data goes. The format is called UF2 (USB Flashing Format). Microsoft MakeCode
generates UF2s for flashing and CircuitPython releases are also available as UF2.
You can also create your own UF2s
from binary files using uf2tool, available here.
(https://adafru.it/vPE)
The bootloader is
also BOSSA compatible
, so it can be used with the Arduino IDE which expects a BOSSA bootloader
on ATSAMD-based boards
For more information about UF2,
you can read a bunch more at the MakeCode blog
(https://adafru.it/w5A)
, then
check
out the UF2 file format specification.
(https://adafru.it/vPE)
Visit
Adafruit's fork of the Microsoft UF2-samd bootloader GitHub repository
(https://adafru.it/Beu)
for source code
and
releases of pre-built bootloaders
(https://adafru.it/Bev)
.
Entering Bootloader Mode
The first step to loading new code onto your board is triggering the bootloader. It is easily done by double tapping the
reset button. Once the bootloader is active you will see the small red LED fade in and out and a new drive will appear
on your computer with a name ending in BOOT. For example, feathers show up as FEATHERBOOT, while the new
CircuitPlayground shows up as CPLAYBOOT, Trinket M0 will show up as TRINKETBOOT, and Gemma M0 will show up
as GEMMABOOT
Furthermore, when the bootloader is active, it will change the color of one or more onboard neopixels to indicate the
connection status, red for disconnected and green for connected. If the board is plugged in but still showing that its
disconnected, try a different USB cable. Some cables only provide power with no communication.
For example, here is a Feather M0 Express running a colorful Neopixel swirl. When the reset button is double clicked
(about half second between each click) the NeoPixel will stay green to let you know the bootloader is active. When the
reset button is clicked once, the 'user program' (NeoPixel color swirl) restarts.
This is an information page for advanced users who are curious how we get code from your computer into
your Express board!
The bootloader is not needed when changing your CircuitPython code. Its only needed when upgrading the
CircuitPython core or changing between CircuitPython, Arduino and Microsoft MakeCode.
© Adafruit Industries
https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51
Page 174 of 183