Skip to content

Commit

Permalink
M5CoreS3 & Tough compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorcelli committed Jul 3, 2024
1 parent aa8c5f9 commit 5054858
Show file tree
Hide file tree
Showing 17 changed files with 98 additions and 7 deletions.
Binary file modified Launcher/Launcher_2.0_C.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_Cardputer.bin
Binary file not shown.
Binary file added Launcher/Launcher_2.0_CoreS3.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_core2.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_core_16Mb.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_cplus1_1.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_cplus2.bin
Binary file not shown.
19 changes: 19 additions & 0 deletions Launcher/mainfest_M5CoreS3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "M5Core2",
"builds": [
{
"chipFamily": "ESP32",
"improv": false,
"parts": [
{ "path": "Launcher_2.0_CoreS3.bin", "offset": 0 }
]
},
{
"chipFamily": "ESP8266",
"parts": [
{ "path": "esp8266.bin", "offset": 0 }
]
}
]
}

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Sourcecode will be released in the future..
* 2.?.? (Future):
* [ ] Save more SSIDs and pwd, connect automatically if is a known network (config.conf)
* [ ] change default folder for download (config.conf)
* [ ] Adjust size of Options menu to allow some more letters
* [ ] Allow M5Launcher to be updated through OTA
* 2.1.2:
* [x] Fixed OTA error message
* [x] Increased Options Menu width and reduced menu flickering
Expand Down
7 changes: 5 additions & 2 deletions flash0.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,15 @@ <h1 align="center">-= M5 Launcher =-</h1>
<li>
<label><input type="radio" name="type" value="M5stickCP2" /> FLASH to M5stickC Plus2</label>
</li>
<li>
<label><input type="radio" name="type" value="M5Core" /> FLASH to M5Core Devices 16Mb</label>
</li>
<li>
<label><input type="radio" name="type" value="M5Core2" /> FLASH to M5Core2 & Tough 16Mb</label>
</li>
<li>
<label><input type="radio" name="type" value="M5Core" /> FLASH to M5Core Devices 16Mb</label>
</li>
<label><input type="radio" name="type" value="M5CoreS3" /> FLASH to M5CoreS3 Devices 16Mb</label>
</li>
</ul>
<p class="button-row" align="center">
<esp-web-install-button class="invisible"></esp-web-install-button>
Expand Down
1 change: 1 addition & 0 deletions merge_files.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
esptool --chip esp32s3 merge_bin --output Launcher/Launcher_2.0_Cardputer.bin 0x0 .pio/build/m5stack-cardputer/bootloader.bin 0x8000 .pio/build/m5stack-cardputer/partitions.bin 0x9000 support_files/UiFlow2_nvs.bin 0x10000 .pio/build/m5stack-cardputer/firmware.bin
esptool --chip esp32s3 merge_bin --output Launcher/Launcher_2.0_CoreS3.bin 0x0 .pio/build/m5stack-cores3/bootloader.bin 0x8000 .pio/build/m5stack-cores3/partitions.bin 0x9000 support_files/UiFlow2_nvs.bin 0x10000 .pio/build/m5stack-cores3/firmware.bin
esptool --chip esp32 merge_bin --output Launcher/Launcher_2.0_cplus2.bin 0x1000 .pio/build/m5stack-cplus2/bootloader.bin 0x8000 .pio/build/m5stack-cplus2/partitions.bin 0x9000 support_files/UiFlow2_nvs.bin 0x10000 .pio/build/m5stack-cplus2/firmware.bin
esptool --chip esp32 merge_bin --output Launcher/Launcher_2.0_cplus1_1.bin 0x1000 .pio/build/m5stack-cplus1_1/bootloader.bin 0x8000 .pio/build/m5stack-cplus1_1/partitions.bin 0x9000 support_files/UiFlow2_nvs.bin 0x10000 .pio/build/m5stack-cplus1_1/firmware.bin
esptool --chip esp32 merge_bin --output Launcher/Launcher_2.0_C.bin 0x1000 .pio/build/m5stack-c/bootloader.bin 0x8000 .pio/build/m5stack-c/partitions.bin 0x9000 support_files/UiFlow2_nvs.bin 0x10000 .pio/build/m5stack-c/firmware.bin
Expand Down
1 change: 1 addition & 0 deletions merge_files.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
esptool.py --chip esp32s3 merge_bin --output Launcher/Launcher_2.0_Cardputer.bin 0x0 .pio/build/m5stack-cardputer/bootloader.bin 0x8000 .pio/build/m5stack-cardputer/partitions.bin 0x9000 support_files/UiFlow2_nvs.bin 0x10000 .pio/build/m5stack-cardputer/firmware.bin
esptool.py --chip esp32s3 merge_bin --output Launcher/Launcher_2.0_CoreS3.bin 0x0 .pio/build/m5stack-cores3/bootloader.bin 0x8000 .pio/build/m5stack-cores3/partitions.bin 0x9000 support_files/UiFlow2_nvs.bin 0x10000 .pio/build/m5stack-cores3/firmware.bin
esptool.py --chip esp32 merge_bin --output Launcher/Launcher_2.0_cplus2.bin 0x1000 .pio/build/m5stack-cplus2/bootloader.bin 0x8000 .pio/build/m5stack-cplus2/partitions.bin 0x9000 support_files/UiFlow2_nvs.bin 0x10000 .pio/build/m5stack-cplus2/firmware.bin
esptool.py --chip esp32 merge_bin --output Launcher/Launcher_2.0_cplus1_1.bin 0x1000 .pio/build/m5stack-cplus1_1/bootloader.bin 0x8000 .pio/build/m5stack-cplus1_1/partitions.bin 0x9000 support_files/UiFlow2_nvs.bin 0x10000 .pio/build/m5stack-cplus1_1/firmware.bin
esptool.py --chip esp32 merge_bin --output Launcher/Launcher_2.0_C.bin 0x1000 .pio/build/m5stack-c/bootloader.bin 0x8000 .pio/build/m5stack-c/partitions.bin 0x9000 support_files/UiFlow2_nvs.bin 0x10000 .pio/build/m5stack-c/firmware.bin
Expand Down
65 changes: 64 additions & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ default_envs =
m5stack-cplus2
m5stack-cardputer
m5stack-c
m5stack-cores3

