Creating a Bootloader via the Uart

So I was just doing a few tests with the new bootloader and realized it’s already pretty easy to use (with the most recent libDaisy):

To compile an existing program you can add the following two lines to the application Makefile right after SYSTEM_FILES_DIR is set.

LDSCRIPT = $(SYSTEM_FILES_DIR)/STM32H750IB_sram.lds
C_DEFS += -DBOOT_APP

The linker script here will store the program in QSPI, but load it into the AXI SRAM and execute it from there. So program size can be up to 512kB (with no performance penalty).

Alternatively you can use the STM32H750IB_qspi.lds to execute code directly from the external flash chip on the Daisy (This allows for much larger program sizes, but can incur a bit of a performance penalty)


Once it’s compiled (it’ll be clear by the linker output at the end saying 0GB of flash used), you can flash the bootloader itself via DFU with:
make program-boot

To engage the the bootloader you can press the RESET button, and the usr LED will start to pulse. If there is no application on the QSPI, it will do this indefinitely, otherwise it will jump to the program after a few seconds unless the boot button is tapped during that period of time.

Once engaged, the bootloader will search an SD card, or USB drive (connected to the external USB pins) for a valid .bin file, and load it, or will wait for a dfu connection that can be flashed to with Make using:
make program-app


We’ll probably simplify it a bit more by using just a make variable to configure the project (like we did for adding the proper FATFS files), but this does work for now :slight_smile:

We’ll make a wiki page soon once we iron out the process a bit more, but feel free to start messing around with it!

2 Likes