Skip to content

Commit c2ff3f4

Browse files
committed
use partten_args to remove duplication for create bin and upload
1 parent 6fffb2e commit c2ff3f4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

platform.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ version=2.0.0
44
runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32-elf
55
runtime.tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32s2-elf
66

7-
tools.esptool_py.cmd={runtime.platform.path}/tools/esptool/esptool
8-
tools.esptool_py.cmd.linux=python "{runtime.platform.path}/tools/esptool/esptool.py"
9-
tools.esptool_py.cmd.windows={runtime.platform.path}/tools/esptool/esptool.exe
7+
tools.esptool_py.path={runtime.platform.path}/tools/esptool
8+
tools.esptool_py.cmd=esptool
9+
tools.esptool_py.cmd.linux=esptool.py
10+
tools.esptool_py.cmd.windows=esptool.exe
1011

1112
tools.esptool_py.network_cmd=python "{runtime.platform.path}/tools/espota.py"
1213
tools.esptool_py.network_cmd.windows="{runtime.platform.path}/tools/espota.exe"
@@ -125,7 +126,9 @@ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-Wl,--Map={build
125126
recipe.objcopy.partitions.bin.pattern={tools.gen_esp32part.cmd} -q "{build.path}/partitions.csv" "{build.path}/{build.project_name}.partitions.bin"
126127

127128
## Create bin
128-
recipe.objcopy.bin.pattern={tools.esptool_py.cmd} --chip {build.mcu} elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf"
129+
recipe.objcopy.bin.pattern_args=--chip {build.mcu} elf2image --flash_mode "{build.flash_mode}" --flash_freq "{build.flash_freq}" --flash_size "{build.flash_size}" -o "{build.path}/{build.project_name}.bin" "{build.path}/{build.project_name}.elf"
130+
recipe.objcopy.bin.pattern="{tools.esptool_py.path}/{tools.esptool_py.cmd}" {recipe.objcopy.bin.pattern_args}
131+
recipe.objcopy.bin.pattern.linux=python "{tools.esptool_py.path}/{tools.esptool_py.cmd}" {recipe.objcopy.bin.pattern_args}
129132

130133
## Save bin
131134
recipe.output.tmp_file={build.project_name}.{build.mcu}.bin
@@ -141,5 +144,7 @@ recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss|\.noinit)\s+([0-9]+).*
141144
tools.esptool_py.upload.protocol=esp32
142145
tools.esptool_py.upload.params.verbose=
143146
tools.esptool_py.upload.params.quiet=
144-
tools.esptool_py.upload.pattern={cmd} --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 detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{build.path}/{build.project_name}.bootloader.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin"
147+
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 detect 0xe000 "{runtime.platform.path}/tools/partitions/boot_app0.bin" 0x1000 "{build.path}/{build.project_name}.bootloader.bin" 0x10000 "{build.path}/{build.project_name}.bin" 0x8000 "{build.path}/{build.project_name}.partitions.bin"
148+
tools.esptool_py.upload.pattern="{path}/{cmd}" {upload.pattern_args}
149+
tools.esptool_py.upload.pattern.linux=python "{path}/{cmd}" {upload.pattern_args}
145150
tools.esptool_py.upload.network_pattern={network_cmd} -i "{serial.port}" -p "{network.port}" "--auth={network.password}" -f "{build.path}/{build.project_name}.bin"

0 commit comments

Comments
 (0)