[common]
build_flags =
-DLAUNCHER='"2.1.2"'
-DMAXFILES=256
-DEEPROMSIZE=128 ;512
-DEEPROMSIZE=128
-DLH=8
-DLW=6

Expand Down Expand Up @@ -445,5 +446,67 @@ build_flags =
-DSDCARD_MISO=19
-DSDCARD_MOSI=23

lib_deps =
${common.lib_deps}

[env:m5stack-cores3]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.1/platform-espressif32.zip
board = m5stack-cores3
framework = arduino
extra_scripts = pre:support_files/nvs_script.py
board_build.partitions = custom_16Mb.csv
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
build_flags =
${common.build_flags}
-DCORE_DEBUG_LEVEL=5
-DBOARD_HAS_PSRAM

-DCORE3=1
-DROTATION=1
-DHAS_BTN=0
-DSEL_BTN=0
-DUP_BTN=0
-DDW_BTN=0
-DBTN_ALIAS='"Sel"'
-DHAS_SCREEN=1
-DWIDTH=320
-DHEIGHT=190 ;240 - 50 para a margem inferior
-DLED=1
-DLED_ON=HIGH

-DFONT_P=1
-DFONT_M=2
-DFONT_G=3
-DMAX_MENU_SIZE=5
-DMAX_ITEMS=10

-DUSER_SETUP_LOADED=1
-DILI9341_DRIVER=1
-DTFT_INVERSION_ON=1
-DTFT_BACKLIGHT_ON=1
-DM5STACK=1

-DTFT_MOSI=37
-DTFT_SCLK=36
-DTFT_CS=3
-DTFT_DC=35
-DTFT_RST=-1
-DTFT_BL=-1
-DTOUCH_CS=-1



-DSMOOTH_FONT=1
-DSPI_FREQUENCY=20000000
-DSPI_READ_FREQUENCY=20000000
-DSPI_TOUCH_FREQUENCY=2500000

-DSDCARD_SPI_BUS=FSPI
-DSDCARD_CS=4
-DSDCARD_SCK=36
-DSDCARD_MISO=35
-DSDCARD_MOSI=37

lib_deps =
${common.lib_deps}
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ void setup() {
axp192.begin();
#endif
#if defined(M5STACK)
M5.begin(); // inicia os periféricos do CORE2 exceto o TFT.
M5.begin(); // inicia os periféricos do CORE, CORE2 e COREs3 exceto o TFT.
#endif
#ifndef CARDPUTER
pinMode(SEL_BTN, INPUT);
Expand Down
2 changes: 2 additions & 0 deletions src/onlineLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ bool GetJsonFromM5() {
const char* serverUrl = "https://raw.githubusercontent.com/bmorcelli/M5Stack-json-fw/main/v2/core2.json";
#elif defined(CORE)
const char* serverUrl = "https://raw.githubusercontent.com/bmorcelli/M5Stack-json-fw/main/v2/core.json";
#elif defined(CORE3)
const char* serverUrl = "https://raw.githubusercontent.com/bmorcelli/M5Stack-json-fw/main/v2/cores3.json";
#endif

if (WiFi.status() == WL_CONNECTED) {
Expand Down
2 changes: 1 addition & 1 deletion src/partitioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const uint8_t orca[192] = { // 4Mb app partition
0xEB, 0xEB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xE5, 0x00, 0x17, 0x0A, 0x68, 0x12, 0x14, 0xEA, 0xFE, 0x89, 0x1E, 0x0F, 0x92, 0x04, 0x16, 0x1A,
};
#elif defined(CORE) || defined(CORE2)
#elif defined(CORE) || defined(CORE2) || defined(CORE3)
const uint8_t def_part[288] PROGMEM = {
0xAA, 0x50, 0x01, 0x02, 0x00, 0x90, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x6E, 0x76, 0x73, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand Down
4 changes: 3 additions & 1 deletion src/util/Unified/M5Unified.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1184,14 +1184,16 @@ for (int i = 0; i < 0x50; ++i)
switch (_board)
{
case board_t::board_M5StackCore2:
case board_t::board_M5Tough:
case board_t::board_M5StackCoreS3:
case board_t::board_M5StackCoreS3SE:
{
use_rawstate_bits = 0b00111;
int i = Touch.getCount();
while (--i >= 0)
{
auto raw = Touch.getTouchPointRaw(i);
if (raw.y > 240)
if (raw.y > 190) //240 - 50 para a margem inferior onde estão os botoes
{
auto det = Touch.getDetail(i);
if (det.state & touch_state_t::touch)
Expand Down

0 comments on commit 5054858

Please sign in to comment.