Skip to content

Commit

Permalink
Framework update
Browse files Browse the repository at this point in the history
Updated Framework to try to solve these issues:
#68
#67
#65
#63
  • Loading branch information
bmorcelli committed Sep 10, 2024
1 parent 66d2b01 commit 8716752
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 31 deletions.
Binary file modified Launcher/Launcher_2.0_C.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_CYD-2-USB.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_CYD-2432S028.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_Cardputer.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_CoreS3.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_Marauder-Mini.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_Marauder-v4-OG.bin
Binary file not shown.
Binary file modified Launcher/Launcher_2.0_T-Display-S3-Touchscreen.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.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Sourcecode will be released in the future..
* UiFlow 1 doesn´t work with M5Launcher.. it uses an old MicroPython distro, that uses an old ESP-IDF distro with lots os secrets that I couldn´t figure out.

## Changelog
* 2.2.5:
* [x] Changed framework to remove all Watchdog Timers https://github.com/bmorcelli/M5Stick-Launcher/issues/61 https://github.com/bmorcelli/M5Stick-Launcher/issues/63 and solve some SD related issues
* [x] Set Grove pins to LOW state on StickCs and Cardputer to avoid 433Mhz jamming while RF433T is connected
* 2.2.4:
* [x] Finally ported to CoreS3 and CoreS3-SE
* [x] Added reset to watchdog on WebUI and check for free memory when loading files to WebUI, to avoid crashes.
Expand Down
6 changes: 0 additions & 6 deletions lib/M5Stack-HTTPUpdate/src/M5-HTTPUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ bool HTTPUpdate::runUpdate(Stream& in, uint32_t size, String md5, int command)

StreamString error;

disableCore0WDT(); // disable WDT it as suggested by twitter.com/@lovyan03

if (_cbProgress) {
Update.onProgress(_cbProgress);
Expand All @@ -444,7 +443,6 @@ bool HTTPUpdate::runUpdate(Stream& in, uint32_t size, String md5, int command)
Update.printError(error);
error.trim(); // remove line ending
log_e("Update.begin failed! (%s)\n", error.c_str());
enableCore0WDT();
return false;
}

Expand All @@ -456,7 +454,6 @@ bool HTTPUpdate::runUpdate(Stream& in, uint32_t size, String md5, int command)
if(!Update.setMD5(md5.c_str())) {
_lastError = HTTP_UE_SERVER_FAULTY_MD5;
log_e("Update.setMD5 failed! (%s)\n", md5.c_str());
enableCore0WDT();
return false;
}
}
Expand All @@ -468,7 +465,6 @@ bool HTTPUpdate::runUpdate(Stream& in, uint32_t size, String md5, int command)
Update.printError(error);
error.trim(); // remove line ending
log_e("Update.writeStream failed! (%s)\n", error.c_str());
enableCore0WDT();
return false;
}

Expand All @@ -481,11 +477,9 @@ bool HTTPUpdate::runUpdate(Stream& in, uint32_t size, String md5, int command)
Update.printError(error);
error.trim(); // remove line ending
log_e("Update.end failed! (%s)\n", error.c_str());
enableCore0WDT();
return false;
}

enableCore0WDT();
return true;
}

Expand Down
28 changes: 14 additions & 14 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ default_envs =

[common]
build_flags =
-DLAUNCHER='"2.2.4"'
-DLAUNCHER='"2.2.5"'
-DMAXFILES=256
-DEEPROMSIZE=128
-DLH=8
-DLW=6
-DCONFIG_FILE='"/config.conf"'

lib_deps =
AsyncTCP
https://github.com/bmorcelli/AsyncTCP/
esphome/ESPAsyncWebServer-esphome
bblanchon/ArduinoJson @ ^7.0.4


[env:m5stack-cplus2]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = m5stick-c
framework = arduino
monitor_speed = 115200
Expand Down Expand Up @@ -109,7 +109,7 @@ lib_deps =
${common.lib_deps}

[env:m5stack-cplus1_1]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = m5stick-c
framework = arduino
monitor_speed = 115200
Expand Down Expand Up @@ -169,7 +169,7 @@ lib_deps =
${common.lib_deps}

[env:m5stack-cardputer]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = m5stack-stamps3
framework = arduino
monitor_speed = 115200
Expand Down Expand Up @@ -232,7 +232,7 @@ lib_deps =


[env:m5stack-c]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = m5stick-c
framework = arduino
monitor_speed = 115200
Expand Down Expand Up @@ -278,7 +278,7 @@ lib_deps =


[env:m5stack-core2]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = m5stack-core2
framework = arduino
monitor_speed = 115200
Expand Down Expand Up @@ -346,7 +346,7 @@ lib_deps =


