Skip to content

Commit fb55565

Browse files
authored
Merge pull request #375 from espressif/change/esptool5_underscore
change: rename esptool underscore arguments and subcommands to dash
2 parents 8849063 + b2b88d0 commit fb55565

File tree

5 files changed

+14
-14
lines changed
  • pytest-embedded-arduino/pytest_embedded_arduino
  • pytest-embedded-idf/pytest_embedded_idf
  • pytest-embedded-nuttx/pytest_embedded_nuttx
  • pytest-embedded-qemu/pytest_embedded_qemu
  • pytest-embedded-serial-esp/pytest_embedded_serial_esp

5 files changed

+14
-14
lines changed

pytest-embedded-arduino/pytest_embedded_arduino/serial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def flash(self) -> None:
5555

5656
try:
5757
esptool.main(
58-
['--chip', self.app.target, 'write_flash', *flash_files, *flash_settings],
58+
['--chip', self.app.target, 'write-flash', *flash_files, *flash_settings],
5959
esp=self.esp,
6060
)
6161
except Exception:

pytest-embedded-idf/pytest_embedded_idf/serial.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ def flash(self, app: IdfApp | None = None) -> None:
166166

167167
if '--baud' not in _args:
168168
_args.extend(['--baud', os.getenv('ESPBAUD', '921600')])
169-
_args.append('write_flash')
169+
_args.append('write-flash')
170170

171171
if self.erase_nvs:
172172
esptool.main(
173173
[
174-
'erase_region',
174+
'erase-region',
175175
str(app.partition_table['nvs']['offset']),
176176
str(app.partition_table['nvs']['size']),
177177
],
@@ -234,10 +234,10 @@ def dump_flash(
234234
raise ValueError('You must specify "partition" or ("address" and "size") to dump flash')
235235

236236
if output:
237-
esptool.main(['read_flash', str(_addr), str(_size), str(output)], esp=self.esp)
237+
esptool.main(['read-flash', str(_addr), str(_size), str(output)], esp=self.esp)
238238
else:
239239
with tempfile.NamedTemporaryFile() as fp:
240-
esptool.main(['read_flash', str(_addr), str(_size), fp.name], esp=self.esp)
240+
esptool.main(['read-flash', str(_addr), str(_size), fp.name], esp=self.esp)
241241
content = fp.read()
242242
return content
243243

@@ -256,7 +256,7 @@ def erase_partition(self, partition_name: str) -> None:
256256
address = self.app.partition_table[partition_name]['offset']
257257
size = self.app.partition_table[partition_name]['size']
258258
logging.info(f'Erasing the partition "{partition_name}" of size {size} at {address}')
259-
esptool.main(['erase_region', str(address), str(size), *self._force_flag()], esp=self.esp)
259+
esptool.main(['erase-region', str(address), str(size), *self._force_flag()], esp=self.esp)
260260
else:
261261
raise ValueError(f'partition name "{partition_name}" not found in app partition table')
262262

@@ -279,7 +279,7 @@ def read_flash_elf_sha256(self) -> bytes:
279279

280280
with tempfile.NamedTemporaryFile() as fp:
281281
esptool.main(
282-
['read_flash', str(bin_offset + self.DEFAULT_SHA256_OFFSET), str(32), fp.name],
282+
['read-flash', str(bin_offset + self.DEFAULT_SHA256_OFFSET), str(32), fp.name],
283283
esp=self.esp,
284284
)
285285
content = fp.read()

pytest-embedded-nuttx/pytest_embedded_nuttx/serial.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ def flash(self) -> None:
9393
flash_files.extend((str(self.binary_offsets[self.target]), self.app.app_file.as_posix()))
9494

9595
flash_settings = [
96-
'--flash_mode',
96+
'--flash-mode',
9797
self.flash_mode,
98-
'--flash_size',
98+
'--flash-size',
9999
self.flash_size,
100-
'--flash_freq',
100+
'--flash-freq',
101101
self.flash_freq,
102102
]
103103

@@ -109,7 +109,7 @@ def flash(self) -> None:
109109
self.port,
110110
'--baud',
111111
str(self.esptool_baud),
112-
'write_flash',
112+
'write-flash',
113113
*flash_files,
114114
*flash_settings,
115115
],

pytest-embedded-qemu/pytest_embedded_qemu/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def make_bin(self) -> None:
8888
'esptool.py',
8989
'--chip',
9090
self.app.target,
91-
'merge_bin',
91+
'merge-bin',
9292
'-o',
9393
self.image_path,
9494
'--fill-flash-size',

pytest-embedded-serial-esp/pytest_embedded_serial_esp/serial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _post_init(self):
125125
self._meta.set_port_target_cache(self.port, self.target)
126126

127127
if self.erase_all:
128-
esptool.main(['erase_flash'], esp=self.esp)
128+
esptool.main(['erase-flash'], esp=self.esp)
129129

130130
super()._post_init()
131131

@@ -163,7 +163,7 @@ def hard_reset(self):
163163
def erase_flash(self, force: bool = False) -> None:
164164
"""Erase the complete flash"""
165165
logging.info('Erasing the flash')
166-
options = ['erase_flash']
166+
options = ['erase-flash']
167167

168168
if force or self.esp_flash_force:
169169
options.append('--force')

0 commit comments

Comments
 (0)