GithubHelp home page GithubHelp logo

jbkim / tinyuf2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adafruit/tinyuf2

0.0 0.0 0.0 36.31 MB

UF2 bootloader based on TinyUSB for embedded devices such as ESP32S2, STM32F4 and iMX RT10xx

License: MIT License

C++ 3.67% Python 0.46% C 82.33% PHP 12.12% Assembly 0.12% Makefile 0.52% CMake 0.78%

tinyuf2's Introduction

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

Supported features are

  • Double tap to enter DFU, reboot to DFU and quick reboot from application
  • DFU with MassStorage (MSC)
  • Self update with uf2 file
  • Indicator: LED, RGB, TFT
  • Debug log with uart/swd

Not all features are implemented for all MCUs, following is supported MCUs and its feature

MCU MSC Double Reset Self-update Write Protection Neopixel TFT
ESP32 S2/S3 Need RC
K32L2
LPC55
iMXRT
STM32F3
STM32F4

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

Firstly we need to get all of submodule dependency for our board e.g mcu driver with get-deps target. You only need to do this once for each mcu family

make BOARD=feather_stm32f405_express get-deps

Then compile with all target:

make BOARD=feather_stm32f405_express all

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

tinyuf2's People

Contributors

bill88t avatar ccrome avatar charkster avatar circuitart avatar dronecz avatar dumam avatar durapensa avatar fabaff avatar gsteiert avatar hathach avatar henrygab avatar jamesjnadeau avatar jepler avatar karlk90 avatar ladyada avatar lyusupov avatar m-mcgowan avatar makermelissa avatar mariopesch avatar neradoc avatar nxf58843 avatar oliver-joos avatar petejohanson avatar skieast avatar sukuwc avatar tannewt avatar tirtharajsinha avatar unexpectedmaker avatar wind-stormger avatar zvecr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.