esptool 4.8.dev4__tar.gz → 4.8.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {esptool-4.8.dev4 → esptool-4.8.1}/MANIFEST.in +2 -2
- esptool-4.8.1/PKG-INFO +53 -0
- esptool-4.8.1/esp_rfc2217_server/__init__.py +124 -0
- esptool-4.8.1/esp_rfc2217_server/__main__.py +9 -0
- esptool-4.8.1/esp_rfc2217_server/esp_port_manager.py +97 -0
- esptool-4.8.1/esp_rfc2217_server/redirector.py +89 -0
- esptool-4.8.1/esp_rfc2217_server.py +56 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/__init__.py +54 -6
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/base_fields.py +4 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/base_operations.py +69 -20
- esptool-4.8.1/espefuse/efuse/csv_table_parser.py +266 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32/emulate_efuse_controller.py +2 -7
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c2/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c2/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c2/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c3/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c3/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c3/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c5/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c5/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c5/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c5beta3/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c5beta3/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c5beta3/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c6/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c6/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c6/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c61/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c61/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c61/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32h2/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32h2/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32h2/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32h2beta1/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32h2beta1/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32h2beta1/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32p4/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32p4/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32p4/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s2/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s2/fields.py +9 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s2/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s3/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s3/fields.py +31 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s3/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s3beta2/emulate_efuse_controller.py +1 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s3beta2/fields.py +31 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s3beta2/mem_definition.py +2 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/mem_definition_base.py +62 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32c5.yaml +41 -22
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32c5beta3.yaml +41 -22
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32c61.yaml +28 -13
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32p4.yaml +57 -60
- {esptool-4.8.dev4 → esptool-4.8.1}/espsecure/__init__.py +157 -71
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/__init__.py +150 -6
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/bin_image.py +5 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/cmds.py +69 -18
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/config.py +1 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/loader.py +50 -18
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/reset.py +29 -16
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32.py +6 -8
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32c2.py +5 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32c3.py +24 -3
- esptool-4.8.1/esptool/targets/esp32c5.py +190 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32c5beta3.py +30 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32c6.py +7 -3
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32c61.py +60 -2
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32h2.py +18 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32h2beta1.py +23 -3
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32p4.py +29 -5
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32s2.py +31 -11
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32s3.py +31 -11
- esptool-4.8.1/esptool/targets/stub_flasher/1/README.md +3 -0
- esptool-4.8.1/esptool/targets/stub_flasher/1/esp32c5.json +8 -0
- esptool-4.8.1/esptool/targets/stub_flasher/1/esp32c5beta3.json +8 -0
- esptool-4.8.1/esptool/targets/stub_flasher/1/esp32c61.json +8 -0
- esptool-4.8.1/esptool/targets/stub_flasher/2/LICENSE-APACHE +201 -0
- esptool-4.8.1/esptool/targets/stub_flasher/2/LICENSE-MIT +25 -0
- esptool-4.8.1/esptool/targets/stub_flasher/2/README.md +3 -0
- esptool-4.8.1/esptool/targets/stub_flasher/2/esp32.json +1 -0
- esptool-4.8.1/esptool/targets/stub_flasher/2/esp32c2.json +1 -0
- esptool-4.8.1/esptool/targets/stub_flasher/2/esp32c3.json +1 -0
- esptool-4.8.1/esptool/targets/stub_flasher/2/esp32c6.json +1 -0
- esptool-4.8.1/esptool/targets/stub_flasher/2/esp32h2.json +1 -0
- esptool-4.8.1/esptool/targets/stub_flasher/2/esp32s2.json +1 -0
- esptool-4.8.1/esptool/targets/stub_flasher/2/esp32s3.json +1 -0
- esptool-4.8.1/esptool.egg-info/PKG-INFO +53 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool.egg-info/SOURCES.txt +33 -14
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool.egg-info/requires.txt +4 -1
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool.egg-info/top_level.txt +2 -0
- esptool-4.8.1/pyproject.toml +166 -0
- esptool-4.8.1/setup.py +21 -0
- esptool-4.8.dev4/PKG-INFO +0 -46
- esptool-4.8.dev4/esp_rfc2217_server.py +0 -311
- esptool-4.8.dev4/esptool/targets/esp32c5.py +0 -98
- esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32c5beta3.json +0 -8
- esptool-4.8.dev4/esptool.egg-info/PKG-INFO +0 -46
- esptool-4.8.dev4/setup.py +0 -137
- {esptool-4.8.dev4 → esptool-4.8.1}/LICENSE +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/README.md +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/__main__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/emulate_efuse_controller_base.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c2/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c2/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c3/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c3/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c5/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c5/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c5beta3/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c5beta3/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c6/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c6/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c61/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32c61/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32h2/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32h2/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32h2beta1/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32h2beta1/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32p4/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32p4/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s2/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s2/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s3/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s3/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s3beta2/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/esp32s3beta2/operations.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse/util.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32.yaml +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32c2.yaml +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32c3.yaml +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32c6.yaml +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32h2.yaml +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32s2.yaml +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse/efuse_defs/esp32s3.yaml +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espefuse.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espsecure/__main__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espsecure/esp_hsm_sign/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espsecure/esp_hsm_sign/exceptions.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/espsecure.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/__main__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/__init__.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32c6beta.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32h2beta2.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp32s3beta2.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/targets/esp8266.py +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32c2.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32c2.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32c3.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32c3.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32c6.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32c6.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32c6beta.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32c6beta.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32h2.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32h2.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32h2beta1.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32h2beta1.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32h2beta2.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32h2beta2.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32p4.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32p4.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32s2.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32s2.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32s3.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32s3.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_32s3beta2.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp32s3beta2.json +0 -0
- /esptool-4.8.dev4/esptool/targets/stub_flasher/stub_flasher_8266.json → /esptool-4.8.1/esptool/targets/stub_flasher/1/esp8266.json +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/uf2_writer.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool/util.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool.egg-info/dependency_links.txt +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/esptool.py +0 -0
- {esptool-4.8.dev4 → esptool-4.8.1}/setup.cfg +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
include README.md
|
|
2
2
|
include LICENSE
|
|
3
|
-
include esptool/targets/stub_flasher
|
|
3
|
+
include esptool/targets/stub_flasher/1/*
|
|
4
|
+
include esptool/targets/stub_flasher/2/*
|
|
4
5
|
include espefuse/efuse_defs/*.yaml
|
|
5
6
|
# sdist includes test/test*.py by default, but esptool.py tests
|
|
6
7
|
# are so far only intended to run from the git repo itself
|
|
7
8
|
prune test
|
|
8
|
-
prune flasher_stub
|
|
9
9
|
prune .github
|
|
10
10
|
prune docs
|
|
11
11
|
exclude .git*
|
esptool-4.8.1/PKG-INFO
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: esptool
|
|
3
|
+
Version: 4.8.1
|
|
4
|
+
Summary: A serial utility to communicate & flash code to Espressif chips.
|
|
5
|
+
Author: Fredrik Ahlberg (themadinventor), Angus Gratton (projectgus), Espressif Systems
|
|
6
|
+
License: GPLv2+
|
|
7
|
+
Project-URL: Homepage, https://github.com/espressif/esptool/
|
|
8
|
+
Project-URL: Documentation, https://docs.espressif.com/projects/esptool/
|
|
9
|
+
Project-URL: Source, https://github.com/espressif/esptool/
|
|
10
|
+
Project-URL: Tracker, https://github.com/espressif/esptool/issues/
|
|
11
|
+
Project-URL: Changelog, https://github.com/espressif/esptool/blob/master/CHANGELOG.md
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Natural Language :: English
|
|
15
|
+
Classifier: Operating System :: POSIX
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
18
|
+
Classifier: Topic :: Software Development :: Embedded Systems
|
|
19
|
+
Classifier: Environment :: Console
|
|
20
|
+
Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
27
|
+
Requires-Python: >=3.7
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Provides-Extra: hsm
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
|
|
33
|
+
# esptool.py
|
|
34
|
+
|
|
35
|
+
A Python-based, open-source, platform-independent utility to communicate with the ROM bootloader in Espressif chips.
|
|
36
|
+
|
|
37
|
+
[](https://github.com/espressif/esptool/actions/workflows/test_esptool.yml) [](https://github.com/espressif/esptool/actions/workflows/build_esptool.yml)
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
Visit the [documentation](https://docs.espressif.com/projects/esptool/) or run `esptool.py -h`.
|
|
42
|
+
|
|
43
|
+
## Contribute
|
|
44
|
+
|
|
45
|
+
If you're interested in contributing to esptool.py, please check the [contributions guide](https://docs.espressif.com/projects/esptool/en/latest/contributing.html).
|
|
46
|
+
|
|
47
|
+
## About
|
|
48
|
+
|
|
49
|
+
esptool.py was initially created by Fredrik Ahlberg (@[themadinventor](https://github.com/themadinventor/)), and later maintained by Angus Gratton (@[projectgus](https://github.com/projectgus/)). It is now supported by Espressif Systems. It has also received improvements from many members of the community.
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
This document and the attached source code are released as Free Software under GNU General Public License Version 2 or later. See the accompanying [LICENSE file](https://github.com/espressif/esptool/blob/master/LICENSE) for a copy.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2009-2015 Chris Liechti
|
|
2
|
+
# SPDX-FileContributor: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
|
3
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
+
#
|
|
5
|
+
# Redirect data from a TCP/IP connection to a serial port and vice versa using RFC 2217.
|
|
6
|
+
|
|
7
|
+
###################################################################################
|
|
8
|
+
# redirect data from a TCP/IP connection to a serial port and vice versa
|
|
9
|
+
# using RFC 2217
|
|
10
|
+
#
|
|
11
|
+
# (C) 2009-2015 Chris Liechti <cliechti@gmx.net>
|
|
12
|
+
#
|
|
13
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
14
|
+
|
|
15
|
+
import logging
|
|
16
|
+
import socket
|
|
17
|
+
import sys
|
|
18
|
+
import serial
|
|
19
|
+
|
|
20
|
+
from esp_rfc2217_server.redirector import Redirector
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def main():
|
|
24
|
+
import argparse
|
|
25
|
+
|
|
26
|
+
parser = argparse.ArgumentParser(
|
|
27
|
+
description="RFC 2217 Serial to Network (TCP/IP) redirector.",
|
|
28
|
+
epilog="NOTE: no security measures are implemented. "
|
|
29
|
+
"Anyone can remotely connect to this service over the network.\n"
|
|
30
|
+
"Only one connection at once is supported. "
|
|
31
|
+
"When the connection is terminated it waits for the next connect.",
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
parser.add_argument("SERIALPORT")
|
|
35
|
+
|
|
36
|
+
parser.add_argument(
|
|
37
|
+
"-p",
|
|
38
|
+
"--localport",
|
|
39
|
+
type=int,
|
|
40
|
+
help="local TCP port, default: %(default)s",
|
|
41
|
+
metavar="TCPPORT",
|
|
42
|
+
default=2217,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
parser.add_argument(
|
|
46
|
+
"-v",
|
|
47
|
+
"--verbose",
|
|
48
|
+
dest="verbosity",
|
|
49
|
+
action="count",
|
|
50
|
+
help="print more diagnostic messages (option can be given multiple times)",
|
|
51
|
+
default=0,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
parser.add_argument(
|
|
55
|
+
"--r0",
|
|
56
|
+
help="Use delays necessary for ESP32 revision 0 chips",
|
|
57
|
+
action="store_true",
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
args = parser.parse_args()
|
|
61
|
+
|
|
62
|
+
if args.verbosity > 3:
|
|
63
|
+
args.verbosity = 3
|
|
64
|
+
level = (logging.WARNING, logging.INFO, logging.DEBUG, logging.NOTSET)[
|
|
65
|
+
args.verbosity
|
|
66
|
+
]
|
|
67
|
+
logging.basicConfig(level=logging.INFO)
|
|
68
|
+
# logging.getLogger('root').setLevel(logging.INFO)
|
|
69
|
+
logging.getLogger("rfc2217").setLevel(level)
|
|
70
|
+
|
|
71
|
+
# connect to serial port
|
|
72
|
+
ser = serial.serial_for_url(args.SERIALPORT, do_not_open=True, exclusive=True)
|
|
73
|
+
ser.timeout = 3 # required so that the reader thread can exit
|
|
74
|
+
# reset control line as no _remote_ "terminal" has been connected yet
|
|
75
|
+
ser.dtr = False
|
|
76
|
+
ser.rts = False
|
|
77
|
+
|
|
78
|
+
logging.info(" RFC 2217 TCP/IP to Serial redirector - type Ctrl-C / BREAK to quit")
|
|
79
|
+
|
|
80
|
+
try:
|
|
81
|
+
ser.open()
|
|
82
|
+
except serial.SerialException as e:
|
|
83
|
+
logging.error(" Could not open serial port {}: {}".format(ser.name, e))
|
|
84
|
+
sys.exit(1)
|
|
85
|
+
|
|
86
|
+
logging.info(" Serving serial port: {}".format(ser.name))
|
|
87
|
+
settings = ser.get_settings()
|
|
88
|
+
|
|
89
|
+
srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
90
|
+
srv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
91
|
+
srv.bind(("", args.localport))
|
|
92
|
+
srv.listen(1)
|
|
93
|
+
logging.info(" TCP/IP port: {}".format(args.localport))
|
|
94
|
+
while True:
|
|
95
|
+
try:
|
|
96
|
+
client_socket, addr = srv.accept()
|
|
97
|
+
logging.info("Connected by {}:{}".format(addr[0], addr[1]))
|
|
98
|
+
client_socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
|
|
99
|
+
ser.rts = True
|
|
100
|
+
ser.dtr = True
|
|
101
|
+
# enter network <-> serial loop
|
|
102
|
+
r = Redirector(ser, client_socket, args.verbosity > 0, args.r0)
|
|
103
|
+
try:
|
|
104
|
+
r.shortcircuit()
|
|
105
|
+
finally:
|
|
106
|
+
logging.info("Disconnected")
|
|
107
|
+
r.stop()
|
|
108
|
+
client_socket.close()
|
|
109
|
+
ser.dtr = False
|
|
110
|
+
ser.rts = False
|
|
111
|
+
# Restore port settings (may have been changed by RFC 2217
|
|
112
|
+
# capable client)
|
|
113
|
+
ser.apply_settings(settings)
|
|
114
|
+
except KeyboardInterrupt:
|
|
115
|
+
sys.stdout.write("\n")
|
|
116
|
+
break
|
|
117
|
+
except socket.error as msg:
|
|
118
|
+
logging.error(str(msg))
|
|
119
|
+
|
|
120
|
+
logging.info("--- exit ---")
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
if __name__ == "__main__":
|
|
124
|
+
main()
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2014-2024 Fredrik Ahlberg, Angus Gratton,
|
|
2
|
+
# Espressif Systems (Shanghai) CO LTD, other contributors as noted.
|
|
3
|
+
#
|
|
4
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
|
|
6
|
+
import esp_rfc2217_server
|
|
7
|
+
|
|
8
|
+
if __name__ == "__main__":
|
|
9
|
+
esp_rfc2217_server.main()
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2014-2024 Fredrik Ahlberg, Angus Gratton,
|
|
2
|
+
# Espressif Systems (Shanghai) CO LTD, other contributors as noted.
|
|
3
|
+
#
|
|
4
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
import os
|
|
6
|
+
import threading
|
|
7
|
+
from esptool.reset import (
|
|
8
|
+
ClassicReset,
|
|
9
|
+
CustomReset,
|
|
10
|
+
DEFAULT_RESET_DELAY,
|
|
11
|
+
HardReset,
|
|
12
|
+
UnixTightReset,
|
|
13
|
+
)
|
|
14
|
+
import serial
|
|
15
|
+
import serial.rfc2217
|
|
16
|
+
from serial.rfc2217 import (
|
|
17
|
+
COM_PORT_OPTION,
|
|
18
|
+
SET_CONTROL,
|
|
19
|
+
SET_CONTROL_DTR_OFF,
|
|
20
|
+
SET_CONTROL_DTR_ON,
|
|
21
|
+
SET_CONTROL_RTS_OFF,
|
|
22
|
+
SET_CONTROL_RTS_ON,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
from esptool.config import load_config_file
|
|
26
|
+
|
|
27
|
+
cfg, _ = load_config_file(verbose=True)
|
|
28
|
+
cfg = cfg["esptool"]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class EspPortManager(serial.rfc2217.PortManager):
|
|
32
|
+
"""
|
|
33
|
+
The beginning of the reset sequence is detected and the proper reset sequence
|
|
34
|
+
is applied in a thread. The rest of the reset sequence received is just ignored
|
|
35
|
+
and not sent to the serial port.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
def __init__(self, serial_port, connection, esp32r0_delay, logger=None):
|
|
39
|
+
self.esp32r0_delay = esp32r0_delay
|
|
40
|
+
self.is_download_mode = False
|
|
41
|
+
super(EspPortManager, self).__init__(serial_port, connection, logger)
|
|
42
|
+
|
|
43
|
+
def _telnet_process_subnegotiation(self, suboption):
|
|
44
|
+
if suboption[0:1] == COM_PORT_OPTION and suboption[1:2] == SET_CONTROL:
|
|
45
|
+
if suboption[2:3] == SET_CONTROL_DTR_OFF:
|
|
46
|
+
self.is_download_mode = False
|
|
47
|
+
self.serial.dtr = False
|
|
48
|
+
return
|
|
49
|
+
elif suboption[2:3] == SET_CONTROL_RTS_OFF and not self.is_download_mode:
|
|
50
|
+
reset_thread = threading.Thread(target=self._hard_reset_thread)
|
|
51
|
+
reset_thread.daemon = True
|
|
52
|
+
reset_thread.name = "hard_reset_thread"
|
|
53
|
+
reset_thread.start()
|
|
54
|
+
return
|
|
55
|
+
elif suboption[2:3] == SET_CONTROL_DTR_ON and not self.is_download_mode:
|
|
56
|
+
self.is_download_mode = True
|
|
57
|
+
reset_thread = threading.Thread(target=self._reset_thread)
|
|
58
|
+
reset_thread.daemon = True
|
|
59
|
+
reset_thread.name = "reset_thread"
|
|
60
|
+
reset_thread.start()
|
|
61
|
+
return
|
|
62
|
+
elif suboption[2:3] in [
|
|
63
|
+
SET_CONTROL_DTR_ON,
|
|
64
|
+
SET_CONTROL_RTS_ON,
|
|
65
|
+
SET_CONTROL_RTS_OFF,
|
|
66
|
+
]:
|
|
67
|
+
return
|
|
68
|
+
# only in cases not handled above do the original implementation in PortManager
|
|
69
|
+
super(EspPortManager, self)._telnet_process_subnegotiation(suboption)
|
|
70
|
+
|
|
71
|
+
def _hard_reset_thread(self):
|
|
72
|
+
"""
|
|
73
|
+
The reset logic used for hard resetting the chip.
|
|
74
|
+
"""
|
|
75
|
+
if self.logger:
|
|
76
|
+
self.logger.info("Activating hard reset in thread")
|
|
77
|
+
HardReset(self.serial)()
|
|
78
|
+
|
|
79
|
+
def _reset_thread(self):
|
|
80
|
+
"""
|
|
81
|
+
The reset logic is used from esptool.py because the RTS and DTR signals
|
|
82
|
+
cannot be retransmitted through RFC 2217 with proper timing.
|
|
83
|
+
"""
|
|
84
|
+
if self.logger:
|
|
85
|
+
self.logger.info("Activating reset in thread")
|
|
86
|
+
|
|
87
|
+
delay = DEFAULT_RESET_DELAY
|
|
88
|
+
if self.esp32r0_delay:
|
|
89
|
+
delay += 0.5
|
|
90
|
+
|
|
91
|
+
cfg_custom_reset_sequence = cfg.get("custom_reset_sequence")
|
|
92
|
+
if cfg_custom_reset_sequence is not None:
|
|
93
|
+
CustomReset(self.serial, cfg_custom_reset_sequence)()
|
|
94
|
+
elif os.name != "nt":
|
|
95
|
+
UnixTightReset(self.serial, delay)()
|
|
96
|
+
else:
|
|
97
|
+
ClassicReset(self.serial, delay)()
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2014-2024 Fredrik Ahlberg, Angus Gratton,
|
|
2
|
+
# Espressif Systems (Shanghai) CO LTD, other contributors as noted.
|
|
3
|
+
#
|
|
4
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
import threading
|
|
6
|
+
import time
|
|
7
|
+
import logging
|
|
8
|
+
import socket
|
|
9
|
+
|
|
10
|
+
from esp_rfc2217_server.esp_port_manager import EspPortManager
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Redirector(object):
|
|
14
|
+
def __init__(self, serial_instance, socket, debug=False, esp32r0delay=False):
|
|
15
|
+
self.serial = serial_instance
|
|
16
|
+
self.socket = socket
|
|
17
|
+
self._write_lock = threading.Lock()
|
|
18
|
+
self.rfc2217 = EspPortManager(
|
|
19
|
+
self.serial,
|
|
20
|
+
self,
|
|
21
|
+
esp32r0delay,
|
|
22
|
+
logger=logging.getLogger("rfc2217.server") if debug else None,
|
|
23
|
+
)
|
|
24
|
+
self.log = logging.getLogger("redirector")
|
|
25
|
+
self.force_exit = False
|
|
26
|
+
|
|
27
|
+
def statusline_poller(self):
|
|
28
|
+
self.log.debug("status line poll thread started")
|
|
29
|
+
while self.alive:
|
|
30
|
+
time.sleep(1)
|
|
31
|
+
self.rfc2217.check_modem_lines()
|
|
32
|
+
self.log.debug("status line poll thread terminated")
|
|
33
|
+
|
|
34
|
+
def shortcircuit(self):
|
|
35
|
+
"""connect the serial port to the TCP port by copying everything
|
|
36
|
+
from one side to the other"""
|
|
37
|
+
self.alive = True
|
|
38
|
+
self.thread_read = threading.Thread(target=self.reader)
|
|
39
|
+
self.thread_read.daemon = True
|
|
40
|
+
self.thread_read.name = "serial->socket"
|
|
41
|
+
self.thread_read.start()
|
|
42
|
+
self.thread_poll = threading.Thread(target=self.statusline_poller)
|
|
43
|
+
self.thread_poll.daemon = True
|
|
44
|
+
self.thread_poll.name = "status line poll"
|
|
45
|
+
self.thread_poll.start()
|
|
46
|
+
self.writer()
|
|
47
|
+
|
|
48
|
+
def reader(self):
|
|
49
|
+
"""loop forever and copy serial->socket"""
|
|
50
|
+
self.log.debug("reader thread started")
|
|
51
|
+
while self.alive:
|
|
52
|
+
try:
|
|
53
|
+
data = self.serial.read(self.serial.in_waiting or 1)
|
|
54
|
+
if data:
|
|
55
|
+
# escape outgoing data when needed (Telnet IAC (0xff) character)
|
|
56
|
+
self.write(b"".join(self.rfc2217.escape(data)))
|
|
57
|
+
except socket.error as msg:
|
|
58
|
+
self.log.error("{}".format(msg))
|
|
59
|
+
# probably got disconnected
|
|
60
|
+
break
|
|
61
|
+
self.alive = False
|
|
62
|
+
self.log.debug("reader thread terminated")
|
|
63
|
+
|
|
64
|
+
def write(self, data):
|
|
65
|
+
"""thread safe socket write with no data escaping. used to send telnet stuff"""
|
|
66
|
+
with self._write_lock:
|
|
67
|
+
self.socket.sendall(data)
|
|
68
|
+
|
|
69
|
+
def writer(self):
|
|
70
|
+
"""loop forever and copy socket->serial"""
|
|
71
|
+
while self.alive:
|
|
72
|
+
try:
|
|
73
|
+
data = self.socket.recv(1024)
|
|
74
|
+
if not data:
|
|
75
|
+
break
|
|
76
|
+
self.serial.write(b"".join(self.rfc2217.filter(data)))
|
|
77
|
+
except socket.error as msg:
|
|
78
|
+
self.log.error("{}".format(msg))
|
|
79
|
+
# probably got disconnected
|
|
80
|
+
break
|
|
81
|
+
self.stop()
|
|
82
|
+
|
|
83
|
+
def stop(self):
|
|
84
|
+
"""Stop copying"""
|
|
85
|
+
self.log.debug("stopping")
|
|
86
|
+
if self.alive:
|
|
87
|
+
self.alive = False
|
|
88
|
+
self.thread_read.join()
|
|
89
|
+
self.thread_poll.join()
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
#
|
|
3
|
+
# SPDX-FileCopyrightText: 2014-2024 Fredrik Ahlberg, Angus Gratton,
|
|
4
|
+
# Espressif Systems (Shanghai) CO LTD, other contributors as noted.
|
|
5
|
+
#
|
|
6
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
+
|
|
8
|
+
# This executable script is a thin wrapper around the main functionality
|
|
9
|
+
# in the esp_rfc2217_server Python package
|
|
10
|
+
|
|
11
|
+
# When updating this script, please also update esptool.py, espefuse.py and espsecure.py
|
|
12
|
+
|
|
13
|
+
###################################################################################
|
|
14
|
+
# Redirect data from a TCP/IP connection to a serial port and vice versa using RFC 2217.
|
|
15
|
+
#
|
|
16
|
+
# This is a modified version of rfc2217_server.py provided by the pyserial package
|
|
17
|
+
# (pythonhosted.org/pyserial/examples.html#single-port-tcp-ip-serial-bridge-rfc-2217).
|
|
18
|
+
# It uses a custom PortManager to properly apply the RTS & DTR signals
|
|
19
|
+
# for resetting ESP chips.
|
|
20
|
+
#
|
|
21
|
+
# Run the following command on the server side to make
|
|
22
|
+
# connection between /dev/ttyUSB1 and TCP port 4000:
|
|
23
|
+
#
|
|
24
|
+
# python esp_rfc2217_server.py -p 4000 /dev/ttyUSB1
|
|
25
|
+
#
|
|
26
|
+
# Esptool can connect to the ESP device through that server as it is
|
|
27
|
+
# demonstrated in the following example:
|
|
28
|
+
#
|
|
29
|
+
# esptool.py --port rfc2217://localhost:4000?ign_set_control flash_id
|
|
30
|
+
#
|
|
31
|
+
|
|
32
|
+
import contextlib
|
|
33
|
+
import os
|
|
34
|
+
import sys
|
|
35
|
+
|
|
36
|
+
if os.name != "nt":
|
|
37
|
+
# Linux/macOS: remove current script directory to avoid importing this file
|
|
38
|
+
# as a module; we want to import the installed esp_rfc2217_server module instead
|
|
39
|
+
with contextlib.suppress(ValueError):
|
|
40
|
+
executable_dir = os.path.dirname(sys.executable)
|
|
41
|
+
sys.path = [
|
|
42
|
+
path
|
|
43
|
+
for path in sys.path
|
|
44
|
+
if not path.endswith(("/bin", "/sbin")) and path != executable_dir
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
# Linux/macOS: delete imported module entry to force Python to load
|
|
48
|
+
# the module from scratch; this enables importing esp_rfc2217_server module in
|
|
49
|
+
# other Python scripts
|
|
50
|
+
with contextlib.suppress(KeyError):
|
|
51
|
+
del sys.modules["esp_rfc2217_server"]
|
|
52
|
+
|
|
53
|
+
import esp_rfc2217_server
|
|
54
|
+
|
|
55
|
+
if __name__ == "__main__":
|
|
56
|
+
esp_rfc2217_server.main()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD
|
|
2
2
|
#
|
|
3
3
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
4
|
+
# PYTHON_ARGCOMPLETE_OK
|
|
4
5
|
|
|
5
6
|
import argparse
|
|
6
7
|
import os
|
|
@@ -39,13 +40,15 @@ SUPPORTED_BURN_COMMANDS = [
|
|
|
39
40
|
"execute_scripts",
|
|
40
41
|
]
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
SUPPORTED_READ_COMMANDS = [
|
|
43
44
|
"summary",
|
|
44
45
|
"dump",
|
|
45
46
|
"get_custom_mac",
|
|
46
47
|
"adc_info",
|
|
47
48
|
"check_error",
|
|
48
|
-
]
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
SUPPORTED_COMMANDS = SUPPORTED_READ_COMMANDS + SUPPORTED_BURN_COMMANDS
|
|
49
52
|
|
|
50
53
|
SUPPORTED_CHIPS = {
|
|
51
54
|
"esp32": DefChip("ESP32", esp32_efuse, esptool.targets.ESP32ROM),
|
|
@@ -94,15 +97,25 @@ def get_esp(
|
|
|
94
97
|
)
|
|
95
98
|
if not skip_connect:
|
|
96
99
|
esp.connect(connect_mode)
|
|
100
|
+
if esp.sync_stub_detected:
|
|
101
|
+
esp = esp.STUB_CLASS(esp)
|
|
97
102
|
return esp
|
|
98
103
|
|
|
99
104
|
|
|
100
|
-
def get_efuses(
|
|
105
|
+
def get_efuses(
|
|
106
|
+
esp,
|
|
107
|
+
skip_connect=False,
|
|
108
|
+
debug_mode=False,
|
|
109
|
+
do_not_confirm=False,
|
|
110
|
+
extend_efuse_table=None,
|
|
111
|
+
):
|
|
101
112
|
for name in SUPPORTED_CHIPS:
|
|
102
113
|
if SUPPORTED_CHIPS[name].chip_name == esp.CHIP_NAME:
|
|
103
114
|
efuse = SUPPORTED_CHIPS[name].efuse_lib
|
|
104
115
|
return (
|
|
105
|
-
efuse.EspEfuses(
|
|
116
|
+
efuse.EspEfuses(
|
|
117
|
+
esp, skip_connect, debug_mode, do_not_confirm, extend_efuse_table
|
|
118
|
+
),
|
|
106
119
|
efuse.operations,
|
|
107
120
|
)
|
|
108
121
|
else:
|
|
@@ -224,9 +237,15 @@ def main(custom_commandline=None, esp=None):
|
|
|
224
237
|
"(efuses which disable access to blocks or chip).",
|
|
225
238
|
action="store_true",
|
|
226
239
|
)
|
|
240
|
+
init_parser.add_argument(
|
|
241
|
+
"--extend-efuse-table",
|
|
242
|
+
help="CSV file from ESP-IDF (esp_efuse_custom_table.csv)",
|
|
243
|
+
type=argparse.FileType("r"),
|
|
244
|
+
default=None,
|
|
245
|
+
)
|
|
227
246
|
|
|
228
247
|
common_args, remaining_args = init_parser.parse_known_args(custom_commandline)
|
|
229
|
-
debug_mode = common_args.debug
|
|
248
|
+
debug_mode = common_args.debug
|
|
230
249
|
just_print_help = [
|
|
231
250
|
True for arg in remaining_args if arg in ["--help", "-h"]
|
|
232
251
|
] or remaining_args == []
|
|
@@ -253,7 +272,11 @@ def main(custom_commandline=None, esp=None):
|
|
|
253
272
|
# TODO: Require the --port argument in the next major release, ESPTOOL-490
|
|
254
273
|
|
|
255
274
|
efuses, efuse_operations = get_efuses(
|
|
256
|
-
esp,
|
|
275
|
+
esp,
|
|
276
|
+
just_print_help,
|
|
277
|
+
debug_mode,
|
|
278
|
+
common_args.do_not_confirm,
|
|
279
|
+
common_args.extend_efuse_table,
|
|
257
280
|
)
|
|
258
281
|
|
|
259
282
|
parser = argparse.ArgumentParser(parents=[init_parser])
|
|
@@ -263,6 +286,15 @@ def main(custom_commandline=None, esp=None):
|
|
|
263
286
|
|
|
264
287
|
efuse_operations.add_commands(subparsers, efuses)
|
|
265
288
|
|
|
289
|
+
# Enable argcomplete only on Unix-like systems
|
|
290
|
+
if sys.platform != "win32":
|
|
291
|
+
try:
|
|
292
|
+
import argcomplete
|
|
293
|
+
|
|
294
|
+
argcomplete.autocomplete(parser)
|
|
295
|
+
except ImportError:
|
|
296
|
+
pass
|
|
297
|
+
|
|
266
298
|
grouped_remaining_args, used_cmds = split_on_groups(remaining_args)
|
|
267
299
|
if len(grouped_remaining_args) == 0:
|
|
268
300
|
parser.print_help()
|
|
@@ -302,6 +334,22 @@ def main(custom_commandline=None, esp=None):
|
|
|
302
334
|
if not efuses.burn_all(check_batch_mode=True):
|
|
303
335
|
raise esptool.FatalError("BURN was not done")
|
|
304
336
|
print("Successful")
|
|
337
|
+
|
|
338
|
+
if (
|
|
339
|
+
sum(cmd in SUPPORTED_BURN_COMMANDS for cmd in used_cmds) > 0
|
|
340
|
+
and sum(cmd in SUPPORTED_READ_COMMANDS for cmd in used_cmds) > 0
|
|
341
|
+
):
|
|
342
|
+
# [burn_cmd1] [burn_cmd2] [read_cmd1] [burn_cmd3] [read_cmd2]
|
|
343
|
+
print("\n=== Run read commands after burn commands ===")
|
|
344
|
+
for rem_args in grouped_remaining_args:
|
|
345
|
+
args, unused_args = parser.parse_known_args(
|
|
346
|
+
rem_args, namespace=common_args
|
|
347
|
+
)
|
|
348
|
+
current_cmd = args.operation
|
|
349
|
+
if current_cmd in SUPPORTED_READ_COMMANDS:
|
|
350
|
+
print(f"\n=== Run {args.operation} command ===")
|
|
351
|
+
operation_func = vars(efuse_operations)[current_cmd]
|
|
352
|
+
operation_func(esp, efuses, args)
|
|
305
353
|
finally:
|
|
306
354
|
if not external_esp and not common_args.virt and esp._port:
|
|
307
355
|
esp._port.close()
|
|
@@ -649,6 +649,10 @@ class EspEfusesBase(object):
|
|
|
649
649
|
"""Returns (error count, failure boolean flag)"""
|
|
650
650
|
return self.blocks[block_num].num_errors, self.blocks[block_num].fail
|
|
651
651
|
|
|
652
|
+
def is_efuses_incompatible_for_burn(self):
|
|
653
|
+
# Overwrite this function for a specific target if you want to check if a certain eFuse(s) can be burned.
|
|
654
|
+
return False
|
|
655
|
+
|
|
652
656
|
|
|
653
657
|
class EfuseFieldBase(EfuseProtectBase):
|
|
654
658
|
def __init__(self, parent, param):
|