From a129e7ed04d069285d2605619f47b057dd137ad2 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sun, 8 Dec 2019 11:59:15 -0800 Subject: [PATCH] Only set flashmode byte when uploading an executable Fixes #6880 The updater was patching in the proper flashmode configuration byte for all uploads, apps and filesystems. This ended up corrupting one byte on every FS upload. Change updated to only patch theflashmode if it is doing an app. --- cores/esp8266/Updater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp index b028e19b9d..a8c443f62f 100644 --- a/cores/esp8266/Updater.cpp +++ b/cores/esp8266/Updater.cpp @@ -329,7 +329,7 @@ bool UpdaterClass::_writeBuffer(){ bool modifyFlashMode = false; FlashMode_t flashMode = FM_QIO; FlashMode_t bufferFlashMode = FM_QIO; - if (_currentAddress == _startAddress + FLASH_MODE_PAGE) { + if ((_currentAddress == _startAddress + FLASH_MODE_PAGE) && (_command == U_FLASH)) { flashMode = ESP.getFlashChipMode(); #ifdef DEBUG_UPDATER DEBUG_UPDATER.printf_P(PSTR("Header: 0x%1X %1X %1X %1X\n"), _buffer[0], _buffer[1], _buffer[2], _buffer[3]);