Skip to content

Commit 3cb73dc

Browse files
authored
Add erase flash option to Arduino IDE menu (#7043)
1 parent cb3ffd0 commit 3cb73dc

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

Diff for: boards.txt

+21
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ menu.LoRaWanDebugLevel=LoRaWan Debug Level
1717
menu.LoopCore=Arduino Runs On
1818
menu.EventsCore=Events Run On
1919
menu.MemoryType=Memory Type
20+
menu.EraseFlash=Erase All Flash Before Sketch Upload
2021

2122
##############################################################
2223
### DO NOT PUT BOARDS ABOVE THE OFFICIAL ESPRESSIF BOARDS! ###
@@ -224,6 +225,11 @@ esp32s3.menu.DebugLevel.debug.build.code_debug=4
224225
esp32s3.menu.DebugLevel.verbose=Verbose
225226
esp32s3.menu.DebugLevel.verbose.build.code_debug=5
226227

228+
esp32s3.menu.EraseFlash.none=Disabled
229+
esp32s3.menu.EraseFlash.none.upload.erase_cmd=
230+
esp32s3.menu.EraseFlash.all=Enabled
231+
esp32s3.menu.EraseFlash.all.upload.erase_cmd=-e
232+
227233
##############################################################
228234

229235
esp32c3.name=ESP32C3 Dev Module
@@ -374,6 +380,11 @@ esp32c3.menu.DebugLevel.debug.build.code_debug=4
374380
esp32c3.menu.DebugLevel.verbose=Verbose
375381
esp32c3.menu.DebugLevel.verbose.build.code_debug=5
376382

383+
esp32c3.menu.EraseFlash.none=Disabled
384+
esp32c3.menu.EraseFlash.none.upload.erase_cmd=
385+
esp32c3.menu.EraseFlash.all=Enabled
386+
esp32c3.menu.EraseFlash.all.upload.erase_cmd=-e
387+
377388
##############################################################
378389

379390
esp32s2.name=ESP32S2 Dev Module
@@ -550,6 +561,11 @@ esp32s2.menu.DebugLevel.debug.build.code_debug=4
550561
esp32s2.menu.DebugLevel.verbose=Verbose
551562
esp32s2.menu.DebugLevel.verbose.build.code_debug=5
552563

564+
esp32s2.menu.EraseFlash.none=Disabled
565+
esp32s2.menu.EraseFlash.none.upload.erase_cmd=
566+
esp32s2.menu.EraseFlash.all=Enabled
567+
esp32s2.menu.EraseFlash.all.upload.erase_cmd=-e
568+
553569
##############################################################
554570

555571
esp32.name=ESP32 Dev Module
@@ -715,6 +731,11 @@ esp32.menu.DebugLevel.debug.build.code_debug=4
715731
esp32.menu.DebugLevel.verbose=Verbose
716732
esp32.menu.DebugLevel.verbose.build.code_debug=5
717733

734+
esp32.menu.EraseFlash.none=Disabled
735+
esp32.menu.EraseFlash.none.upload.erase_cmd=
736+
esp32.menu.EraseFlash.all=Enabled
737+
esp32.menu.EraseFlash.all.upload.erase_cmd=-e
738+
718739
##############################################################
719740

720741
esp32da.name=ESP32-WROOM-DA Module

Diff for: docs/source/guides/tools_menu.rst

+8
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ Events Run On
196196

197197
This function is also used to select the core that runs the Arduino events. This is only valid if the target SoC has 2 cores.
198198

199+
Erase All Flash Before Sketch Upload
200+
************************************
201+
202+
This option selects the flash memory region to be erased before uploading the new sketch.
203+
204+
* **Disabled** - Upload the sketch without erasing all flash contents. (Default)
205+
* **Enabled** - Erase all flash contents before uploading the sketch.
206+
199207
Port
200208
****
201209

Diff for: platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pluggable_monitor.required.serial=builtin:serial-monitor
211211
tools.esptool_py.upload.protocol=serial
212212
tools.esptool_py.upload.params.verbose=
213213
tools.esptool_py.upload.params.quiet=
214-
tools.esptool_py.upload.pattern_args=--chip {build.mcu} --port "{serial.port}" --baud {upload.speed} {upload.flags} --before default_reset --after hard_reset write_flash -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} {build.bootloader_addr} "{build.path}/{build.project_name}.bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x10000 "{build.path}/{build.project_name}.bin" {upload.extra_flags}
214+
tools.esptool_py.upload.pattern_args=--chip {build.mcu} --port "{serial.port}" --baud {upload.speed} {upload.flags} --before default_reset --after hard_reset write_flash {upload.erase_cmd} -z --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} {build.bootloader_addr} "{build.path}/{build.project_name}.bootloader.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x10000 "{build.path}/{build.project_name}.bin" {upload.extra_flags}
215215
tools.esptool_py.upload.pattern="{path}/{cmd}" {upload.pattern_args}
216216
tools.esptool_py.upload.pattern.linux=python3 "{path}/{cmd}" {upload.pattern_args}
217217

0 commit comments

Comments
 (0)