GithubHelp home page GithubHelp logo

tobozo / m5stack-sd-updater Goto Github PK

View Code? Open in Web Editor NEW
308.0 21.0 41.0 18.43 MB

๐Ÿ’พ Customizable menu system for M5Stack, M5Unified and ESP32-Chimera-Core - loads apps from the Micro SD card. Easily add you own apps

License: MIT License

C++ 84.99% C 14.89% Makefile 0.12%
m5stack esp32 arduino esp32-arduino arduino-library sd-card m5stickc m5stick esp32-chimera-core fota

m5stack-sd-updater's Introduction

License: MIT Gitter arduino-library-badge PlatformIO Registry

Arduino Build Platformio Build

Library Downloads

M5Stack-SD-Updater


Click to enlarge


ABOUT


๐Ÿญ M5Stack-SD-Menu EXAMPLE SKETCH PREREQUISITES:


Micro SD Card (TF Card) - formatted using FAT32. Max size 32 Gb. SDCard is recommended but the SDUpdater supports other filesystems such as SdFat, SD_MMC and LittleFS (SPIFFS will soon be deprecated).


Make sure you have the following libraries: - they should be installed in: ~/Arduino/libraries

All those are available in the Arduino Library Manager or by performing a manual installation.


๐Ÿฑ UNPACKING THE BINARIES

obsolete For your own lazyness, you can use @micutil's awesome M5Burner and skip the next steps. https://github.com/micutil/M5Burner_Mic/releases ... or customize your own menu and make the installation manually :

1) Open the examples/M5Stack-SD-Update sketch from the Arduino ID Examples menu.


outdated binaries 2) Download the SD-Content ๐Ÿ’พ folder from the release page and unzip it into the root of the SD Card. Then put the SD Card into the M5Stack. This zip file comes preloaded with precompiled apps and the relative meta information for the menu.


2) Compile and flash the M5Stack-SD-Menu.ino example.
This sketch is the menu app. It shoul reside in the root directory of a micro SD card for persistence and also executed once.

Once flashed it will copy itself on OTA2 partition and on the SDCard, then rolled back and executed from the OTA2 partition.

Thanks to @Lovyan03 this self-propagation logic is very convenient: by residing on OTA2 the menu.bin will always be available for fast re-loading.


3) Make application sketches compatible with the SD-Updater Menu .

The snippet of code in the M5Stack-SDLoader-Snippet.ino sketch can be used as a model to make any ESP32 sketch compatible with the SD-Updater menu.

In your sketch, find the line where the core library is included:

   // #include <M5Stack.h>
   // #include <M5Core2.h>
   // #include <LovyanGFX.h>
   // #include <M5GFX.h>
   // #include <ESP32-Chimera-Core.h>
   // #include <M5StickC.h>
   // #include <M5Unified.h>

And add this after the include:

    // #define SDU_ENABLE_GZ // optional: support for gzipped firmwares
    #include <M5StackUpdater.h>

In your setup() function, find the following statements:

    M5.begin();
    // Serial.begin(115200);

And add this after serial is started:

    checkSDUpdater( SD );

Then do whatever you need to do (button init, timer, network signal) in the setup and the loop. Your app will run normally except at boot (e.g. if the Button A is pressed), when it can load the /menu.bin binary from the filesystem, or go on with it application duties.

โš ๏ธTouch UI has no buttons, this raises the problem of detecting a 'pushed' state when the touch is off. As a compensation, an UI lobby will be visible for 2 seconds after every ESP.restart(). The visibility of the lobby can be forced in the setup :

    checkSDUpdater( SD, MENU_BIN, 2000 );

Custom SD-Load scenarios can be achieved using non default values:

    M5.begin();

    checkSDUpdater(
      SD,           // filesystem (SD, SD_MMC, SPIFFS, LittleFS, PSRamFS)
      MENU_BIN,     // path to binary (default = /menu.bin, empty string = rollback only)
      5000          // wait delay, (default=0, will be forced to 2000 upon ESP.restart() or with headless build )
      TFCARD_CS_PIN // optional for SD use only, usually default=4 but your mileage may vary)
    );

