Skip to content

Instantly share code, notes, and snippets.

@tobozo
Last active Apr 18, 2019
Embed
What would you like to do?
SD-Updater

Maker information

My online name is tobozo, I'm french, soon 50 and working as a web developer but I'm more of a self-taught and professional beginner profile. My hobbies are electronics and organic development, I like creating/solving problems and contributing to open source projects while learning new stuff.

Product Information

M5Stack-SD-Updater ( https://github.com/tobozo/M5Stack-SD-Updater ) is an Platform.io/Arduino library for M5Stack amd Odroid GO to package your apps on a SD card; and load them from a launcher menu such as the default SD Launcher/downloader example of this project or @lovyan03's Treeview based SD Launcher.

Click to enlarge

The SD-Updater library is the essential component that will make an existing sketch able to go back a launcher menu. It makes a strong use of the Updater.h library provided with esp32-core.

The other component, a menu launcher, can also act as a downloader (a la Windows Update).

Big thanks to external github contributors ( @lovyan03, @Reaper7, @partsandcirtuits ) for providing feedback and ideas.

Features

  • SD-Updater Library

    • Requires a precompiled "menu.bin" app bootable from the SD Card, OTA0 or OTA1 if rollback available
    • Remembers preferred launcher (LovyanLauncher or TobozoLauncher, or any other)
  • SD-Updater Launcher Menu

    • List up to 128 binaries in a paginated fashion
    • Provide as much credit as possible to the developers (QR Code, URLs, nickname, etc)
    • Load a binary from the SD, or from OTA0 if rollback available
    • Maintain a relationship with the M5Stack appstore (platform code soon to be released)
    • Bulk update all binaries from appstore
    • Update binaries separately (suggested by @lovyan03)
    • Select a preferred launcher (LovyanLauncher or TobozoLauncher, or any other)
    • Perform SHA256 integrity checksum for downloaded files
    • Provide basic TLS certificates management
  • Appstore Registry

Demos

Purpose

Historically, the idea for the M5Stack-SD-Updater came out from an old similar project I did for the OLEDiTREK of my friend Hayri, which fitted on a much smaller board (Atmega328 + SSD1306) while replicating the sd-loadable features from gamebuino and arduboy.

Flaws

  • The SD-Updater is not part of the bootloader, including the library is still necessary
  • Partition scheme changes can break the update (e.g. loading a binary produced by esp-idf)
  • Creates a low security situation where any binary can be loaded

Message to M5Stack

  • You are awesome!
  • Suggestion: please add a capacitive touch interface to the display
  • Suggestion: please connect both TFT MOSI and TFT MISO to the M5 so we can make nicer screenshots
  • Suggestion: please create an external psram module for older M5 models

How to install and use

  • Developer: get the library from the library manager, and include it in your sketch Japanese tutorial
  • M5Stack user : use @micutils's M5Burner to burn the menu.bin, then use the downloader

https://github.com/micutil/M5Burner_Mic/releases

e-presence

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment