ClearCore Library
UF2 Bootloader

Overview

A bootloader is a small piece of code that allows users to reprogram the application code within that device. ClearCore ships with a UF2 bootloader programmed on the processor. This bootloader allows programming over the USB Serial Port, as well as UF2 format firmware images to/from a USB mass storage drive. The bootloader resides at memory locations 0x0000-0x4000 and is protected from being cleared or overwritten during device programming operations. When compiling and loading your application, the user application should begin at address 0x4000.

Entering the Bootloader

The bootloader can be entered several ways.

Upon entering bootloader mode the LEDs for I/O-0 through I/O-5 will begin blinking in increasing order. Once the USB cable is plugged into a host device, the LEDs for I/O-0 through I/O-5 will change to blinking in descending order and the underglow LEDs will start slowly fading in and out. As a program is loaded by the bootloader, the underglow LEDs will toggle on and off as the flash operation progresses.

The bootloader can be exited by hitting the reset button on the ClearCore.

Note
If there is not a valid program loaded in memory starting at address 0x4000, the ClearCore will stay in bootloader mode.

Loading a program

Using BOSSA

BOSSA is a flash programming utility for the processor family used in the ClearCore. BOSSA provides both UI and command line based interfaces which perform the flash operation and verify the contents of program memory over the USB Serial Port.

To program the ClearCore using the UI based BOSSA.exe:

BOSSA can also extract a binary file with the current contents of program memory or compary the memory against a given binary file.

See http://www.shumatech.com/web/products/bossa for more information and to download.

Using the Mass Storage Device

When the ClearCore is running in the bootloader, you should see a USB disk drive labeled CLEAR_BOOT on your host computer. In that drive should be three files:

Note that the format of the program memory image is in the UF2 format. UF2 is a file format developed by Microsoft for flashing microcontrollers. Included in the ClearCore tools is a Windows program (uf2-builder.exe) that will create a *.UF2 file from the compiled *.bin file that is generated when you compile your application.

To program the ClearCore using the Mass Storage Device:

The ClearCore will automatically reset after the flash operation completes and begin executing the newly loaded program.

See https://github.com/Microsoft/uf2 for more information on the UF2 format and UF2 utilities.