Headless setup can bypass onWaitForAction lobby option with their own button/sensor/whatever detection routine.

    Serial.begin( 115200 );

    if(digitalRead(BUTTON_A_PIN) == 0) {
      Serial.println("Will Load menu binary");
      updateFromFS(SD);
      ESP.restart();
    }

Headless setup can also be customized in complex integrations:

    Serial.begin( 115200 );

    SDUCfg.setCSPin( TFCARD_CS_PIN );
    SDUCfg.setFS( &SD );

    // set your own button response trigger

    static int buttonState;

    SDUCfg.setSDUBtnA( []() {
      return buttonState==LOW ? true : false;
    });

    SDUCfg.setSDUBtnPoller( []() {
      buttonState = digitalRead( 16 );
    });

    // Or set your own serial input trigger
    // SDUCfg.setWaitForActionCb( mySerialActionTrigger );

    SDUpdater sdUpdater( &SDUCfg );

    sdUpdater.checkSDUpdaterHeadless( MENU_BIN, 30000 ); // wait 30 seconds for serial input

Use one of following methods to get the app on the filesystem:

  • Have the app copy itself to filesystem using BtnC from the lobby or implement saveSketchToFS( SD, "/my_application.bin" ); from an option inside your app.

  • Manually copy it to the filesystem:

    • In the Arduino IDE menu go to "Sketch / Export Compiled Binary".
    • Rename the file to remove unnecessary additions to the name. The filename will be saved as "filename.ino.esp32.bin". Edit the name so it reads "filename.bin". This is purely for display purposes. The file will work without this change.

โŒพ SD-Updater customizations:

These callback setters are populated by default but only fit the best scenario (M5Stack with display+buttons).

โš ๏ธ If no supported combination of display/buttons exists, it will fall back to headless behaviour and will only accept update/rollback signals from Serial.

As a result, any atypical setup (e.g. headless+LittleFS) should make use of those callback setters:

  SDUCfg.setCSPin       ( TFCARD_CS_PIN );      // const int
  SDUCfg.setFS          ( &FS );                // fs::FS* (SD, SD_MMC, SPIFFS, LittleFS, PSRamFS)
  SDUCfg.setProgressCb  ( myProgress );         // void (*myProgress)( int state, int size )
  SDUCfg.setMessageCb   ( myDrawMsg );          // void (*myDrawMsg)( const String& label )
  SDUCfg.setErrorCb     ( myErrorMsg );         // void (*myErrorMsg)( const String& message, unsigned long delay )
  SDUCfg.setBeforeCb    ( myBeforeCb );         // void (*myBeforeCb)()
  SDUCfg.setAfterCb     ( myAfterCb );          // void (*myAfterCb)()
  SDUCfg.setSplashPageCb( myDrawSplashPage );   // void (*myDrawSplashPage)( const char* msg )
  SDUCfg.setButtonDrawCb( myDrawPushButton );   // void (*myDrawPushButton)( const char* label, uint8_t position, uint16_t outlinecolor, uint16_t fillcolor, uint16_t textcolor )
  SDUCfg.setWaitForActionCb( myActionTrigger ); // int  (*myActionTrigger)( char* labelLoad, char* labelSkip, unsigned long waitdelay )
  SDUCfg.setSDUBtnPoller( myButtonPoller );     // void (*myButtonPoller)()
  SDUCfg.setSDUBtnA( myBtnAPushedcb );          // bool (*myBtnAPushedcb )()
  SDUCfg.setSDUBtnB( myBtnBPushedcb );          // bool (*myBtnBPushedcb )()
  SDUCfg.setSDUBtnC( myBtnCPushedcb );          // bool (*myBtnCPushedcb )()

