No description
Find a file
Henry Gabryjelski 3b7d78e0bf Change method of FAT generation
More flexible method.

Presumes all files are allocated without
empty clusters between files.

Lots of debug output and (temporary) explicit validation code included.
2022-01-22 13:34:00 -08:00
.github Add CURRENT.UF2 size to file table + small bits 2022-01-22 13:24:22 -08:00
apps move self-update to apps/ fix buld with esp32s2 2021-07-03 15:48:55 +07:00
lib Merge branch 'feature-kuiic' of https://github.com/nxf58843/tinyuf2 into nxf58843-feature-kuiic 2021-12-25 00:48:08 +07:00
ports Change method of FAT generation 2022-01-22 13:34:00 -08:00
src Change method of FAT generation 2022-01-22 13:34:00 -08:00
.gitignore move self-update to apps/ fix buld with esp32s2 2021-07-03 15:48:55 +07:00
.gitmodules add official nxp mcux-sdk 2021-04-29 19:15:48 +07:00
changelog.md changelog for 0.6.0 2021-12-08 16:37:15 +07:00
LICENSE Initial commit 2020-06-03 11:27:51 +07:00
README.md rename ports/esp32s2 to ports/espressif 2021-12-23 15:49:16 +07:00

TinyUF2 Bootloader

Build StatusLicense

This repo is cross-platform UF2 Bootloader projects for MCUs based on TinyUSB

.
├── apps              # Useful applications such as self-update, erase firmware
├── lib               # Sources from 3rd party such as tinyusb, mcu drivers ...
├── ports             # Port/family specific sources
│   ├── espressif
│   │   └── boards/   # Board specific sources
│   │   └── Makefile  # Makefile for this port
│   └── mimxrt10xx         
├── src               # Cross-platform bootloader sources files

Features

TODO more docs later

  • Support ESP32-S2, ESP32-S3, iMXRT10xx, LPC55xx, STM32F3, STM32F4
  • Self update with update file in uf2 format
  • Indicator: LED, RGB
  • Debug log with uart/swd
  • Double tap to enter DFU, reboot to DFU and quick reboot from application

Build and Flash

Following is generic compiling information. Each port may require extra set-up and slight different process e.g esp32s2 require setup IDF.

Compile

To build this for a specific board, we need to change current directory to its port folder

$ cd ports/stm32f4

Then compile with make BOARD=[board_name] all, for example

make BOARD=feather_stm32f405_express all

The required mcu driver submodule if any will be clone automatically if needed.

Flash

flash target will use the default on-board debugger (jlink/cmsisdap/stlink/dfu) to flash the binary, please install those support software in advance. Some board use bootloader/DFU via serial which is required to pass to make command

$ make BOARD=feather_stm32f405_express flash

If you use an external debugger, there is flash-jlink, flash-stlink, flash-pyocd which are mostly like to work out of the box for most of the supported board.

Debug

To compile for debugging add DEBUG=1, this will mostly change the compiler optimization

$ make BOARD=feather_stm32f405_express DEBUG=1 all

Log

Should you have an issue running example and/or submitting an bug report. You could enable TinyUSB built-in debug logging with optional LOG=.

  • LOG=1 will print message from bootloader and error if any from TinyUSB stack.
  • LOG=2 and LOG=3 will print more information with TinyUSB stack events
$ make BOARD=feather_stm32f405_express LOG=1 all

Logger

By default log message is printed via on-board UART which is slow and take lots of CPU time comparing to USB speed. If your board support on-board/external debugger, it would be more efficient to use it for logging. There are 2 protocols:

  • LOGGER=rtt: use Segger RTT protocol
    • Cons: requires jlink as the debugger.
    • Pros: work with most if not all MCUs
    • Software viewer is JLink RTT Viewer/Client/Logger which is bundled with JLink driver package.
  • LOGGER=swo: Use dedicated SWO pin of ARM Cortex SWD debug header.
    • Cons: only work with ARM Cortex MCUs minus M0
    • Pros: should be compatible with more debugger that support SWO.
    • Software viewer should be provided along with your debugger driver.
$ make BOARD=feather_stm32f405_express LOG=2 LOGGER=rtt all
$ make BOARD=feather_stm32f405_express LOG=2 LOGGER=swo all