@@ -2,11 +2,11 @@ Mboot - MicroPython boot loader
22===============================
33
44Mboot is a custom bootloader for STM32 MCUs, and currently supports the
5- STM32F4xx and STM32F7xx families. It can provide a standard USB DFU interface
6- on either the FS or HS peripherals, as well as a sophisticated, custom I2C
5+ STM32F4xx, STM32F7xx and STM32WBxx families. It can provide a standard USB DFU
6+ interface on either the FS or HS peripherals, as well as a sophisticated, custom I2C
77interface. It can also load and program firmware in .dfu.gz format from a
8- filesystem. It can fit in 16k of flash space, but all features enabled requires
9- 32k.
8+ filesystem, either FAT, littlefs 1 or littlfs 2.
9+ It can fit in 16k of flash space, but all features enabled requires 32k.
1010
1111How to use
1212----------
@@ -63,6 +63,15 @@ How to use
6363
6464 #define MBOOT_FSLOAD (1)
6565
66+ and then enable one or more of the following depending on what filesystem
67+ support is required in Mboot (note that the FAT driver is read-only and
68+ quite compact, but littlefs supports both read and write so is rather
69+ large):
70+
71+ #define MBOOT_VFS_FAT (1)
72+ #define MBOOT_VFS_LFS1 (1)
73+ #define MBOOT_VFS_LFS2 (1)
74+
66752 . Build the board's main application firmware as usual.
6776
68773 . Build mboot via:
@@ -133,10 +142,18 @@ are located and what filename to program. The elements to use are:
133142` u32 ` means unsigned 32-bit little-endian integer.
134143
135144The firmware to load must be a gzip'd DfuSe file (.dfu.gz) and stored within a
136- FAT formatted partition.
145+ FAT or littlefs formatted partition.
137146
138147The provided fwupdate.py script contains helper functions to call into Mboot
139- with the correct data, and also to update Mboot itself.
148+ with the correct data, and also to update Mboot itself. For example on PYBD
149+ the following will update the main MicroPython firmware from the file
150+ firmware.dfu.gz stored on the default FAT filesystem:
151+
152+ import fwupdate
153+ fwupdate.update_mpy('firmware.dfu.gz', 0x80000000, 2 * 1024 * 1024)
154+
155+ The 0x80000000 value is the address understood by Mboot as the location of
156+ the external SPI flash, configured via ` MBOOT_SPIFLASH_ADDR ` .
140157
141158Example: Mboot on PYBv1.x
142159-------------------------
0 commit comments