Set custom action trigger for update, rollback, save and skip lobby options:

  // int myActionTrigger( char* labelLoad,  char* labelSkip, unsigned long waitdelay )
  // return values: 1=update, 0=rollback, -1=skip
  SDUCfg.setWaitForActionCb( myActionTrigger );

  // Or separately if a UI is available:

  static int buttonAState;
  static int buttonBState;
  static int buttonCState;

  SDUCfg.setSDUBtnPoller( []() {
    buttonAState = digitalRead( 32 );
    buttonBState = digitalRead( 33 );
    buttonCState = digitalRead( 13 );
    delay(50);
  });

  SDUCfg.setSDUBtnA( []() {
    return buttonState==LOW ? true : false;
  });

  SDUCfg.setSDUBtnB( []() {
    return buttonState==LOW ? true : false;
  });

  SDUCfg.setSDUBtnC( []() {
    return buttonState==LOW ? true : false;
  });

Example:

static int myActionTrigger( char* labelLoad,  char* labelSkip, char* labelSave, unsigned long waitdelay )
{
  int64_t msec = millis();
  do {
    if( Serial.available() ) {
      String out = Serial.readStringUntil('\n');
      if(      out == "update" )  return SDU_BTNA_MENU; // load "/menu.bin"
      else if( out == "rollback") return SDU_BTNA_ROLLBACK; // rollback to other OTA partition
      else if( out == "save")     return SDU_BTNC_SAVE; // save current sketch to SD card
      else if( out == "skip" )    return SDU_BTNB_SKIP; // do nothing
      else Serial.printf("Ignored command: %s\n", out.c_str() );
    }
  } while( msec > int64_t( millis() ) - int64_t( waitdelay ) );
  return -1;
}

void setup()
{
  Serial.begin(115200);

  SDUCfg.setAppName( "My Application" );         // lobby screen label: application name
  SDUCfg.setAuthorName( "by @myself" );          // lobby screen label: application author
  SDUCfg.setBinFileName( "/MyApplication.bin" ); // if file path to bin is set for this app, it will be checked at boot and created if not exist

  SDUCfg.setWaitForActionCb( myActionTrigger );

  checkSDUpdater( SD );

}

Set custom progress (for filesystem operations):

  // void (*myProgress)( int state, int size )
  SDUCfg.setProgressCb( myProgress );

Set custom notification/warning messages emitter:

  // void (*myDrawMsg)( const String& label )
  SDUCfg.setMessageCb( myDrawMsg );

Set custom error messages emitter:

  // void (*myErrorMsg)( const String& message, unsigned long delay )
  SDUCfg.setErrorCb( myErrorMsg );

Set pre-update actions (e.g. capture display styles):

  // void (*myBeforeCb)()
  SDUCfg.setBeforeCb( myBeforeCb );

Set post-update actions (e.g. restore display styles):

  // void (*myAfterCb)()
  SDUCfg.setAfterCb( myAfterCb );

Set lobby welcome message (e.g. draw UI welcome screen):

  // void (*myDrawSplashPage)( const char* msg )
  SDUCfg.setSplashPageCb( myDrawSplashPage );

Set buttons drawing function (useful with Touch displays)

  // void (*myDrawPushButton)( const char* label, uint8_t buttonIndex, uint16_t outlinecolor, uint16_t fillcolor, uint16_t textcolor )
  SDUCfg.setButtonDrawCb( myDrawPushButton );

