Skip to content

Commit d4e2029

Browse files
authoredApr 4, 2022
Add support for ArduinoIDE 2.0.0 (espressif#6506)
OTA is not yet working properly on the new IDE. Info: arduino/arduino-ide#740 (comment)
1 parent f1acc43 commit d4e2029

File tree

4 files changed

+894
-10
lines changed

4 files changed

+894
-10
lines changed
 

‎.github/scripts/update-version.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22

3+
# For reference: add tools for all boards by replacing one line in each board
4+
# "[board].upload.tool=esptool_py" to "[board].upload.tool=esptool_py\n[board].upload.tool.default=esptool_py\n[board].upload.tool.network=esp_ota"
5+
#cat boards.txt | sed "s/\([a-zA-Z0-9_\-]*\)\.upload\.tool\=esptool_py/\1\.upload\.tool\=esptool_py\\n\1\.upload\.tool\.default\=esptool_py\\n\1\.upload\.tool\.network\=esp_ota/"
6+
37
if [ ! $# -eq 3 ]; then
48
echo "Bad number of arguments: $#" >&2
59
echo "usage: $0 <major> <minor> <patch>" >&2

‎boards.txt

100755100644
Lines changed: 828 additions & 7 deletions
Large diffs are not rendered by default.

‎platform.txt

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ tools.esptool_py.cmd.windows=esptool.exe
1414
tools.esptool_py.network_cmd=python3 "{runtime.platform.path}/tools/espota.py" -r
1515
tools.esptool_py.network_cmd.windows="{runtime.platform.path}/tools/espota.exe" -r
1616

17+
tools.esp_ota.cmd=python3 "{runtime.platform.path}/tools/espota.py" -r
18+
tools.esp_ota.cmd.windows="{runtime.platform.path}/tools/espota.exe" -r
19+
1720
tools.gen_esp32part.cmd=python3 "{runtime.platform.path}/tools/gen_esp32part.py"
1821
tools.gen_esp32part.cmd.windows="{runtime.platform.path}/tools/gen_esp32part.exe"
1922

@@ -187,12 +190,60 @@ recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build
187190
recipe.size.regex=^(?:\.iram0\.text|\.iram0\.vectors|\.dram0\.data|\.flash\.text|\.flash\.rodata|)\s+([0-9]+).*
188191
recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss|\.noinit)\s+([0-9]+).*
189192

190-
# ------------------------------
193+
## Required discoveries and monitors
194+
## ---------------------------------
195+
pluggable_discovery.required.0=builtin:serial-discovery
196+
pluggable_discovery.required.1=builtin:mdns-discovery
197+
pluggable_monitor.required.serial=builtin:serial-monitor
198+
199+
## ------------------
200+
## Upload/Debug tools
201+
## ------------------
202+
203+
##
204+
## ESPTool
205+
##
191206

192-
tools.esptool_py.upload.protocol=esp32
207+
## Upload Sketch
208+
## -------------
209+
tools.esptool_py.upload.protocol=serial
193210
tools.esptool_py.upload.params.verbose=
194211
tools.esptool_py.upload.params.quiet=
195-
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} 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" {build.bootloader_addr} "{build.path}/{build.project_name}.bootloader.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin" {upload.extra_flags}
212+
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}
196213
tools.esptool_py.upload.pattern="{path}/{cmd}" {upload.pattern_args}
197214
tools.esptool_py.upload.pattern.linux=python3 "{path}/{cmd}" {upload.pattern_args}
215+
216+
## Program Application
217+
## -------------------
218+
tools.esptool_py.program.params.verbose=
219+
tools.esptool_py.program.params.quiet=
220+
tools.esptool_py.program.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} 0x10000 "{build.path}/{build.project_name}.bin"
221+
tools.esptool_py.program.pattern="{path}/{cmd}" {program.pattern_args}
222+
tools.esptool_py.program.pattern.linux=python3 "{path}/{cmd}" {program.pattern_args}
223+
224+
## Erase Chip (before burning the bootloader)
225+
## ------------------------------------------
226+
tools.esptool_py.erase.protocol=serial
227+
tools.esptool_py.erase.params.verbose=
228+
tools.esptool_py.erase.params.quiet=
229+
tools.esptool_py.erase.pattern_args=--chip {build.mcu} --port "{serial.port}" --baud {upload.speed} {upload.flags} --before default_reset --after hard_reset erase_flash
230+
tools.esptool_py.erase.pattern="{path}/{cmd}" {erase.pattern_args}
231+
tools.esptool_py.erase.pattern.linux=python3 "{path}/{cmd}" {erase.pattern_args}
232+
233+
## Burn Bootloader
234+
## ---------------
235+
tools.esptool_py.bootloader.protocol=serial
236+
tools.esptool_py.bootloader.params.verbose=
237+
tools.esptool_py.bootloader.params.quiet=
238+
tools.esptool_py.bootloader.pattern=
239+
240+
## Upload Sketch Through OTA (Arduino IDE 1.x)
241+
## -------------------------------------------
242+
## The following rule is deprecated by pluggable discovery.
243+
## We keep it to avoid breaking compatibility with the Arduino Java IDE.
198244
tools.esptool_py.upload.network_pattern={network_cmd} -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin"
245+
246+
## Upload Sketch Through OTA (Arduino IDE 2.x)
247+
## -------------------------------------------
248+
tools.esp_ota.upload.protocol=network
249+
tools.esp_ota.upload.pattern={cmd} -i "{upload.port.address}" -p "{upload.port.properties.port}" "--auth={upload.field.password}" -f "{build.path}/{build.project_name}.bin"

‎programmers.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
esptool.name=Esptool
2+
esptool.communication=serial
3+
esptool.protocol=serial
4+
esptool.program.protocol=serial
5+
esptool.program.tool=esptool_py
6+
esptool.program.tool.default=esptool_py
7+
esptool.program.extra_params=
8+
esptool.extra_params=

0 commit comments

Comments
 (0)
Please sign in to comment.