From 0a8ce0d56899b02a18ee4260446d31e732fe71e8 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 26 Jun 2020 21:26:06 +1000 Subject: [PATCH] stm32/mboot: Update README to describe WB and littlefs support. Signed-off-by: Damien George --- ports/stm32/mboot/README.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/ports/stm32/mboot/README.md b/ports/stm32/mboot/README.md index 52bbf55675..d8aa6d456f 100644 --- a/ports/stm32/mboot/README.md +++ b/ports/stm32/mboot/README.md @@ -2,11 +2,11 @@ Mboot - MicroPython boot loader =============================== Mboot is a custom bootloader for STM32 MCUs, and currently supports the -STM32F4xx and STM32F7xx families. It can provide a standard USB DFU interface -on either the FS or HS peripherals, as well as a sophisticated, custom I2C +STM32F4xx, STM32F7xx and STM32WBxx families. It can provide a standard USB DFU +interface on either the FS or HS peripherals, as well as a sophisticated, custom I2C interface. It can also load and program firmware in .dfu.gz format from a -filesystem. It can fit in 16k of flash space, but all features enabled requires -32k. +filesystem, either FAT, littlefs 1 or littlfs 2. +It can fit in 16k of flash space, but all features enabled requires 32k. How to use ---------- @@ -63,6 +63,15 @@ How to use #define MBOOT_FSLOAD (1) + and then enable one or more of the following depending on what filesystem + support is required in Mboot (note that the FAT driver is read-only and + quite compact, but littlefs supports both read and write so is rather + large): + + #define MBOOT_VFS_FAT (1) + #define MBOOT_VFS_LFS1 (1) + #define MBOOT_VFS_LFS2 (1) + 2. Build the board's main application firmware as usual. 3. Build mboot via: @@ -133,10 +142,18 @@ are located and what filename to program. The elements to use are: `u32` means unsigned 32-bit little-endian integer. The firmware to load must be a gzip'd DfuSe file (.dfu.gz) and stored within a -FAT formatted partition. +FAT or littlefs formatted partition. The provided fwupdate.py script contains helper functions to call into Mboot -with the correct data, and also to update Mboot itself. +with the correct data, and also to update Mboot itself. For example on PYBD +the following will update the main MicroPython firmware from the file +firmware.dfu.gz stored on the default FAT filesystem: + + import fwupdate + fwupdate.update_mpy('firmware.dfu.gz', 0x80000000, 2 * 1024 * 1024) + +The 0x80000000 value is the address understood by Mboot as the location of +the external SPI flash, configured via `MBOOT_SPIFLASH_ADDR`. Example: Mboot on PYBv1.x -------------------------