Set buttons state polling function (typically M5.update()

  // void(*myButtonPollCb)();
  SDUCfg.setSDUBtnPoller( myButtonPollCb );

Set each button state getter function, it must return true when the state is "pushed".

  SDUCfg.setSDUBtnA( myBtnAPushedcb ); // bool (*myBtnAPushedcb )()
  SDUCfg.setSDUBtnB( myBtnBPushedcb ); // bool (*myBtnBPushedcb )()
  SDUCfg.setSDUBtnC( myBtnCPushedcb ); // bool (*myBtnCPushedcb )()


๐Ÿ“š SD-Menu loading usage:

Default behaviour: when an app is loaded in memory, booting the M5Stack with the Button A pushed will load and run menu.bin from the filesystem (or from OTA2 if using persistence).

Custom behaviour: the Button A push event car be replaced by any other means (Touch, Serial, Network, Sensor).

Ideally that SD-Menu application should list all available apps on the sdcard and provide means to load them on demand.

For example in the SD-Menu application provided with the examples of this repository, booting the M5Stack with the Button A pushed will power it off.

The built-in Download utility of the SD-Menu is has been moved to the AppStore.ino example, as a result the menu.bin size is reduced and loads faster. This is still being reworked though.

Along with the default SD-Menu example of this repository, some artwork/credits can be added for every uploaded binary. The default SD-Menu application will scan for these file types:

  • .bin compiled application binary

  • .jpg image/icon (max 100x100)

  • .json file with dimensions descriptions:

{"width":120,"height":120,"authorName":"tobozo","projectURL":"http://short.url","credits":"** http://very.very.long.url ~~"}


โš ๏ธ The jpg/json file names must match the bin file name, case matters! jpg/json meta files are optional but must both be set if provided. The value for "credits" JSON property will be scrolled on the top of the screen while the value for projectURL JSON property will be rendered as a QR Code in the info window. It is better provide a short URL for projectURL so the resulting QR Code has more error correction.



๐Ÿšซ LIMITATIONS:

  • SPIFFS/LittleFS libraries limit their file names (including path) to 32 chars but 16 is recommended as it is also printed in the lobby screen.
  • Long file names will eventually get covered by the jpg image, better stay under 16 chars (not including the extension).
  • Short file names may be treated as 8.3 (e.g 2048.bin becomes 2048.BIN).
  • FAT specifications prevent having more than 512 files on the SD Card, but this menu is limited to 256 Items anyway.

๐Ÿ”˜ OPTIONAL:

  • The lobby screen at boot can be customized using SDUCfg.setAppName, SDUCfg.setAuthorName and SDUCfg.setBinFileName. When set, the app name and the binary path will be visible on the lobby screen, and an extra button Button C labelled Save is added to the UI. Pushing this button while the M5Stack is booting will create or overwrite the sketch binary to the SD Card. This can be triggered manually by using saveSketchToFS(SD, fileName, TFCARD_CS_PIN).
  SDUCfg.setAppName( "My Application" ); // lobby screen label: application name
  SDUCfg.setBinFileName( "/MyApplication.bin" ); // if file path to bin is set for this app, it will be checked at boot and created if not exist
  • It can also be disabled (although this requires to use the early callback setters):
#define SDU_HEADLESS
#include "M5StackUpdater.h"
  • Although not extensively tested, the default binary name to be loaded (/menu.bin) can be changed at compilation time by defining the MENU_BIN constant:
#define MENU_BIN "/my_custom_launcher.bin"
#include "M5StackUpdater.h"
  • Gzipped firmwares are supported when SDU_ENABLE_GZ macro is defined or when ESP32-targz.h was previously included. The firmware must have the .gz. extension and be a valid gzip file to trigger the decompression.
#define SDU_ENABLE_GZ // enable support for gzipped firmwares
#include "M5StackUpdater.h"

void setup()
{
  checkSDUpdater( SD, "/menu.gz", 2000 );
}
  • The JoyPSP and M5Stack-Faces Controls for M5Stack SD Menu necessary code are now disabled in the menu example but the code stays here and can be used as a boilerplate for any other two-wires input device.

โš ๏ธ KNOWN ISSUES

  • SD was not declared in this scope: make sure your #include <SD.h> is made before including <M5StackUpdater.h>
  • Serial message [ERROR] No filesystem selected or [ERROR] No valid filesystem selected: try SDUCfg.setFS( &SD ) prior to calling the SDUpdater.



๐Ÿญ Factory Partition

Abuse the OTA partition scheme and store up to 5 applications on the flash, plus the firmware loader.

โš ๏ธ This scenario uses a special firmware loader M5Stack-FW-Menu, a custom partition scheme, and a different integration of M5Stack-SD-Updater in the loadable applications.

Although it can work without the SD Card, M5Stack-FW-Menu can still act as a low profile replacement for the classic SD Card /menu.bin, and load binaries from the SD Card or other supported filesystems.

Requirements:

  • Flash size must be 8MB or 16MB
  • custom partitions.csv must have more than 2 OTA partitions followed by one factory partition (see annotated example below)
  • loadable applications and firmware loader must share the same custom partitions scheme at compilation
  • SDUCfg.rollBackToFactory = true; must be set in all loadable applications (see Detect factory support)

Custom partition scheme annotated example:

# 6 Apps + Factory
# Name,   Type, SubType,    Offset,     Size
nvs,      data, nvs,        0x9000,   0x5000
otadata,  data, ota,        0xe000,   0x2000
ota_0,    0,    ota_0,     0x10000, 0x200000  ,<< Default partition for flashing (UART, 2MB)
ota_1,    0,    ota_1,    0x210000, 0x200000  ,<< Default partition for flashing (OTA, 2MB)
ota_2,    0,    ota_2,    0x410000, 0x200000  ,<< Application (2MB)
ota_3,    0,    ota_3,    0x610000, 0x200000  ,<< Application (2MB)
ota_4,    0,    ota_4,    0x810000, 0x200000  ,<< Application (2MB)
ota_5,    0,    ota_5,    0xA10000, 0x200000  ,<< Application (2MB)
firmware, app,  factory,  0xC10000, 0x0F0000  ,<< Factory partition holding the firmware menu (960KB)
spiffs,   data, spiffs,   0xD00000, 0x2F0000  ,<< SPIFFS (2MB)
coredump, data, coredump, 0xFF0000,  0x10000

Quick Start:

Then for every other app you want to store on the flash:

  • Set the same custom partition scheme as M5Stack-FW-Menu
  • Add SDUCfg.rollBackToFactory = true; and second argument must be empty e.g. checkSDUpdater( SD, "", 5000, TFCARD_CS_PIN )
  • Compile your app
  • Copy the binary to the SD Card (e.g. copy the bin manually or use the Save SD option from the app's SD-Updater lobby)
  • Use FW Menu option from the app's SD-Updater lobby (note: it should load the firmware loader, not the /menu.bin from the SD Card)
  • Use the firmware loader menu Manage Partitions/Add Firmware to copy the recently added app to one of the available slots

Note: the firmware loader can copy applications from any filesystem (SD, SD_MMC, SPIFFS, LittleFS, FFat).

Detect factory support

#if M5_SD_UPDATER_VERSION_INT >= VERSION_VAL(1, 2, 8)
// New SD Updater support, requires version >=1.2.8 of https://github.com/tobozo/M5Stack-SD-Updater/
if( Flash::hasFactoryApp() ) {
  SDUCfg.rollBackToFactory = true;
  SDUCfg.setLabelMenu("FW Menu");
  SDUCfg.setLabelRollback("Save FW");
  checkFWUpdater( 5000 );
} else
#endif
{
  checkSDUpdater( SD, MENU_BIN, 5000, TFCARD_CS_PIN );
}

๐Ÿ›ฃ ROADMAP:

  • Completely detach the UI/Display/Touch/Buttons from the codebase
  • Support gzipped binaries - Migrate Downloader / WiFiManager to external apps
  • esp-idf support
  • Contributors welcome!

#๏ธโƒฃ REFERENCES:


๐ŸŽฌ Video demonstration https://youtu.be/myQfeYxyc3o
๐ŸŽฌ Video demo of Pacman + sound Source
๐ŸŽฌ Video demo of NyanCat Source
๐ŸŽ“ Macsbug's article on M5Stack SD-Updater ๐Ÿ‡ฏ๐Ÿ‡ต ๐Ÿ‡ฌ๐Ÿ‡ง (google translate)

๐Ÿ™ CREDITS:


๐Ÿ‘ M5Stack M5Stack https://github.com/m5stack/M5Stack
๐Ÿ‘ M5StackSam Tom Such https://github.com/tomsuch/M5StackSAM
๐Ÿ‘ ArduinoJSON Benoรฎt Blanchon https://github.com/bblanchon/ArduinoJson/
๐Ÿ‘ QRCode Richard Moore https://github.com/ricmoo/qrcode
๐Ÿ‘ @Reaper7 Reaper7 https://github.com/reaper7
๐Ÿ‘ @PartsandCircuits PartsandCircuits https://github.com/PartsandCircuits
๐Ÿ‘ @lovyan03 ใ‚‰ใณใ‚„ใ‚“ https://github.com/lovyan03
๐Ÿ‘ @matsumo Matsumo https://github.com/matsumo
๐Ÿ‘ @riraosan Riraosan https://github.com/riraosan
๐Ÿ‘ @ockernuts ockernuts https://github.com/ockernuts

m5stack-sd-updater's People

Contributors

harada-hiroshi avatar lovyan03 avatar matsumo avatar partsandcircuits avatar reaper7 avatar riraosan avatar tobozo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

m5stack-sd-updater's Issues

BootLoop

All components are the latest. Cmpilation via VisualMicro. Arduino IDE - same result.
Result:
`**Opening port
Port open
Guru Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1)
Core 1 register dump:
PC : 0x400e3b99 PS : 0x00060b34 A0 : 0x800e6c59 A1 : 0x3ffe7d20
A2 : 0x3f4089b8 A3 : 0x000000bb A4 : 0x3f408a14 A5 : 0x3f4088d8
A6 : 0x00000005 A7 : 0x00000000 A8 : 0x800e3b99 A9 : 0x3ffe7cd0
A10 : 0x400f7174 A11 : 0x3ffcc110 A12 : 0x3f40683c A13 : 0x00000000
A14 : 0x00000001 A15 : 0x00000005 SAR : 0x00000004 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffc

Backtrace: 0x400e3b99:0x3ffe7d20 0x400e6c56:0x3ffe7d50 0x400838b3:0x3ffe7d80 0x40083901:0x3ffe7da0 0x40007c31:0x3ffe7dc0 0x4000073d:0x3ffe7e30

Core 0 register dump:
PC : 0x400e6a04 PS : 0x00050034 A0 : 0x00000000 A1 : 0x3ffde620
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x00000000 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x00000000 A9 : 0x3ff4808c
A10 : 0x38004800 A11 : 0x00000000 A12 : 0x00060023 A13 : 0x3ffde6b4
A14 : 0x00000000 A15 : 0x00000001 SAR : 0x00000000 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x400e6a04:0x3ffde620 0x7ffffffd:0x3ffde640

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:952
load:0x40078000,len:6084
load:0x40080000,len:7936
entry 0x40080310
E (0) boot: Assert failed in esp_dport_access_int_init, /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/dport_access.c:187 (res == pdTRUE)**
`

Safe load from SD Card

I really like this project, in my opinion, can be an interesting evolution sign all binaries with a private key and check using a public hardcoded in the firmware.

In some weeks I will try to make it work in that way, someone interested in share more ideas for a safer implementation?

Ciao!

some issues

Hi,
compiling, flashing works so far,
but when I enter an SD app I can't go back to menu.bin
I see, Loading menu.bin at LCD
and serial monitor shows a downloading unitl about 78%:
percent = 70
percent = 71
percent = 72
percent = 73
percent = 74
percent = 75
percent = 76
percent = 77
percent = 78
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

then a reboot occurs and previous App starts

the chess app ends up in an endless loop with:

st:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1496
load:0x40078000,len:8596
load:0x40080400,len:6980
entry 0x400806f4
๏ฟฝ

Thanks for help
grooves

M5Stack-SD-Menu compilation error

I try compile new example M5Stack-SD-Menu
but I got errors:

In file included from C:\PROGRAMY\arduino_projekty\libraries\M5Stack-SD-Updater\examples\M5Stack-SD-Menu\M5Stack-SD-Menu.ino:75:0:

sketch\joyPSP.h: In function 'void handleJoyPad()':

joyPSP.h:76:14: error: 'class M5SAM' has no member named 'setListID'

       M5Menu.setListID(MenuID);

              ^

joyPSP.h:90:14: error: 'class M5SAM' has no member named 'setListID'

       M5Menu.setListID(MenuID);

              ^

C:\PROGRAMY\arduino_projekty\libraries\M5Stack-SD-Updater\examples\M5Stack-SD-Menu\M5Stack-SD-Menu.ino: In function 'void renderIcon(uint16_t)':

M5Stack-SD-Menu:191:30: error: cannot convert 'FileInfo' to 'uint16_t {aka short unsigned int}' for argument '1' to 'void renderIcon(uint16_t)'

   renderIcon(fileInfo[MenuID]);

                              ^

exit status 1
'class M5SAM' has no member named 'setListID'

when I comment out //#define USE_PSP_JOY true
then got:

C:\tmp\arduino_modified_sketch_208768\M5Stack-SD-Menu.ino: In function 'void renderIcon(uint16_t)':

M5Stack-SD-Menu:191:30: error: cannot convert 'FileInfo' to 'uint16_t {aka short unsigned int}' for argument '1' to 'void renderIcon(uint16_t)'

   renderIcon(fileInfo[MenuID]);

                              ^

exit status 1
cannot convert 'FileInfo' to 'uint16_t {aka short unsigned int}' for argument '1' to 'void renderIcon(uint16_t)'

ESP8266 version?

Hello,
great achievement!
Could it be implemented for ESP8266 also?

[vMicro] VisualMicro Compilation Errors

I use VisualMicro plugin (visualmicro.com). Previous version compiled without any problems.
With the new one I got:

M5Stack-SD-Menu.ino: 80:35: error: 'JSONMeta' has not been declared
void getMeta(String metaFileName, JSONMeta &jsonMeta)
M5Stack-SD-Menu.ino: 82:17: error: variable or field 'renderIcon' declared void
void renderIcon(FileInfo &fileInfo)
M5Stack-SD-Menu.ino: 82:17: error: 'FileInfo' was not declared in this scope
M5Stack-SD-Menu.ino: 82:27: error: 'fileInfo' was not declared in this scope
void renderIcon(FileInfo &fileInfo)
M5Stack-SD-Menu.ino: 84:17: error: variable or field 'renderMeta' declared void
void renderMeta(JSONMeta &jsonMeta)
M5Stack-SD-Menu.ino: 84:17: error: 'JSONMeta' was not declared in this scope
M5Stack-SD-Menu.ino: 84:27: error: 'jsonMeta' was not declared in this scope
void renderMeta(JSONMeta &jsonMeta)

In Arduino IDE another problem:

D:\Arduino\libraries\QRCode\src\qrcode.c:37:0: error: ignoring #pragma mark [-Werror=unknown-pragmas]
#pragma mark - Error Correction Lookup tables
^
D:\Arduino\libraries\QRCode\src\qrcode.c:100:0: error: ignoring #pragma mark [-Werror=unknown-pragmas]
#pragma mark - Mode testing and conversion
^
D:\Arduino\libraries\QRCode\src\qrcode.c:139:0: error: ignoring #pragma mark [-Werror=unknown-pragmas]
#pragma mark - Counting
^
D:\Arduino\libraries\QRCode\src\qrcode.c:166:0: error: ignoring #pragma mark [-Werror=unknown-pragmas]
#pragma mark - BitBucket
^
D:\Arduino\libraries\QRCode\src\qrcode.c:250:0: error: ignoring #pragma mark [-Werror=unknown-pragmas]
#pragma mark - Drawing Patterns
^
D:\Arduino\libraries\QRCode\src\qrcode.c:473:0: error: ignoring #pragma mark [-Werror=unknown-pragmas]
#pragma mark - Penalty Calculation
^
D:\Arduino\libraries\QRCode\src\qrcode.c:573:0: error: ignoring #pragma mark [-Werror=unknown-pragmas]
#pragma mark - Reed-Solomon Generator
^
D:\Arduino\libraries\QRCode\src\qrcode.c:627:0: error: ignoring #pragma mark [-Werror=unknown-pragmas]
#pragma mark - QrCode
^
D:\Arduino\libraries\QRCode\src\qrcode.c:768:0: error: ignoring #pragma mark [-Werror=unknown-pragmas]
#pragma mark - Public QRCode functions

Compile error of %s augument

Hello,

When I compile version 0.4.1 with AuruinoIDE, get the following error.

Arduino\libraries\M5Stack-SD-Updater\src\M5StackUpdater.cpp:212:91: error: format '%s' expects argument of type 'char*', but argument 3 has type 'const __FlashStringHelper*' [-Werror=format=]

 Serial.printf( "[M5Stack-SD-Updater] SD Updater version: %s\n", M5_SD_UPDATER_VERSION );

Casting to .char * will eliminate the error. Is this correct?
Serial.printf( "[M5Stack-SD-Updater] SD Updater version: %s\n", (char*)M5_SD_UPDATER_VERSION );

Thank you.

menu loop after pressing keys

We have problem with current master M5Stack-SD-Menu example.
Sketch starts normally but after pressing for e.g down key then menu falls into a loop.
HIDSignal hidState = getControls(); still return last pressed key
because we do not call anywhere M5.update(); and wasPressed() is not refreshed.
I think M5.update(); should be inserted after each event like this:

  HIDSignal hidState = getControls();

  switch(hidState) {
    case UI_DOWN:
      menuDown();
      M5.update();   //additional update
    break;
    case UI_UP:
      menuUp();
      M5.update();  //additional update
    break;
    case UI_INFO:
      if(!inInfoMenu) {
        menuInfo();
      } else {
        menuMeta();
      }
      M5.update();  //additional update
    break;
    case UI_LOAD:
      updateFromFS(SD, fileInfo[ M5Menu.getListID() ].fileName);
      ESP.restart();
    break;
    default:
    case UI_INERT:
      if(inInfoMenu) {
        // !! scrolling text also prevents sleep mode !!
        renderScroll(fileInfo[MenuID].jsonMeta.projectURL, 0, 5, 320);
      }
      M5.update();
    break;
  }

or maybe moved to controls.h HIDSignal getControls() { ...

error 'StaticJsonBuffer' was not declared in this scope

Got this error with the Current library ArduinoJSON v 6.0.0-beta from the library manager in the Arduino IDE.

error: 'StaticJsonBuffer' was not declared in this scope

Downdating to the previous version ArduinoJSON version 5.13.2 solved it.

error:'class UpdateClass' has no member named 'onProgress'

Error compiling msg:
....\Documents\Arduino\libraries\M5Stack_SD_Updater\src\M5StackUpdater.cpp: In member function 'void SDUpdater::performUpdate(Stream&, size_t, String)':
....\Documents\Arduino\libraries\M5Stack_SD_Updater\src\M5StackUpdater.cpp:56:11: error: 'class UpdateClass' has no member named 'onProgress'

Update.onProgress(M5SDMenuProgress);

How to fix it please?

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.