Skip to content

Commit 5c41c2a

Browse files
committed
tweaks and fixes / FWUpdater
1 parent f2b4677 commit 5c41c2a

File tree

22 files changed

+617
-307
lines changed

22 files changed

+617
-307
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020

2121
## ABOUT
2222

23-
- **M5Stack-SD-Updater is an [Platform.io](https://platformio.org/lib/show/2575/M5Stack-SD-Updater)/[Arduino library](https://www.arduinolibraries.info/libraries/m5-stack-sd-updater) for [M5Stack](http://m5stack.com/) or [Odroid-Go](https://forum.odroid.com/viewtopic.php?t=31705) to package your apps on a SD card and load them from a menu such as the [default SD Menu example](https://github.com/tobozo/M5Stack-SD-Updater/tree/master/examples/M5Stack-SD-Menu) of this project or [@lovyan03](https://github.com/lovyan03)'s [Treeview based SD Menu](https://github.com/lovyan03/M5Stack_LovyanLauncher). For a Micropython compatible version of this library, see the [M5Stack_MicroPython custom_sdupdater](https://github.com/ciniml/M5Stack_MicroPython/tree/custom_sdupdater)**
23+
- **M5Stack-SD-Updater is an [Platform.io](https://platformio.org/lib/show/2575/M5Stack-SD-Updater)/[Arduino library](https://www.arduinolibraries.info/libraries/m5-stack-sd-updater) for [M5Stack](http://m5stack.com/) or [Odroid-Go](https://forum.odroid.com/viewtopic.php?t=31705) to package your apps on a SD card and load them from a menu such as the [default SD Menu example](https://github.com/tobozo/M5Stack-SD-Updater/tree/master/examples/M5Stack-SD-Menu) of this project or [@lovyan03](https://github.com/lovyan03)'s [Treeview based SD Menu](https://github.com/lovyan03/M5Stack_LovyanLauncher).
2424

25-
- It is inspired by gamebuino, however it does not use a modified bootloader.
25+
For a Micropython compatible version of this library, see the [M5Stack_MicroPython custom_sdupdater](https://github.com/ciniml/M5Stack_MicroPython/tree/custom_sdupdater)**
26+
27+
For a boot based launcher see the [@bmorcelli's Launcher](https://github.com/bmorcelli/Launcher).
28+
29+
- M5Stack-SD-Updater is inspired by gamebuino, however it does not use a modified bootloader.
2630

2731
- [Video demonstration](https://www.youtube.com/watch?v=myQfeYxyc3o)
2832

examples/GzLauncher/GzLauncher.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#include <ESP32-Chimera-Core.h> // https://github.com/tobozo/ESP32-Chimera-Core
1+
// #include <ESP32-Chimera-Core.h> // https://github.com/tobozo/ESP32-Chimera-Core
2+
#include <M5Unified.h>
23
#define tft M5.Lcd
34

45
#define DEST_FS_USES_SD
@@ -17,7 +18,7 @@ void byteCountSI(int64_t b, char* dest )
1718
const int64_t unit = 1000;
1819
const char* units = "kMGTPE";
1920
if( b < unit ) {
20-
sprintf(dest, "%d B", b);
21+
sprintf(dest, "%lld B", b);
2122
}
2223
int64_t div = unit;
2324
int64_t exp = 0;
@@ -33,7 +34,7 @@ void byteCountIEC( int64_t b, char* dest )
3334
const int64_t unit = 1024;
3435
const char* units = "KMGTPE";
3536
if( b < unit ) {
36-
sprintf(dest, "%d B", b);
37+
sprintf(dest, "%lld B", b);
3738
}
3839
int64_t div = unit;
3940
int64_t exp = 0;

examples/M5Stack-FW-Menu/ReadMe.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## Factory Partition Firmware Launcher
22

3-
/!\ This app launcher depends on special partition schemes that include the factory type and at least 4 OTA (app) partitions.
3+
⚠️ This app launcher depends on special partition schemes that include the `factory` type and at least 4 OTA (`app` type) partitions.
4+
Such partitions are available for M5CoreS3 in the Arduino IDE 3.x.x and superior under the following names:
5+
6+
- partitions-16MB-factory-4-apps
7+
- partitions-16MB-factory-6-apps
48

59
The intent of this launcher is to provide an application manager to hanle firmwares directly from the flash.
610

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Import('env')
2+
import os.path
3+
import sys
4+
5+
# add esp32partitiontool to path
6+
sys.path.append(os.path.abspath( env.PioPlatform().get_package_dir("tool-esp32partitiontool") ))
7+
# import module
8+
from esp32partitiontool import *
9+
# run module
10+
load_pm(env)
11+
12+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# 6 Apps + Factory
2+
# Name, Type, SubType, Offset, Size
3+
nvs, data, nvs, 0x9000, 0x5000
4+
otadata, data, ota, 0xe000, 0x2000
5+
ota_0, 0, ota_0, 0x10000, 0x200000
6+
ota_1, 0, ota_1, 0x210000, 0x200000
7+
ota_2, 0, ota_2, 0x410000, 0x200000
8+
ota_3, 0, ota_3, 0x610000, 0x200000
9+
ota_4, 0, ota_4, 0x810000, 0x200000
10+
ota_5, 0, ota_5, 0xA10000, 0x200000
11+
firmware, app, factory, 0xC10000, 0x0F0000
12+
spiffs, data, spiffs, 0xD00000, 0x2F0000
13+
coredump, data, coredump, 0xFF0000, 0x10000
Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,72 @@
11
[platformio]
2-
default_envs = m5stack-cores3
3-
src_dir = src
2+
default_envs = m5stack-cores3-dev
3+
src_dir = src
44

55

66
[env]
7-
framework = arduino
8-
board = m5stack-core-esp32
9-
build_type = debug
10-
lib_ldf_mode = deep
11-
platform = https://github.com/tasmota/platform-espressif32
12-
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32/releases/download/2.0.9/esp32-2.0.9.zip
13-
board_build.partitions = partitions/partitions-16MB-factory-4-apps.csv
7+
framework = arduino
8+
board = m5stack-core-esp32
9+
build_type = debug
10+
lib_ldf_mode = deep
11+
;platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.01/platform-espressif32.zip
12+
;platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32/releases/download/2.0.14/esp32-2.0.14.zip
13+
board_build.partitions = partitions/partitions-16MB-factory-4-apps.csv
1414
board_upload.flash_size = 16MB
15-
lib_deps =
15+
lib_deps =
1616
SPI
1717
SD
1818
M5Stack-SD-Updater
1919
M5GFX
2020
M5Unified
21-
upload_speed = 1500000
22-
upload_port = /dev/ttyACM0
23-
monitor_speed = 115200
21+
upload_speed = 1500000
22+
upload_port = /dev/ttyACM0
23+
monitor_speed = 115200
2424

2525

2626
[CoreS3]
2727
board = esp32-s3-devkitc-1
28+
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.01/platform-espressif32.zip
29+
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32/releases/download/2.0.14/esp32-2.0.14.zip
2830
;board_upload.maximum_size = 2097152
2931
;board_upload.maximum_size = 3145728
3032
board_build.arduino.memory_type = qio_qspi
3133
build_flags =
3234
${env.build_flags}
3335
-DARDUINO_M5STACK_CORES3
3436
-DBOARD_HAS_PSRAM
35-
-DARDUINO_UDB_MODE=1
37+
-DARDUINO_USB_MODE=1
3638

3739

3840
[env:m5stack-cores3]
3941
extends = CoreS3
40-
42+
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.01/platform-espressif32.zip
43+
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32/releases/download/2.0.14/esp32-2.0.14.zip
4144

4245

4346
[env:m5stack-cores3-dev]
44-
extends = CoreS3
45-
lib_deps =
47+
extends = CoreS3
48+
platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.11.01/platform-espressif32.zip
49+
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32/releases/download/2.0.14/esp32-2.0.14.zip
50+
;platform = espressif32
51+
; platform_packages =
52+
; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-3.0.0-alpha3.zip
53+
; framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.0-alpha3/esp32-arduino-libs-3.0.0-alpha3.zip
54+
board = m5stack-cores3
55+
board_build.partitions = partitions/partitions_16MB_factory_6_apps.csv
56+
lib_deps =
4657
git+https://github.com/M5Stack/M5GFX#develop
4758
git+https://github.com/M5Stack/M5Unified#develop
48-
git+https://github.com/tobozo/M5Stack-SD-Updater#1.2.8
59+
git+https://github.com/tobozo/M5Stack-SD-Updater#1.2.9
60+
61+
62+
[env:build-partition]
63+
platform = espressif32
64+
extra_scripts = partition_manager.py
65+
platform_packages = tool-esp32partitiontool @ https://github.com/tobozo/esp32partitiontool/releases/download/v1.4.1/esp32partitiontool-platformio.zip
66+
;platform_packages = tool-esp32partitiontool @ https://github.com/tobozo/esp32partitiontool/releases/download/v1.4.1/esp32partitiontool-platformio.zip
67+
board_build.partitions = partitions/partitions-16MB-factory-4-apps.csv
68+
board = esp32dev
69+
; lib_deps =
70+
; git+https://github.com/M5Stack/M5GFX#develop
71+
; git+https://github.com/M5Stack/M5Unified#develop
72+
; git+https://github.com/tobozo/M5Stack-SD-Updater#1.2.9

0 commit comments

Comments
 (0)