Alternative firmware update of a STM32 using USB mass storage device class #13731
-
It is possible to add files onto the filesystem when plugging the Pyboard in the PC using USB. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
You could install the TinyUF2 bootloader and upload UF2 files. It has support for several STM32 variants. https://github.com/adafruit/tinyuf2. The MicroPython build for the PyBoard might have to be adapted in some way: start address, reserve space for the bootloader, etc. TinyUF2 is not protected like, say, a SAMD bootloader. It is a secondary bootloader. This has been done for MicroPython on ESP32-xx: #8222 |
Beta Was this translation helpful? Give feedback.
-
@saraverbeecke What Dan said above is probably what you want. For completeness though, the MicroPython project also provides a custom bootloader for stm32 that we need for the pyboard-d series, but you can also install it on most stm32 boards (including the pyboard v1.x). It supports installing firmware from a file on the filesystem. So the workflow is:
I've seen people use this for OTA updates. It supports compressed firmware images and image signing. See https://github.com/micropython/micropython/tree/master/ports/stm32/mboot (and in particular Like Dan said, it requires the main firmware to be mboot-aware (because offsets and start addresses change etc). The PYBV11 board definition has an example of how to do this: https://github.com/micropython/micropython/blob/master/ports/stm32/boards/PYBV11/mpconfigboard.mk |
Beta Was this translation helpful? Give feedback.
@saraverbeecke What Dan said above is probably what you want.
For completeness though, the MicroPython project also provides a custom bootloader for stm32 that we need for the pyboard-d series, but you can also install it on most stm32 boards (including the pyboard v1.x).
It supports installing firmware from a file on the filesystem. So the workflow is:
I've seen people use this for OTA updates. It supports compressed firmware images and image signing. See https://github.com/micropython/micropython/tree/master/ports/stm32/mboot …