From 1b575d235f3fc1553d982d2077548b646b34f27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Tue, 10 Dec 2024 10:40:54 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E7=89=88MicroPython=20ESP32S2=E4=B8=8B=E7=83=A7=E5=BD=95?= =?UTF-8?q?=E5=9B=BA=E4=BB=B6=E6=97=B6=E6=B2=A1=E6=9C=89eraseFlash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/modules/mixly-modules/web/burn-upload.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/common/modules/mixly-modules/web/burn-upload.js b/common/modules/mixly-modules/web/burn-upload.js index aabff5d0..a60d01ed 100644 --- a/common/modules/mixly-modules/web/burn-upload.js +++ b/common/modules/mixly-modules/web/burn-upload.js @@ -134,9 +134,9 @@ BU.initBurn = () => { BU.burnWithSpecialBin(); } else { if (boardKey.indexOf('micropython:esp32s2') !== -1) { - BU.burnWithAdafruitEsptool(web.burn.binFile); + BU.burnWithAdafruitEsptool(web.burn.binFile, web.burn.erase); } else { - BU.burnWithEsptool(web.burn.binFile); + BU.burnWithEsptool(web.burn.binFile, web.burn.erase); } } } @@ -224,7 +224,7 @@ BU.burnByUSB = () => { }); } -BU.burnWithEsptool = async (binFile) => { +BU.burnWithEsptool = async (binFile, erase) => { const { mainStatusBarTabs } = Mixly; let portName = Serial.getSelectedPortName(); if (!portName) { @@ -324,7 +324,9 @@ BU.burnWithEsptool = async (binFile) => { } }); try { - await esploader.eraseFlash(); + if (erase) { + await esploader.eraseFlash(); + } await esploader.writeFlash(flashOptions); layer.msg(Msg.Lang['shell.burnSucc'], { time: 1000 }); statusBarTerminal.addValue(`==${Msg.Lang['shell.burnSucc']}==\n`); @@ -341,7 +343,7 @@ BU.burnWithEsptool = async (binFile) => { }); } -BU.burnWithAdafruitEsptool = async (binFile) => { +BU.burnWithAdafruitEsptool = async (binFile, erase) => { const { mainStatusBarTabs } = Mixly; let portName = Serial.getSelectedPortName(); if (!portName) { @@ -425,6 +427,9 @@ BU.burnWithAdafruitEsptool = async (binFile) => { let cancel = false; $("#mixly-loader-btn").hide(); try { + if (erase) { + await espStub.eraseFlash(); + } for (let file of data) { await espStub.flashData( file.data,