Skip to content

Commit 0c58dc1

Browse files
committed
Updater: read data back from flash before calculating MD5
1 parent 44d2722 commit 0c58dc1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cores/esp8266/Updater.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,14 @@ bool UpdaterClass::end(bool evenIfRemaining){
202202
}
203203

204204
bool UpdaterClass::_writeBuffer(){
205-
206205
if(!_async) yield();
207206
bool result = ESP.flashEraseSector(_currentAddress/FLASH_SECTOR_SIZE);
208207
if(!_async) yield();
209208
if (result) {
210209
result = ESP.flashWrite(_currentAddress, (uint32_t*) _buffer, _bufferLen);
210+
if (result) {
211+
result = ESP.flashRead(_currentAddress, (uint32_t*) _buffer, _bufferLen);
212+
}
211213
}
212214
if(!_async) yield();
213215

0 commit comments

Comments
 (0)