[env:m5stack-core]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = m5stack-core2
framework = arduino
monitor_speed = 115200
Expand Down Expand Up @@ -414,7 +414,7 @@ lib_deps =
${common.lib_deps}

[env:m5stack-cores3]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = m5stack-cores3
framework = arduino
monitor_speed = 115200
Expand Down Expand Up @@ -480,7 +480,7 @@ lib_deps =


[env:lilygo-t-display-S3]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = lilygo-t-display-s3
framework = arduino
monitor_speed = 115200
Expand Down Expand Up @@ -534,7 +534,7 @@ lib_deps =


[env:CYD-2432S028]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = esp32dev
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
Expand Down Expand Up @@ -609,7 +609,7 @@ lib_deps =


[env:CYD-2-USB]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = esp32dev
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
Expand Down Expand Up @@ -683,7 +683,7 @@ lib_deps =
${common.lib_deps}

[env:Marauder-v4-OG]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = esp32dev
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
Expand Down Expand Up @@ -755,7 +755,7 @@ lib_deps =
${common.lib_deps}

[env:Marauder-Mini]
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.2/platform-espressif32.zip
platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.3/platform-espressif32.zip
board = esp32dev
monitor_speed = 115200
monitor_filters = esp32_exception_decoder
Expand Down
2 changes: 1 addition & 1 deletion src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void TdisplayS3Footer2(uint16_t color) {
** Description: Start Display functions and display bootscreen
***************************************************************************************/
void initDisplay(bool doAll) {
tft.drawRoundRect(5,5,WIDTH-10,HEIGHT-10,5,FGCOLOR);
tft.drawRoundRect(3,3,WIDTH-6,HEIGHT-6,5,FGCOLOR);
tft.setTextSize(FONT_P);
tft.setCursor(10,10);
int cor = 0;
Expand Down
16 changes: 16 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,31 @@ void setup() {
pinMode(DW_BTN, INPUT);
pinMode(4, OUTPUT);
digitalWrite(4,HIGH);
//Grove pins down
pinMode(32, OUTPUT);
pinMode(33, OUTPUT);
digitalWrite(32,LOW);
digitalWrite(33,LOW);

#elif defined(STICK_C_PLUS)
axp192.begin();
pinMode(SEL_BTN, INPUT);
pinMode(DW_BTN, INPUT);
//Grove Pins down
pinMode(32, OUTPUT);
pinMode(33, OUTPUT);
digitalWrite(32,LOW);
digitalWrite(33,LOW);
#elif defined(M5STACK) && defined(CORE3)
M5.begin(); // Begin after TFT, for SDCard to work
#elif defined(CARDPUTER)
Keyboard.begin();
pinMode(10, INPUT);
//Grove Pins down
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
digitalWrite(1,LOW);
digitalWrite(2,LOW);
#elif defined(T_DISPLAY_S3)
SD_MMC.setPins(PIN_SD_CLK, PIN_SD_CMD, PIN_SD_D0);
gpio_hold_dis((gpio_num_t)21);//PIN_TOUCH_RES
Expand Down
3 changes: 1 addition & 2 deletions src/onlineLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,10 @@ void downloadFirmware(String file_str, String fileName, String folder) {
while(!checkSelPress()) yield();
}
file.close();
delay(2000);
break;
} else {
http.end();
delay(1000);
delay(500);
}
}
http.end();
Expand Down
8 changes: 0 additions & 8 deletions src/webInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,8 @@ void handleUpload(AsyncWebServerRequest *request, String filename, size_t index,
// stream the incoming chunk to the opened file
if(!update) {
request->_tempFile.write(data, len);
esp_task_wdt_reset();
} else {
if(!Update.write(data,len)) displayRedStripe("FAIL 172");
esp_task_wdt_reset();
}
}

Expand All @@ -195,7 +193,6 @@ void handleUpload(AsyncWebServerRequest *request, String filename, size_t index,
if(!Update.end()) { displayRedStripe("Fail 183: " + String(Update.getError())); delay(3000); }
else displayRedStripe("Restart your device");
}
enableCore0WDT();
}
} else {
return request->requestAuthentication();
Expand Down Expand Up @@ -415,11 +412,6 @@ void startWebUi(String ssid, int encryptation, bool mode_ap) {
server->begin();
delay(500);

//log_i("Disabling WatchDogs");
disableCore0WDT(); // disable WDT
disableCore1WDT(); // disable WDT
disableLoopWDT(); // disable WDT

tft.drawRoundRect(5,5,WIDTH-10,HEIGHT-10,5,ALCOLOR);
tft.fillSmoothRoundRect(6,6,WIDTH-12,HEIGHT-12,5,BGCOLOR);
setTftDisplay(7,7,ALCOLOR,FONT_P,BGCOLOR);
Expand Down

0 comments on commit 8716752

Please sign in to comment.