esptool 5.2.dev1__tar.gz → 5.2.dev2__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-5.2.dev1/esptool.egg-info → esptool-5.2.dev2}/PKG-INFO +2 -2
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/__init__.py +3 -3
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/base_operations.py +11 -6
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32c2.yaml +5 -2
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32c5.yaml +46 -46
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_interface.py +14 -9
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/__init__.py +6 -83
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/cli_util.py +143 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/cmds.py +39 -21
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/loader.py +22 -41
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/logger.py +2 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32c2.py +17 -8
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32c3.py +0 -2
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32c6.py +0 -2
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32h4.py +0 -2
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32p4.py +60 -2
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32s2.py +0 -2
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32s3.py +0 -2
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/1/README.md +1 -1
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32c2.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32c3.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32c5.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32c6.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32c61.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32h2.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32p4.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32p4rc1.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32s2.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp32s3.json +8 -0
- esptool-5.2.dev2/esptool/targets/stub_flasher/1/esp8266.json +8 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2/esptool.egg-info}/PKG-INFO +2 -2
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool.egg-info/requires.txt +1 -1
- {esptool-5.2.dev1 → esptool-5.2.dev2}/pyproject.toml +2 -2
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32c2.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32c3.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32c5.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32c6.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32c61.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32h2.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32p4.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32p4rc1.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32s2.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp32s3.json +0 -8
- esptool-5.2.dev1/esptool/targets/stub_flasher/1/esp8266.json +0 -8
- {esptool-5.2.dev1 → esptool-5.2.dev2}/LICENSE +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/MANIFEST.in +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/README.md +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esp_rfc2217_server/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esp_rfc2217_server/__main__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esp_rfc2217_server/esp_port_manager.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esp_rfc2217_server/redirector.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esp_rfc2217_server.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/__main__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/cli_util.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/base_fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/csv_table_parser.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/emulate_efuse_controller_base.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c2/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c2/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c2/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c2/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c2/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c3/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c3/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c3/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c3/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c3/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c5/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c5/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c5/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c5/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c5/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c6/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c6/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c6/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c6/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c6/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c61/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c61/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c61/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c61/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32c61/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h2/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h2/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h2/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h2/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h2/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h21/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h21/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h21/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h21/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h21/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h4/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h4/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h4/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h4/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32h4/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32p4/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32p4/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32p4/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32p4/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32p4/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s2/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s2/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s2/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s2/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s2/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s3/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s3/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s3/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s3/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s3/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s31/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s31/emulate_efuse_controller.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s31/fields.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s31/mem_definition.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/esp32s31/operations.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/mem_definition_base.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse/util.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32c3.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32c6.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32c61.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32h2.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32h21.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32h2_v0.0_v1.1.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32h4.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32p4.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32p4_v3.0.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32s2.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32s3.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse/efuse_defs/esp32s31.yaml +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espefuse.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espsecure/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espsecure/__main__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espsecure/esp_hsm_sign/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espsecure/esp_hsm_sign/exceptions.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/espsecure.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/__main__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/bin_image.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/config.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/reset.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/__init__.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32c5.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32c61.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32h2.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32h21.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp32s31.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/esp8266.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/LICENSE-APACHE +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/LICENSE-MIT +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/README.md +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp32.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp32c2.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp32c3.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp32c5.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp32c6.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp32c61.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp32h2.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp32p4.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp32s2.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp32s3.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/targets/stub_flasher/2/esp8266.json +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/uf2_writer.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool/util.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool.egg-info/SOURCES.txt +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool.egg-info/dependency_links.txt +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool.egg-info/entry_points.txt +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool.egg-info/top_level.txt +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/esptool.py +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/setup.cfg +0 -0
- {esptool-5.2.dev1 → esptool-5.2.dev2}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: esptool
|
|
3
|
-
Version: 5.2.
|
|
3
|
+
Version: 5.2.dev2
|
|
4
4
|
Summary: A serial utility for flashing, provisioning, and interacting with Espressif SoCs.
|
|
5
5
|
Author: Fredrik Ahlberg (themadinventor), Angus Gratton (projectgus), Espressif Systems
|
|
6
6
|
License: GPLv2+
|
|
@@ -31,7 +31,7 @@ Requires-Dist: pyserial>=3.3
|
|
|
31
31
|
Requires-Dist: reedsolo<1.8,>=1.5.3
|
|
32
32
|
Requires-Dist: PyYAML>=5.1
|
|
33
33
|
Requires-Dist: intelhex
|
|
34
|
-
Requires-Dist: rich_click<
|
|
34
|
+
Requires-Dist: rich_click<2
|
|
35
35
|
Requires-Dist: click<9
|
|
36
36
|
Provides-Extra: dev
|
|
37
37
|
Requires-Dist: pyelftools; extra == "dev"
|
|
@@ -7,7 +7,7 @@ import sys
|
|
|
7
7
|
import rich_click as click
|
|
8
8
|
|
|
9
9
|
import esptool
|
|
10
|
-
from esptool.cli_util import ChipType, ResetModeType
|
|
10
|
+
from esptool.cli_util import BaudRateType, ChipType, ResetModeType, SerialPortType
|
|
11
11
|
from esptool.logger import log
|
|
12
12
|
|
|
13
13
|
from espefuse.cli_util import Group
|
|
@@ -53,7 +53,7 @@ __all__ = [
|
|
|
53
53
|
@click.option(
|
|
54
54
|
"--baud",
|
|
55
55
|
"-b",
|
|
56
|
-
type=
|
|
56
|
+
type=BaudRateType(),
|
|
57
57
|
default=esptool.ESPLoader.ESP_ROM_BAUD,
|
|
58
58
|
envvar="ESPTOOL_BAUD",
|
|
59
59
|
help="Serial port baud rate used when flashing/reading.",
|
|
@@ -62,7 +62,7 @@ __all__ = [
|
|
|
62
62
|
"--port",
|
|
63
63
|
"-p",
|
|
64
64
|
envvar="ESPTOOL_PORT",
|
|
65
|
-
type=
|
|
65
|
+
type=SerialPortType(),
|
|
66
66
|
help="Serial port device.",
|
|
67
67
|
)
|
|
68
68
|
@click.option(
|
|
@@ -223,16 +223,21 @@ class BaseCommands:
|
|
|
223
223
|
f"({self.CHIP_NAME} != {self.esp.CHIP_NAME})"
|
|
224
224
|
)
|
|
225
225
|
|
|
226
|
+
@classmethod
|
|
227
|
+
def _close_port(
|
|
228
|
+
cls,
|
|
229
|
+
esp: esptool.ESPLoader | EmulateEfuseControllerBase | None,
|
|
230
|
+
external_esp: bool = False,
|
|
231
|
+
) -> None:
|
|
232
|
+
"""Close the serial port if it was opened internally."""
|
|
233
|
+
if esp is not None and not external_esp and isinstance(esp, esptool.ESPLoader):
|
|
234
|
+
esp._port.close()
|
|
235
|
+
|
|
226
236
|
def __enter__(self):
|
|
227
237
|
return self
|
|
228
238
|
|
|
229
239
|
def __exit__(self, exc_type, exc_value, traceback):
|
|
230
|
-
|
|
231
|
-
self.esp is not None
|
|
232
|
-
and not self.external_esp
|
|
233
|
-
and isinstance(self.esp, esptool.ESPLoader)
|
|
234
|
-
):
|
|
235
|
-
self.esp._port.close()
|
|
240
|
+
self._close_port(self.esp, self.external_esp)
|
|
236
241
|
|
|
237
242
|
################################# CLI definitions #################################
|
|
238
243
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
VER_NO:
|
|
1
|
+
VER_NO: 58a0463c13130569739af12cde638a4a
|
|
2
2
|
EFUSES:
|
|
3
3
|
WR_DIS : {show: y, blk : 0, word: 0, pos : 0, len : 8, start : 0, type : 'uint:8', wr_dis: null, rd_dis: null, alt : '', dict : '', desc: Disable programming of individual eFuses, rloc: 'EFUSE_RD_WR_DIS_REG[7:0]', bloc: B0}
|
|
4
4
|
RESERVED_0_8 : {show: n, blk : 0, word: 0, pos : 8, len : 24, start : 8, type : 'uint:24', wr_dis: null, rd_dis: null, alt : '', dict : '', desc: '', rloc: 'EFUSE_RD_WR_DIS_REG[31:8]', bloc: 'B1,B2,B3'}
|
|
@@ -49,5 +49,8 @@ EFUSES:
|
|
|
49
49
|
RESERVED_2_171 : {show: n, blk : 2, word: 5, pos: 11, len : 21, start: 171, type : 'uint:21', wr_dis : 6, rd_dis: null, alt : '', dict : '', desc: reserved, rloc: 'EFUSE_RD_BLK2_DATA5_REG[31:11]', bloc: 'B21[7:3],B22,B23'}
|
|
50
50
|
ADC_CALIBRATION_3 : {show: y, blk : 2, word: 6, pos : 0, len : 11, start: 192, type : 'uint:11', wr_dis : 6, rd_dis: null, alt : '', dict : '', desc: 'Store the bit [86:96] of ADC calibration data', rloc: 'EFUSE_RD_BLK2_DATA6_REG[10:0]', bloc: 'B24,B25[2:0]'}
|
|
51
51
|
BLK2_RESERVED_DATA_0 : {show: n, blk : 2, word: 6, pos: 11, len : 21, start: 203, type : 'uint:21', wr_dis : 6, rd_dis: null, alt : '', dict : '', desc: 'Store the bit [0:20] of block2 reserved data', rloc: 'EFUSE_RD_BLK2_DATA6_REG[31:11]', bloc: 'B25[7:3],B26,B27'}
|
|
52
|
-
|
|
52
|
+
RESERVED_2_224 : {show: n, blk : 2, word: 7, pos : 0, len : 24, start: 224, type : 'uint:24', wr_dis : 6, rd_dis: null, alt : '', dict : '', desc: reserved, rloc: 'EFUSE_RD_BLK2_DATA7_REG[23:0]', bloc: 'B28,B29,B30'}
|
|
53
|
+
FLASH_VENDOR : {show: y, blk : 2, word: 7, pos: 24, len : 3, start: 248, type : 'uint:3', wr_dis : 6, rd_dis: null, alt : '', dict : '', desc: Flash vendor, rloc: 'EFUSE_RD_BLK2_DATA7_REG[26:24]', bloc: 'B31[2:0]'}
|
|
54
|
+
FLASH_TEMP : {show: y, blk : 2, word: 7, pos: 27, len : 2, start: 251, type : 'uint:2', wr_dis : 6, rd_dis: null, alt : '', dict : '', desc: Flash temperature rating, rloc: 'EFUSE_RD_BLK2_DATA7_REG[28:27]', bloc: 'B31[4:3]'}
|
|
55
|
+
FLASH_CAP : {show: y, blk : 2, word: 7, pos: 29, len : 3, start: 253, type : 'uint:3', wr_dis : 6, rd_dis: null, alt : '', dict : '', desc: Flash capacity, rloc: 'EFUSE_RD_BLK2_DATA7_REG[31:29]', bloc: 'B31[7:5]'}
|
|
53
56
|
BLOCK_KEY0 : {show: y, blk : 3, word: 0, pos : 0, len: 256, start : 0, type: 'bytes:32', wr_dis : 7, rd_dis : 0 1, alt : KEY0, dict : '', desc: BLOCK_KEY0 - 256-bits. 256-bit key of Flash Encryption, rloc: EFUSE_RD_BLK3_DATA0_REG, bloc: 'B0,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,B12,B13,B14,B15,B16,B17,B18,B19,B20,B21,B22,B23,B24,B25,B26,B27,B28,B29,B30,B31'}
|
|
@@ -3,65 +3,65 @@ EFUSES:
|
|
|
3
3
|
WR_DIS : {show: y, blk : 0, word: 0, pos : 0, len : 32, start : 0, type : 'uint:32', wr_dis: null, rd_dis: null, alt : '', dict : '', desc: Disable programming of individual eFuses, rloc: EFUSE_RD_WR_DIS_REG, bloc: 'B0,B1,B2,B3'}
|
|
4
4
|
RD_DIS : {show: y, blk : 0, word: 1, pos : 0, len : 7, start : 32, type : 'uint:7', wr_dis : 0, rd_dis: null, alt : '', dict : '', desc: Disable reading from BlOCK4-10, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[6:0]', bloc: 'B4[6:0]'}
|
|
5
5
|
BOOTLOADER_ANTI_ROLLBACK_SECURE_VERSION_HI: {show: y, blk : 0, word: 1, pos : 7, len : 1, start : 39, type : bool, wr_dis: null, rd_dis: null, alt : '', dict : '', desc: Represents the anti-rollback secure version of the 2nd stage bootloader used by the ROM bootloader (the high part of the field), rloc: 'EFUSE_RD_REPEAT_DATA0_REG[7]', bloc: 'B4[7]'}
|
|
6
|
-
DIS_ICACHE : {show: y, blk : 0, word: 1, pos : 8, len : 1, start : 40, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict
|
|
7
|
-
DIS_USB_JTAG : {show: y, blk : 0, word: 1, pos : 9, len : 1, start : 41, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict
|
|
8
|
-
BOOTLOADER_ANTI_ROLLBACK_EN : {show: y, blk : 0, word: 1, pos: 10, len : 1, start : 42, type : bool, wr_dis: null, rd_dis: null, alt : '', dict
|
|
9
|
-
DIS_USB_SERIAL_JTAG : {show: n, blk : 0, word: 1, pos: 11, len : 1, start : 43, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict
|
|
10
|
-
DIS_FORCE_DOWNLOAD : {show: y, blk : 0, word: 1, pos: 12, len : 1, start : 44, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict
|
|
11
|
-
SPI_DOWNLOAD_MSPI_DIS : {show: y, blk : 0, word: 1, pos: 13, len : 1, start : 45, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict
|
|
12
|
-
DIS_TWAI : {show: y, blk : 0, word: 1, pos: 14, len : 1, start : 46, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict
|
|
13
|
-
JTAG_SEL_ENABLE : {show: y, blk : 0, word: 1, pos: 15, len : 1, start : 47, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict
|
|
14
|
-
SOFT_DIS_JTAG : {show: y, blk : 0, word: 1, pos: 16, len : 3, start : 48, type : 'uint:3', wr_dis : 31, rd_dis: null, alt : '', dict : '', desc: 'Represents whether PAD JTAG is disabled in the soft way. It can be restarted via HMAC. Odd count of bits with a value of 1:
|
|
15
|
-
DIS_PAD_JTAG : {show: y, blk : 0, word: 1, pos: 19, len : 1, start : 51, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict
|
|
16
|
-
DIS_DOWNLOAD_MANUAL_ENCRYPT : {show: y, blk : 0, word: 1, pos: 20, len : 1, start : 52, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict
|
|
6
|
+
DIS_ICACHE : {show: y, blk : 0, word: 1, pos : 8, len : 1, start : 40, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict: '{0: "Enabled", 1: "Disabled"}', desc: Represents whether cache is disabled, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[8]', bloc: 'B5[0]'}
|
|
7
|
+
DIS_USB_JTAG : {show: y, blk : 0, word: 1, pos : 9, len : 1, start : 41, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict: '{0: "Enabled", 1: "Disabled"}', desc: 'Represents whether the USB-to-JTAG function in USB Serial/JTAG is disabled. Note that EFUSE_DIS_USB_JTAG is available only when EFUSE_DIS_USB_SERIAL_JTAG is configured to 0', rloc: 'EFUSE_RD_REPEAT_DATA0_REG[9]', bloc: 'B5[1]'}
|
|
8
|
+
BOOTLOADER_ANTI_ROLLBACK_EN : {show: y, blk : 0, word: 1, pos: 10, len : 1, start : 42, type : bool, wr_dis: null, rd_dis: null, alt : '', dict: '{0: "Disabled", 1: "Enabled"}', desc: Represents whether the ani-rollback check for the 2nd stage bootloader is enabled, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[10]', bloc: 'B5[2]'}
|
|
9
|
+
DIS_USB_SERIAL_JTAG : {show: n, blk : 0, word: 1, pos: 11, len : 1, start : 43, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict: '{0: "Enabled", 1: "Disabled"}', desc: Represents whether USB Serial/JTAG is disabled, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[11]', bloc: 'B5[3]'}
|
|
10
|
+
DIS_FORCE_DOWNLOAD : {show: y, blk : 0, word: 1, pos: 12, len : 1, start : 44, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict: '{0: "Enabled", 1: "Disabled"}', desc: Represents whether the function that forces chip into Download mode is disabled, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[12]', bloc: 'B5[4]'}
|
|
11
|
+
SPI_DOWNLOAD_MSPI_DIS : {show: y, blk : 0, word: 1, pos: 13, len : 1, start : 45, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict: '{0: "Enabled", 1: "Disabled"}', desc: Represents whether SPI0 controller during boot_mode_download is disabled, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[13]', bloc: 'B5[5]'}
|
|
12
|
+
DIS_TWAI : {show: y, blk : 0, word: 1, pos: 14, len : 1, start : 46, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict: '{0: "Enabled", 1: "Disabled"}', desc: Represents whether TWAI function is disabled, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[14]', bloc: 'B5[6]'}
|
|
13
|
+
JTAG_SEL_ENABLE : {show: y, blk : 0, word: 1, pos: 15, len : 1, start : 47, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict: '{0: "Disabled", 1: "Enabled"}', desc: 'Represents whether the selection of a JTAG signal source through the strapping pin value is enabled when all of EFUSE_DIS_PAD_JTAG; EFUSE_DIS_USB_JTAG and EFUSE_DIS_USB_SERIAL_JTAG are configured to 0', rloc: 'EFUSE_RD_REPEAT_DATA0_REG[15]', bloc: 'B5[7]'}
|
|
14
|
+
SOFT_DIS_JTAG : {show: y, blk : 0, word: 1, pos: 16, len : 3, start : 48, type : 'uint:3', wr_dis : 31, rd_dis: null, alt : '', dict : '', desc: 'Represents whether PAD JTAG is disabled in the soft way. It can be restarted via HMAC. Odd count of bits with a value of 1: Disabled; Even count of bits with a value of 1: Enabled', rloc: 'EFUSE_RD_REPEAT_DATA0_REG[18:16]', bloc: 'B6[2:0]'}
|
|
15
|
+
DIS_PAD_JTAG : {show: y, blk : 0, word: 1, pos: 19, len : 1, start : 51, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict: '{0: "Enabled", 1: "Disabled"}', desc: Represents whether PAD JTAG is disabled in the hard way (permanently), rloc: 'EFUSE_RD_REPEAT_DATA0_REG[19]', bloc: 'B6[3]'}
|
|
16
|
+
DIS_DOWNLOAD_MANUAL_ENCRYPT : {show: y, blk : 0, word: 1, pos: 20, len : 1, start : 52, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict: '{0: "Enabled", 1: "Disabled"}', desc: Represents whether flash encryption is disabled (except in SPI boot mode), rloc: 'EFUSE_RD_REPEAT_DATA0_REG[20]', bloc: 'B6[4]'}
|
|
17
17
|
USB_DREFH : {show: n, blk : 0, word: 1, pos: 21, len : 2, start : 53, type : 'uint:2', wr_dis : 30, rd_dis: null, alt : '', dict : '', desc: Represents the single-end input threshold vrefh; 1.76 V to 2 V with step of 80 mV, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[22:21]', bloc: 'B6[6:5]'}
|
|
18
18
|
USB_DREFL : {show: n, blk : 0, word: 1, pos: 23, len : 2, start : 55, type : 'uint:2', wr_dis : 30, rd_dis: null, alt : '', dict : '', desc: Represents the single-end input threshold vrefl; 1.76 V to 2 V with step of 80 mV, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[24:23]', bloc: 'B6[7],B7[0]'}
|
|
19
|
-
USB_EXCHG_PINS : {show: y, blk : 0, word: 1, pos: 25, len : 1, start : 57, type : bool, wr_dis : 30, rd_dis: null, alt : '', dict
|
|
20
|
-
VDD_SPI_AS_GPIO : {show: y, blk : 0, word: 1, pos: 26, len : 1, start : 58, type : bool, wr_dis : 30, rd_dis: null, alt : '', dict
|
|
21
|
-
WDT_DELAY_SEL : {show: y, blk : 0, word: 1, pos: 27, len : 2, start : 59, type : 'uint:2', wr_dis : 3, rd_dis: null, alt : '', dict : '', desc: "Represents RTC watchdog timeout threshold.
|
|
19
|
+
USB_EXCHG_PINS : {show: y, blk : 0, word: 1, pos: 25, len : 1, start : 57, type : bool, wr_dis : 30, rd_dis: null, alt : '', dict: '{0: "Not exchanged", 1: "Exchanged"}', desc: Represents whether the D+ and D- pins is exchanged, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[25]', bloc: 'B7[1]'}
|
|
20
|
+
VDD_SPI_AS_GPIO : {show: y, blk : 0, word: 1, pos: 26, len : 1, start : 58, type : bool, wr_dis : 30, rd_dis: null, alt : '', dict: '{0: "Not functioned", 1: "Functioned"}', desc: Represents whether VDD SPI pin is functioned as GPIO, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[26]', bloc: 'B7[2]'}
|
|
21
|
+
WDT_DELAY_SEL : {show: y, blk : 0, word: 1, pos: 27, len : 2, start : 59, type : 'uint:2', wr_dis : 3, rd_dis: null, alt : '', dict : '', desc: "Represents RTC watchdog timeout threshold. The originally configured STG0 threshold * (2 ^ (EFUSE_WDT_DELAY_SEL + 1))", rloc: 'EFUSE_RD_REPEAT_DATA0_REG[28:27]', bloc: 'B7[4:3]'}
|
|
22
22
|
BOOTLOADER_ANTI_ROLLBACK_SECURE_VERSION_LO: {show: y, blk : 0, word: 1, pos: 29, len : 3, start : 61, type : 'uint:3', wr_dis: null, rd_dis: null, alt : '', dict : '', desc: Represents the anti-rollback secure version of the 2nd stage bootloader used by the ROM bootloader (the low part of the field), rloc: 'EFUSE_RD_REPEAT_DATA0_REG[31:29]', bloc: 'B7[7:5]'}
|
|
23
|
-
KM_DISABLE_DEPLOY_MODE : {show: y, blk : 0, word: 2, pos : 0, len : 4, start : 64, type : 'uint:4', wr_dis : 1, rd_dis: null, alt : '', dict : '', desc: 'Represents whether the new key deployment of key manager is disabled. Bit0:
|
|
24
|
-
KM_RND_SWITCH_CYCLE : {show: y, blk : 0, word: 2, pos : 4, len : 2, start : 68, type : 'uint:2', wr_dis : 1, rd_dis: null, alt : '', dict
|
|
25
|
-
KM_DEPLOY_ONLY_ONCE : {show: y, blk : 0, word: 2, pos : 6, len : 4, start : 70, type : 'uint:4', wr_dis : 1, rd_dis: null, alt : '', dict : '', desc: 'Represents whether the corresponding key can be deployed only once.Bit0:
|
|
26
|
-
FORCE_USE_KEY_MANAGER_KEY : {show: y, blk : 0, word: 2, pos: 10, len : 4, start : 74, type : 'uint:4', wr_dis : 1, rd_dis: null, alt : '', dict : '', desc: 'Represents whether the corresponding key must come from Key Manager. Bit0:
|
|
27
|
-
FORCE_DISABLE_SW_INIT_KEY : {show: y, blk : 0, word: 2, pos: 14, len : 1, start : 78, type : bool, wr_dis : 1, rd_dis: null, alt : '', dict
|
|
28
|
-
BOOTLOADER_ANTI_ROLLBACK_UPDATE_IN_ROM : {show: y, blk : 0, word: 2, pos: 15, len : 1, start : 79, type : bool, wr_dis: null, rd_dis: null, alt : '', dict
|
|
23
|
+
KM_DISABLE_DEPLOY_MODE : {show: y, blk : 0, word: 2, pos : 0, len : 4, start : 64, type : 'uint:4', wr_dis : 1, rd_dis: null, alt : '', dict : '', desc: 'Represents whether the new key deployment of key manager is disabled. Bit0: ECDSA key deployment (0: Enabled, 1: Disabled). Bit1: XTS-AES (flash and PSRAM) key deployment (0: Enabled, 1: Disabled). Bit2: HMAC key deployment (0: Enabled, 1: Disabled). Bit3: DS key deployment (0: Enabled, 1: Disabled)', rloc: 'EFUSE_RD_REPEAT_DATA1_REG[3:0]', bloc: 'B8[3:0]'}
|
|
24
|
+
KM_RND_SWITCH_CYCLE : {show: y, blk : 0, word: 2, pos : 4, len : 2, start : 68, type : 'uint:2', wr_dis : 1, rd_dis: null, alt : '', dict: '{0: "Controlled by the KEYMNG_RND_SWITCH_CYCLE register", 1: "8 Key Manager clock cycles", 2: "16 Key Manager clock cycles", 3: "32 Key Manager clock cycles"}', desc: Represents the cycle at which the Key Manager switches random numbers, rloc: 'EFUSE_RD_REPEAT_DATA1_REG[5:4]', bloc: 'B8[5:4]'}
|
|
25
|
+
KM_DEPLOY_ONLY_ONCE : {show: y, blk : 0, word: 2, pos : 6, len : 4, start : 70, type : 'uint:4', wr_dis : 1, rd_dis: null, alt : '', dict : '', desc: 'Represents whether the corresponding key can be deployed only once. Bit0: ECDSA key (0: Multiple times, 1: Only once). Bit1: XTS-AES (flash and PSRAM) key (0: Multiple times, 1: Only once). Bit2: HMAC key (0: Multiple times, 1: Only once). Bit3: DS key (0: Multiple times, 1: Only once)', rloc: 'EFUSE_RD_REPEAT_DATA1_REG[9:6]', bloc: 'B8[7:6],B9[1:0]'}
|
|
26
|
+
FORCE_USE_KEY_MANAGER_KEY : {show: y, blk : 0, word: 2, pos: 10, len : 4, start : 74, type : 'uint:4', wr_dis : 1, rd_dis: null, alt : '', dict : '', desc: 'Represents whether the corresponding key must come from Key Manager. Bit0: ECDSA key (0: Not required, 1: Required). Bit1: XTS-AES (flash and PSRAM) key (0: Not required, 1: Required). Bit2: HMAC key (0: Not required, 1: Required). Bit3: DS key (0: Not required, 1: Required)', rloc: 'EFUSE_RD_REPEAT_DATA1_REG[13:10]', bloc: 'B9[5:2]'}
|
|
27
|
+
FORCE_DISABLE_SW_INIT_KEY : {show: y, blk : 0, word: 2, pos: 14, len : 1, start : 78, type : bool, wr_dis : 1, rd_dis: null, alt : '', dict: '{0: "Enable", 1: "Disable"}', desc: Represents whether to disable the use of the initialization key written by software and instead force use efuse_init_key, rloc: 'EFUSE_RD_REPEAT_DATA1_REG[14]', bloc: 'B9[6]'}
|
|
28
|
+
BOOTLOADER_ANTI_ROLLBACK_UPDATE_IN_ROM : {show: y, blk : 0, word: 2, pos: 15, len : 1, start : 79, type : bool, wr_dis: null, rd_dis: null, alt : '', dict: '{0: "Disable", 1: "Enable"}', desc: Represents whether the ani-rollback SECURE_VERSION will be updated from the ROM bootloader, rloc: 'EFUSE_RD_REPEAT_DATA1_REG[15]', bloc: 'B9[7]'}
|
|
29
29
|
SPI_BOOT_CRYPT_CNT : {show: y, blk : 0, word: 2, pos: 16, len : 3, start : 80, type : 'uint:3', wr_dis : 4, rd_dis: null, alt : '', dict: '{0: "Disable", 1: "Enable", 3: "Disable", 7: "Enable"}', desc: Enables flash encryption when 1 or 3 bits are set and disables otherwise, rloc: 'EFUSE_RD_REPEAT_DATA1_REG[18:16]', bloc: 'B10[2:0]'}
|
|
30
30
|
SECURE_BOOT_KEY_REVOKE0 : {show: y, blk : 0, word: 2, pos: 19, len : 1, start : 83, type : bool, wr_dis : 5, rd_dis: null, alt : '', dict : '', desc: Revoke 1st secure boot key, rloc: 'EFUSE_RD_REPEAT_DATA1_REG[19]', bloc: 'B10[3]'}
|
|
31
31
|
SECURE_BOOT_KEY_REVOKE1 : {show: y, blk : 0, word: 2, pos: 20, len : 1, start : 84, type : bool, wr_dis : 6, rd_dis: null, alt : '', dict : '', desc: Revoke 2nd secure boot key, rloc: 'EFUSE_RD_REPEAT_DATA1_REG[20]', bloc: 'B10[4]'}
|
|
32
32
|
SECURE_BOOT_KEY_REVOKE2 : {show: y, blk : 0, word: 2, pos: 21, len : 1, start : 85, type : bool, wr_dis : 7, rd_dis: null, alt : '', dict : '', desc: Revoke 3rd secure boot key, rloc: 'EFUSE_RD_REPEAT_DATA1_REG[21]', bloc: 'B10[5]'}
|
|
33
|
-
KEY_PURPOSE_0 : {show: y, blk : 0, word: 2, pos: 22, len : 5, start : 86, type : 'uint:5', wr_dis : 8, rd_dis: null, alt : KEY0_PURPOSE, dict : '', desc: 'Represents the purpose of Key0.
|
|
34
|
-
KEY_PURPOSE_1 : {show: y, blk : 0, word: 2, pos: 27, len : 5, start : 91, type : 'uint:5', wr_dis : 9, rd_dis: null, alt : KEY1_PURPOSE, dict : '', desc: 'Represents the purpose of Key1.
|
|
35
|
-
KEY_PURPOSE_2 : {show: y, blk : 0, word: 3, pos : 0, len : 5, start : 96, type : 'uint:5', wr_dis : 10, rd_dis: null, alt : KEY2_PURPOSE, dict : '', desc: 'Represents the purpose of Key2.
|
|
36
|
-
KEY_PURPOSE_3 : {show: y, blk : 0, word: 3, pos : 5, len : 5, start: 101, type : 'uint:5', wr_dis : 11, rd_dis: null, alt : KEY3_PURPOSE, dict : '', desc: 'Represents the purpose of Key3.
|
|
37
|
-
KEY_PURPOSE_4 : {show: y, blk : 0, word: 3, pos: 10, len : 5, start: 106, type : 'uint:5', wr_dis : 12, rd_dis: null, alt : KEY4_PURPOSE, dict : '', desc: 'Represents the purpose of Key4.
|
|
38
|
-
KEY_PURPOSE_5 : {show: y, blk : 0, word: 3, pos: 15, len : 5, start: 111, type : 'uint:5', wr_dis : 13, rd_dis: null, alt : KEY5_PURPOSE, dict : '', desc: 'Represents the purpose of Key5.
|
|
39
|
-
SEC_DPA_LEVEL : {show: y, blk : 0, word: 3, pos: 20, len : 2, start: 116, type : 'uint:2', wr_dis : 14, rd_dis: null, alt : '', dict
|
|
33
|
+
KEY_PURPOSE_0 : {show: y, blk : 0, word: 2, pos: 22, len : 5, start : 86, type : 'uint:5', wr_dis : 8, rd_dis: null, alt : KEY0_PURPOSE, dict : '', desc: 'Represents the purpose of Key0.', rloc: 'EFUSE_RD_REPEAT_DATA1_REG[26:22]', bloc: 'B10[7:6],B11[2:0]'}
|
|
34
|
+
KEY_PURPOSE_1 : {show: y, blk : 0, word: 2, pos: 27, len : 5, start : 91, type : 'uint:5', wr_dis : 9, rd_dis: null, alt : KEY1_PURPOSE, dict : '', desc: 'Represents the purpose of Key1.', rloc: 'EFUSE_RD_REPEAT_DATA1_REG[31:27]', bloc: 'B11[7:3]'}
|
|
35
|
+
KEY_PURPOSE_2 : {show: y, blk : 0, word: 3, pos : 0, len : 5, start : 96, type : 'uint:5', wr_dis : 10, rd_dis: null, alt : KEY2_PURPOSE, dict : '', desc: 'Represents the purpose of Key2.', rloc: 'EFUSE_RD_REPEAT_DATA2_REG[4:0]', bloc: 'B12[4:0]'}
|
|
36
|
+
KEY_PURPOSE_3 : {show: y, blk : 0, word: 3, pos : 5, len : 5, start: 101, type : 'uint:5', wr_dis : 11, rd_dis: null, alt : KEY3_PURPOSE, dict : '', desc: 'Represents the purpose of Key3.', rloc: 'EFUSE_RD_REPEAT_DATA2_REG[9:5]', bloc: 'B12[7:5],B13[1:0]'}
|
|
37
|
+
KEY_PURPOSE_4 : {show: y, blk : 0, word: 3, pos: 10, len : 5, start: 106, type : 'uint:5', wr_dis : 12, rd_dis: null, alt : KEY4_PURPOSE, dict : '', desc: 'Represents the purpose of Key4.', rloc: 'EFUSE_RD_REPEAT_DATA2_REG[14:10]', bloc: 'B13[6:2]'}
|
|
38
|
+
KEY_PURPOSE_5 : {show: y, blk : 0, word: 3, pos: 15, len : 5, start: 111, type : 'uint:5', wr_dis : 13, rd_dis: null, alt : KEY5_PURPOSE, dict : '', desc: 'Represents the purpose of Key5.', rloc: 'EFUSE_RD_REPEAT_DATA2_REG[19:15]', bloc: 'B13[7],B14[3:0]'}
|
|
39
|
+
SEC_DPA_LEVEL : {show: y, blk : 0, word: 3, pos: 20, len : 2, start: 116, type : 'uint:2', wr_dis : 14, rd_dis: null, alt : '', dict: '{0: "SEC_DPA_OFF", 1: "SEC_DPA_LOW", 2: "SEC_DPA_MIDDLE", 3: "SEC_DPA_HIGH"}', desc: Represents the security level of anti-DPA attack. The level is adjusted by configuring the clock random frequency division mode, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[21:20]', bloc: 'B14[5:4]'}
|
|
40
40
|
RECOVERY_BOOTLOADER_FLASH_SECTOR_HI : {show: y, blk : 0, word: 3, pos: 22, len : 3, start: 118, type : 'uint:3', wr_dis: null, rd_dis: null, alt : '', dict : '', desc: Represents the starting flash sector (flash sector size is 0x1000) of the recovery bootloader used by the ROM bootloader If the primary bootloader fails. 0 and 0xFFF - this feature is disabled. (The high part of the field), rloc: 'EFUSE_RD_REPEAT_DATA2_REG[24:22]', bloc: 'B14[7:6],B15[0]'}
|
|
41
|
-
SECURE_BOOT_EN : {show: y, blk : 0, word: 3, pos: 25, len : 1, start: 121, type : bool, wr_dis : 15, rd_dis: null, alt : '', dict
|
|
42
|
-
SECURE_BOOT_AGGRESSIVE_REVOKE : {show: y, blk : 0, word: 3, pos: 26, len : 1, start: 122, type : bool, wr_dis : 16, rd_dis: null, alt : '', dict
|
|
43
|
-
KM_XTS_KEY_LENGTH_256 : {show: y, blk : 0, word: 3, pos: 27, len : 1, start: 123, type : bool, wr_dis : 1, rd_dis: null, alt : '', dict
|
|
41
|
+
SECURE_BOOT_EN : {show: y, blk : 0, word: 3, pos: 25, len : 1, start: 121, type : bool, wr_dis : 15, rd_dis: null, alt : '', dict: '{0: "Disabled", 1: "Enabled"}', desc: Represents whether Secure Boot is enabled, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[25]', bloc: 'B15[1]'}
|
|
42
|
+
SECURE_BOOT_AGGRESSIVE_REVOKE : {show: y, blk : 0, word: 3, pos: 26, len : 1, start: 122, type : bool, wr_dis : 16, rd_dis: null, alt : '', dict: '{0: "Disabled", 1: "Enabled"}', desc: Represents whether aggressive revocation of Secure Boot is enabled, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[26]', bloc: 'B15[2]'}
|
|
43
|
+
KM_XTS_KEY_LENGTH_256 : {show: y, blk : 0, word: 3, pos: 27, len : 1, start: 123, type : bool, wr_dis : 1, rd_dis: null, alt : '', dict: '{0: "XTS-AES-256 key", 1: "XTS-AES-128 key"}', desc: Represents which key flash encryption uses, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[27]', bloc: 'B15[3]'}
|
|
44
44
|
FLASH_TPUW : {show: y, blk : 0, word: 3, pos: 28, len : 4, start: 124, type : 'uint:4', wr_dis : 18, rd_dis: null, alt : '', dict : '', desc: 'Represents the flash waiting time after power-up. Measurement unit: ms. When the value is less than 15; the waiting time is the programmed value. Otherwise; the waiting time is a fixed value; i.e. 30 ms', rloc: 'EFUSE_RD_REPEAT_DATA2_REG[31:28]', bloc: 'B15[7:4]'}
|
|
45
|
-
DIS_DOWNLOAD_MODE : {show: y, blk : 0, word: 4, pos : 0, len : 1, start: 128, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict
|
|
46
|
-
DIS_DIRECT_BOOT : {show: y, blk : 0, word: 4, pos : 1, len : 1, start: 129, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict
|
|
47
|
-
DIS_USB_SERIAL_JTAG_ROM_PRINT : {show: y, blk : 0, word: 4, pos : 2, len : 1, start: 130, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict
|
|
48
|
-
LOCK_KM_KEY : {show: y, blk : 0, word: 4, pos : 3, len : 1, start: 131, type : bool, wr_dis : 1, rd_dis: null, alt : '', dict
|
|
49
|
-
DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE : {show: y, blk : 0, word: 4, pos : 4, len : 1, start: 132, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict
|
|
50
|
-
ENABLE_SECURITY_DOWNLOAD : {show: y, blk : 0, word: 4, pos : 5, len : 1, start: 133, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict
|
|
51
|
-
UART_PRINT_CONTROL : {show: y, blk : 0, word: 4, pos : 6, len : 2, start: 134, type : 'uint:2', wr_dis : 18, rd_dis: null, alt : '', dict: '{0: "Enable", 1: "Enable when GPIO8 is low at reset", 2: "Enable when GPIO8 is high at reset", 3: "Disable"}', desc: Set the default
|
|
52
|
-
FORCE_SEND_RESUME : {show: y, blk : 0, word: 4, pos : 8, len : 1, start: 136, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict
|
|
45
|
+
DIS_DOWNLOAD_MODE : {show: y, blk : 0, word: 4, pos : 0, len : 1, start: 128, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict: '{0: "Enable", 1: "Disable"}', desc: Represents whether Download mode is disable or enable, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[0]', bloc: 'B16[0]'}
|
|
46
|
+
DIS_DIRECT_BOOT : {show: y, blk : 0, word: 4, pos : 1, len : 1, start: 129, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict: '{0: "Enable", 1: "Disable"}', desc: Represents whether direct boot mode is disabled or enabled, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[1]', bloc: 'B16[1]'}
|
|
47
|
+
DIS_USB_SERIAL_JTAG_ROM_PRINT : {show: y, blk : 0, word: 4, pos : 2, len : 1, start: 130, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict: '{0: "Enable", 1: "Disable"}', desc: Represents whether print from USB-Serial-JTAG is disabled or enabled, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[2]', bloc: 'B16[2]'}
|
|
48
|
+
LOCK_KM_KEY : {show: y, blk : 0, word: 4, pos : 3, len : 1, start: 131, type : bool, wr_dis : 1, rd_dis: null, alt : '', dict: '{0: "Not locked", 1: "Locked"}', desc: Represents whether the keys in the Key Manager are locked after deployment, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[3]', bloc: 'B16[3]'}
|
|
49
|
+
DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE : {show: y, blk : 0, word: 4, pos : 4, len : 1, start: 132, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict: '{0: "Enable", 1: "Disable"}', desc: Represents whether the USB-Serial-JTAG download function is disabled or enabled, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[4]', bloc: 'B16[4]'}
|
|
50
|
+
ENABLE_SECURITY_DOWNLOAD : {show: y, blk : 0, word: 4, pos : 5, len : 1, start: 133, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict: '{0: "Disabled", 1: "Enabled"}', desc: 'Represents whether security download is enabled. Only downloading into flash is supported. Reading/writing RAM or registers is not supported (i.e. stub download is not supported)', rloc: 'EFUSE_RD_REPEAT_DATA3_REG[5]', bloc: 'B16[5]'}
|
|
51
|
+
UART_PRINT_CONTROL : {show: y, blk : 0, word: 4, pos : 6, len : 2, start: 134, type : 'uint:2', wr_dis : 18, rd_dis: null, alt : '', dict: '{0: "Enable", 1: "Enable when GPIO8 is low at reset", 2: "Enable when GPIO8 is high at reset", 3: "Disable"}', desc: Set the default UART boot message output mode, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[7:6]', bloc: 'B16[7:6]'}
|
|
52
|
+
FORCE_SEND_RESUME : {show: y, blk : 0, word: 4, pos : 8, len : 1, start: 136, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict: '{0: "Not forced", 1: "Forced"}', desc: Represents whether ROM code is forced to send a resume command during SPI boot, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[8]', bloc: 'B17[0]'}
|
|
53
53
|
SECURE_VERSION : {show: y, blk : 0, word: 4, pos : 9, len : 9, start: 137, type : 'uint:9', wr_dis : 18, rd_dis: null, alt : '', dict : '', desc: Represents the app secure version used by ESP-IDF anti-rollback feature, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[17:9]', bloc: 'B17[7:1],B18[1:0]'}
|
|
54
54
|
RESERVE_0_146 : {show: n, blk : 0, word: 4, pos: 18, len : 7, start: 146, type : 'uint:7', wr_dis: null, rd_dis: null, alt : '', dict : '', desc: Reserved; it was created by set_missed_fields_in_regs func, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[24:18]', bloc: 'B18[7:2],B19[0]'}
|
|
55
|
-
SECURE_BOOT_DISABLE_FAST_WAKE : {show: y, blk : 0, word: 4, pos: 25, len : 1, start: 153, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict
|
|
56
|
-
HYS_EN_PAD : {show: y, blk : 0, word: 4, pos: 26, len : 1, start: 154, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict
|
|
57
|
-
XTS_DPA_PSEUDO_LEVEL : {show: y, blk : 0, word: 4, pos: 27, len : 2, start: 155, type : 'uint:2', wr_dis : 14, rd_dis: null, alt : '', dict
|
|
58
|
-
XTS_DPA_CLK_ENABLE : {show: y, blk : 0, word: 4, pos: 29, len : 1, start: 157, type : bool, wr_dis : 14, rd_dis: null, alt : '', dict
|
|
55
|
+
SECURE_BOOT_DISABLE_FAST_WAKE : {show: y, blk : 0, word: 4, pos: 25, len : 1, start: 153, type : bool, wr_dis : 18, rd_dis: null, alt : '', dict: '{0: "Enabled", 1: "Disabled"}', desc: Represents whether FAST VERIFY ON WAKE is disabled when Secure Boot is enabled, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[25]', bloc: 'B19[1]'}
|
|
56
|
+
HYS_EN_PAD : {show: y, blk : 0, word: 4, pos: 26, len : 1, start: 154, type : bool, wr_dis : 2, rd_dis: null, alt : '', dict: '{0: "Disabled", 1: "Enabled"}', desc: Represents whether the hysteresis function of PAD0 - PAD27 is enabled, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[26]', bloc: 'B19[2]'}
|
|
57
|
+
XTS_DPA_PSEUDO_LEVEL : {show: y, blk : 0, word: 4, pos: 27, len : 2, start: 155, type : 'uint:2', wr_dis : 14, rd_dis: null, alt : '', dict: '{0: "Disabled", 1: "Low", 2: "Moderate", 3: "High"}', desc: Represents the pseudo round level of XTS-AES anti-DPA attack, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[28:27]', bloc: 'B19[4:3]'}
|
|
58
|
+
XTS_DPA_CLK_ENABLE : {show: y, blk : 0, word: 4, pos: 29, len : 1, start: 157, type : bool, wr_dis : 14, rd_dis: null, alt : '', dict: '{0: "Disable", 1: "Enabled"}', desc: Represents whether XTS-AES anti-DPA attack clock is enabled, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[29]', bloc: 'B19[5]'}
|
|
59
59
|
RESERVE_0_158 : {show: n, blk : 0, word: 4, pos: 30, len : 1, start: 158, type : bool, wr_dis: null, rd_dis: null, alt : '', dict : '', desc: Reserved; it was created by set_missed_fields_in_regs func, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[30]', bloc: 'B19[6]'}
|
|
60
60
|
SECURE_BOOT_SHA384_EN : {show: y, blk : 0, word: 4, pos: 31, len : 1, start: 159, type : bool, wr_dis : 14, rd_dis: null, alt : '', dict : '', desc: Represents if the chip supports Secure Boot using SHA-384, rloc: 'EFUSE_RD_REPEAT_DATA3_REG[31]', bloc: 'B19[7]'}
|
|
61
|
-
HUK_GEN_STATE : {show: y, blk : 0, word: 5, pos : 0, len : 9, start: 160, type : 'uint:9', wr_dis : 19, rd_dis: null, alt : '', dict : '', desc: 'Represents whether the HUK generate mode is valid.Odd count of bits with a value of 1:
|
|
62
|
-
XTAL_48M_SEL : {show: y, blk : 0, word: 5, pos : 9, len : 3, start: 169, type : 'uint:3', wr_dis : 17, rd_dis: null, alt : '', dict : '', desc: 'Represents whether XTAL frequency is 48MHz or not. If not; 40MHz XTAL will be used. If this field contains Odd number bit 1: Enable 48MHz XTAL
|
|
63
|
-
XTAL_48M_SEL_MODE : {show: y, blk : 0, word: 5, pos: 12, len : 1, start: 172, type : bool, wr_dis : 17, rd_dis: null, alt : '', dict
|
|
64
|
-
ECC_FORCE_CONST_TIME : {show: y, blk : 0, word: 5, pos: 13, len : 1, start: 173, type : bool, wr_dis : 14, rd_dis: null, alt : '', dict
|
|
61
|
+
HUK_GEN_STATE : {show: y, blk : 0, word: 5, pos : 0, len : 9, start: 160, type : 'uint:9', wr_dis : 19, rd_dis: null, alt : '', dict : '', desc: 'Represents whether the HUK generate mode is valid. Odd count of bits with a value of 1: Invalid; Even count of bits with a value of 1: Valid', rloc: 'EFUSE_RD_REPEAT_DATA4_REG[8:0]', bloc: 'B20,B21[0]'}
|
|
62
|
+
XTAL_48M_SEL : {show: y, blk : 0, word: 5, pos : 9, len : 3, start: 169, type : 'uint:3', wr_dis : 17, rd_dis: null, alt : '', dict : '', desc: 'Represents whether XTAL frequency is 48MHz or not. If not; 40MHz XTAL will be used. If this field contains Odd number bit 1: Enable 48MHz XTAL; Even number bit 1: Enable 40MHz XTAL', rloc: 'EFUSE_RD_REPEAT_DATA4_REG[11:9]', bloc: 'B21[3:1]'}
|
|
63
|
+
XTAL_48M_SEL_MODE : {show: y, blk : 0, word: 5, pos: 12, len : 1, start: 172, type : bool, wr_dis : 17, rd_dis: null, alt : '', dict: '{0: "Strapping PAD state", 1: "EFUSE_XTAL_48M_SEL in eFuse"}', desc: Represents what determines the XTAL frequency in Joint Download Boot mode, rloc: 'EFUSE_RD_REPEAT_DATA4_REG[12]', bloc: 'B21[4]'}
|
|
64
|
+
ECC_FORCE_CONST_TIME : {show: y, blk : 0, word: 5, pos: 13, len : 1, start: 173, type : bool, wr_dis : 14, rd_dis: null, alt : '', dict: '{0: "Not force", 1: "Force"}', desc: Represents whether to force ECC to use constant-time mode for point multiplication calculation, rloc: 'EFUSE_RD_REPEAT_DATA4_REG[13]', bloc: 'B21[5]'}
|
|
65
65
|
RECOVERY_BOOTLOADER_FLASH_SECTOR_LO : {show: y, blk : 0, word: 5, pos: 14, len : 9, start: 174, type : 'uint:9', wr_dis: null, rd_dis: null, alt : '', dict : '', desc: Represents the starting flash sector (flash sector size is 0x1000) of the recovery bootloader used by the ROM bootloader If the primary bootloader fails. 0 and 0xFFF - this feature is disabled. (The low part of the field), rloc: 'EFUSE_RD_REPEAT_DATA4_REG[22:14]', bloc: 'B21[7:6],B22[6:0]'}
|
|
66
66
|
RESERVE_0_183 : {show: n, blk : 0, word: 5, pos: 23, len : 9, start: 183, type : 'uint:9', wr_dis: null, rd_dis: null, alt : '', dict : '', desc: Reserved; it was created by set_missed_fields_in_regs func, rloc: 'EFUSE_RD_REPEAT_DATA4_REG[31:23]', bloc: 'B22[7],B23'}
|
|
67
67
|
MAC : {show: y, blk : 1, word: 0, pos : 0, len : 48, start : 0, type : 'bytes:6', wr_dis : 20, rd_dis: null, alt : MAC_FACTORY, dict : '', desc: MAC address, rloc: EFUSE_RD_MAC_SYS0_REG, bloc: 'B0,B1,B2,B3,B4,B5'}
|
|
@@ -132,15 +132,20 @@ def init_commands(
|
|
|
132
132
|
port, baud, before, chip, skip_connect, virt, debug, virt_efuse_file
|
|
133
133
|
)
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
try:
|
|
136
|
+
commands = _get_command_class(strip_chip_name(esp.CHIP_NAME))
|
|
137
|
+
commands.esp = esp
|
|
138
|
+
commands.external_esp = external_esp
|
|
139
|
+
commands.get_efuses(
|
|
140
|
+
skip_connect=skip_connect,
|
|
141
|
+
debug_mode=debug,
|
|
142
|
+
do_not_confirm=do_not_confirm,
|
|
143
|
+
extend_efuse_table=extend_efuse_table,
|
|
144
|
+
)
|
|
145
|
+
except Exception:
|
|
146
|
+
# If creating commands fails, ensure the port is closed
|
|
147
|
+
BaseCommands._close_port(esp, external_esp)
|
|
148
|
+
raise
|
|
144
149
|
if batch_mode:
|
|
145
150
|
commands.use_batch_mode()
|
|
146
151
|
return commands
|
|
@@ -31,7 +31,7 @@ __all__ = [
|
|
|
31
31
|
"write_mem",
|
|
32
32
|
]
|
|
33
33
|
|
|
34
|
-
__version__ = "5.2.
|
|
34
|
+
__version__ = "5.2.dev2"
|
|
35
35
|
|
|
36
36
|
import os
|
|
37
37
|
import shlex
|
|
@@ -75,7 +75,6 @@ from esptool.loader import (
|
|
|
75
75
|
DEFAULT_OPEN_PORT_ATTEMPTS,
|
|
76
76
|
StubFlasher,
|
|
77
77
|
ESPLoader,
|
|
78
|
-
list_ports,
|
|
79
78
|
)
|
|
80
79
|
from esptool.logger import log
|
|
81
80
|
from esptool.targets import CHIP_DEFS, CHIP_LIST, ESP32ROM
|
|
@@ -91,6 +90,7 @@ import serial
|
|
|
91
90
|
|
|
92
91
|
from esptool.cli_util import (
|
|
93
92
|
AutoSizeType,
|
|
93
|
+
BaudRateType,
|
|
94
94
|
Group,
|
|
95
95
|
AddrFilenameArg,
|
|
96
96
|
AutoChunkSizeType,
|
|
@@ -100,10 +100,12 @@ from esptool.cli_util import (
|
|
|
100
100
|
MutuallyExclusiveOption,
|
|
101
101
|
ResetModeType,
|
|
102
102
|
SpiConnectionType,
|
|
103
|
+
SerialPortType,
|
|
103
104
|
AutoHex2BinType,
|
|
104
105
|
AddrFilenamePairType,
|
|
105
106
|
parse_port_filters,
|
|
106
107
|
parse_size_arg,
|
|
108
|
+
get_port_list,
|
|
107
109
|
)
|
|
108
110
|
|
|
109
111
|
# Show arguments in the help output, this was default in argparse
|
|
@@ -311,14 +313,14 @@ def check_flash_size(esp: ESPLoader, address: int, size: int) -> None:
|
|
|
311
313
|
@click.option(
|
|
312
314
|
"--port",
|
|
313
315
|
"-p",
|
|
314
|
-
type=
|
|
316
|
+
type=SerialPortType(),
|
|
315
317
|
default=os.environ.get("ESPTOOL_PORT", None),
|
|
316
318
|
help="Serial port device.",
|
|
317
319
|
)
|
|
318
320
|
@click.option(
|
|
319
321
|
"--baud",
|
|
320
322
|
"-b",
|
|
321
|
-
type=
|
|
323
|
+
type=BaudRateType(),
|
|
322
324
|
default=os.environ.get("ESPTOOL_BAUD", ESPLoader.ESP_ROM_BAUD),
|
|
323
325
|
help="Serial port baud rate used when flashing/reading.",
|
|
324
326
|
)
|
|
@@ -1035,85 +1037,6 @@ def main(argv: list[str] | None = None, esp: ESPLoader | None = None):
|
|
|
1035
1037
|
raise
|
|
1036
1038
|
|
|
1037
1039
|
|
|
1038
|
-
def get_port_list(
|
|
1039
|
-
vids: list[str] = [],
|
|
1040
|
-
pids: list[str] = [],
|
|
1041
|
-
names: list[str] = [],
|
|
1042
|
-
serials: list[str] = [],
|
|
1043
|
-
) -> list[str]:
|
|
1044
|
-
if list_ports is None:
|
|
1045
|
-
raise FatalError(
|
|
1046
|
-
"Listing all serial ports is currently not available. "
|
|
1047
|
-
"Please try to specify the port when running esptool or update "
|
|
1048
|
-
"the pyserial package to the latest version."
|
|
1049
|
-
)
|
|
1050
|
-
ports = []
|
|
1051
|
-
for port in list_ports.comports():
|
|
1052
|
-
if sys.platform == "darwin" and port.device.endswith(
|
|
1053
|
-
("Bluetooth-Incoming-Port", "wlan-debug", "cu.debug-console")
|
|
1054
|
-
):
|
|
1055
|
-
continue
|
|
1056
|
-
if vids and (port.vid is None or port.vid not in vids):
|
|
1057
|
-
continue
|
|
1058
|
-
if pids and (port.pid is None or port.pid not in pids):
|
|
1059
|
-
continue
|
|
1060
|
-
if names and (
|
|
1061
|
-
port.name is None or all(name not in port.name for name in names)
|
|
1062
|
-
):
|
|
1063
|
-
continue
|
|
1064
|
-
if serials and (
|
|
1065
|
-
port.serial_number is None
|
|
1066
|
-
or all(serial not in port.serial_number for serial in serials)
|
|
1067
|
-
):
|
|
1068
|
-
continue
|
|
1069
|
-
ports.append((port.device, port.vid))
|
|
1070
|
-
|
|
1071
|
-
# Constants for sorting optimization
|
|
1072
|
-
ESPRESSIF_VID = 0x303A
|
|
1073
|
-
LINUX_DEVICE_PATTERNS = ("ttyUSB", "ttyACM")
|
|
1074
|
-
MACOS_DEVICE_PATTERNS = ("usbserial", "usbmodem")
|
|
1075
|
-
|
|
1076
|
-
def _port_sort_key_linux(port_info):
|
|
1077
|
-
device, vid = port_info
|
|
1078
|
-
|
|
1079
|
-
if vid == ESPRESSIF_VID:
|
|
1080
|
-
return (3, device)
|
|
1081
|
-
|
|
1082
|
-
if any(pattern in device for pattern in LINUX_DEVICE_PATTERNS):
|
|
1083
|
-
return (2, device)
|
|
1084
|
-
|
|
1085
|
-
return (1, device)
|
|
1086
|
-
|
|
1087
|
-
def _port_sort_key_macos(port_info):
|
|
1088
|
-
device, vid = port_info
|
|
1089
|
-
|
|
1090
|
-
if vid == ESPRESSIF_VID:
|
|
1091
|
-
return (3, device)
|
|
1092
|
-
|
|
1093
|
-
if any(pattern in device for pattern in MACOS_DEVICE_PATTERNS):
|
|
1094
|
-
return (2, device)
|
|
1095
|
-
|
|
1096
|
-
return (1, device)
|
|
1097
|
-
|
|
1098
|
-
def _port_sort_key_windows(port_info):
|
|
1099
|
-
device, vid = port_info
|
|
1100
|
-
|
|
1101
|
-
if vid == ESPRESSIF_VID:
|
|
1102
|
-
return (2, device)
|
|
1103
|
-
|
|
1104
|
-
return (1, device)
|
|
1105
|
-
|
|
1106
|
-
if sys.platform == "win32":
|
|
1107
|
-
key_func = _port_sort_key_windows
|
|
1108
|
-
elif sys.platform == "darwin":
|
|
1109
|
-
key_func = _port_sort_key_macos
|
|
1110
|
-
else:
|
|
1111
|
-
key_func = _port_sort_key_linux
|
|
1112
|
-
|
|
1113
|
-
sorted_port_info = sorted(ports, key=key_func)
|
|
1114
|
-
return [device for device, _ in sorted_port_info]
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
1040
|
def expand_file_arguments(argv: list[str]) -> list[str]:
|
|
1118
1041
|
"""
|
|
1119
1042
|
Any argument starting with "@" gets replaced with all values read from a text file.
|
|
@@ -3,14 +3,18 @@
|
|
|
3
3
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
import sys
|
|
6
7
|
import rich_click as click
|
|
7
8
|
|
|
8
9
|
from esptool.bin_image import ESPLoader, intel_hex_to_bin
|
|
9
10
|
from esptool.cmds import detect_flash_size
|
|
10
11
|
from esptool.util import FatalError, flash_size_bytes, strip_chip_name
|
|
11
12
|
from esptool.logger import log
|
|
13
|
+
from esptool.loader import list_ports, ListPortInfo
|
|
12
14
|
from typing import IO, Any
|
|
13
15
|
|
|
16
|
+
from click.shell_completion import CompletionItem
|
|
17
|
+
|
|
14
18
|
################################ Custom types #################################
|
|
15
19
|
|
|
16
20
|
|
|
@@ -98,6 +102,59 @@ class AutoChunkSizeType(AnyIntType):
|
|
|
98
102
|
return num
|
|
99
103
|
|
|
100
104
|
|
|
105
|
+
class SerialPortType(click.ParamType):
|
|
106
|
+
"""
|
|
107
|
+
Custom type for serial port with autocomplete support.
|
|
108
|
+
Provides shell completion for available serial ports.
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
name = "serial-port"
|
|
112
|
+
|
|
113
|
+
def convert(
|
|
114
|
+
self, value: str, param: click.Parameter | None, ctx: click.Context
|
|
115
|
+
) -> str:
|
|
116
|
+
# Just return the value as-is, validation happens elsewhere
|
|
117
|
+
return value
|
|
118
|
+
|
|
119
|
+
def shell_complete(
|
|
120
|
+
self, ctx: click.Context, param: click.Parameter, incomplete: str
|
|
121
|
+
) -> list[CompletionItem]:
|
|
122
|
+
"""Provide shell completion suggestions for serial ports"""
|
|
123
|
+
available_ports = _get_port_list()
|
|
124
|
+
# Filter ports that match the incomplete string (case-insensitive)
|
|
125
|
+
incomplete_lower = incomplete.lower()
|
|
126
|
+
return [
|
|
127
|
+
CompletionItem(
|
|
128
|
+
port.device,
|
|
129
|
+
help=f"Description: {port.description}, "
|
|
130
|
+
f"VID: {port.vid}, PID: {port.pid}"
|
|
131
|
+
# Avoid printing None values
|
|
132
|
+
if port.vid is not None
|
|
133
|
+
else None,
|
|
134
|
+
)
|
|
135
|
+
for port in reversed(available_ports)
|
|
136
|
+
if port.device.lower().startswith(incomplete_lower)
|
|
137
|
+
]
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class BaudRateType(click.ParamType):
|
|
141
|
+
"""Custom type for baud rate with autocomplete support"""
|
|
142
|
+
|
|
143
|
+
name = "baud-rate"
|
|
144
|
+
|
|
145
|
+
def convert(
|
|
146
|
+
self, value: str, param: click.Parameter | None, ctx: click.Context
|
|
147
|
+
) -> int:
|
|
148
|
+
return int(value)
|
|
149
|
+
|
|
150
|
+
def shell_complete(
|
|
151
|
+
self, ctx: click.Context, param: click.Parameter, incomplete: str
|
|
152
|
+
) -> list[CompletionItem]:
|
|
153
|
+
"""Provide shell completion suggestions for common baud rates"""
|
|
154
|
+
available_baud_rates = [9600, 115200, 230400, 460800, 576000, 921600]
|
|
155
|
+
return [CompletionItem(str(baud)) for baud in available_baud_rates]
|
|
156
|
+
|
|
157
|
+
|
|
101
158
|
class SpiConnectionType(click.ParamType):
|
|
102
159
|
"""
|
|
103
160
|
Custom type to parse 'spi connection' override.
|
|
@@ -400,6 +457,92 @@ def arg_auto_int(x: str) -> int:
|
|
|
400
457
|
return int(x, 0)
|
|
401
458
|
|
|
402
459
|
|
|
460
|
+
def get_port_list(
|
|
461
|
+
vids: list[str] = [],
|
|
462
|
+
pids: list[str] = [],
|
|
463
|
+
names: list[str] = [],
|
|
464
|
+
serials: list[str] = [],
|
|
465
|
+
) -> list[str]:
|
|
466
|
+
"""Get the list of serial ports names with optional filters.
|
|
467
|
+
|
|
468
|
+
For backwards compatibility, this function returns a list of port names.
|
|
469
|
+
"""
|
|
470
|
+
return [port.device for port in _get_port_list(vids, pids, names, serials)]
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
def _get_port_list(
|
|
474
|
+
vids: list[str] = [],
|
|
475
|
+
pids: list[str] = [],
|
|
476
|
+
names: list[str] = [],
|
|
477
|
+
serials: list[str] = [],
|
|
478
|
+
) -> list[ListPortInfo]:
|
|
479
|
+
if list_ports is None:
|
|
480
|
+
raise FatalError(
|
|
481
|
+
"Listing all serial ports is currently not available. "
|
|
482
|
+
"Please try to specify the port when running esptool or update "
|
|
483
|
+
"the pyserial package to the latest version."
|
|
484
|
+
)
|
|
485
|
+
ports = []
|
|
486
|
+
for port in list_ports.comports():
|
|
487
|
+
if sys.platform == "darwin" and port.device.endswith(
|
|
488
|
+
("Bluetooth-Incoming-Port", "wlan-debug", "cu.debug-console")
|
|
489
|
+
):
|
|
490
|
+
continue
|
|
491
|
+
if vids and (port.vid is None or port.vid not in vids):
|
|
492
|
+
continue
|
|
493
|
+
if pids and (port.pid is None or port.pid not in pids):
|
|
494
|
+
continue
|
|
495
|
+
if names and (
|
|
496
|
+
port.name is None or all(name not in port.name for name in names)
|
|
497
|
+
):
|
|
498
|
+
continue
|
|
499
|
+
if serials and (
|
|
500
|
+
port.serial_number is None
|
|
501
|
+
or all(serial not in port.serial_number for serial in serials)
|
|
502
|
+
):
|
|
503
|
+
continue
|
|
504
|
+
ports.append(port)
|
|
505
|
+
|
|
506
|
+
# Constants for sorting optimization
|
|
507
|
+
ESPRESSIF_VID = 0x303A
|
|
508
|
+
LINUX_DEVICE_PATTERNS = ("ttyUSB", "ttyACM")
|
|
509
|
+
MACOS_DEVICE_PATTERNS = ("usbserial", "usbmodem")
|
|
510
|
+
|
|
511
|
+
def _port_sort_key_linux(port_info: ListPortInfo) -> tuple[int, str]:
|
|
512
|
+
if port_info.vid == ESPRESSIF_VID:
|
|
513
|
+
return (3, port_info.device)
|
|
514
|
+
|
|
515
|
+
if any(pattern in port_info.device for pattern in LINUX_DEVICE_PATTERNS):
|
|
516
|
+
return (2, port_info.device)
|
|
517
|
+
|
|
518
|
+
return (1, port_info.device)
|
|
519
|
+
|
|
520
|
+
def _port_sort_key_macos(port_info: ListPortInfo) -> tuple[int, str]:
|
|
521
|
+
if port_info.vid == ESPRESSIF_VID:
|
|
522
|
+
return (3, port_info.device)
|
|
523
|
+
|
|
524
|
+
if any(pattern in port_info.device for pattern in MACOS_DEVICE_PATTERNS):
|
|
525
|
+
return (2, port_info.device)
|
|
526
|
+
|
|
527
|
+
return (1, port_info.device)
|
|
528
|
+
|
|
529
|
+
def _port_sort_key_windows(port_info: ListPortInfo) -> tuple[int, str]:
|
|
530
|
+
if port_info.vid == ESPRESSIF_VID:
|
|
531
|
+
return (2, port_info.device)
|
|
532
|
+
|
|
533
|
+
return (1, port_info.device)
|
|
534
|
+
|
|
535
|
+
if sys.platform == "win32":
|
|
536
|
+
key_func = _port_sort_key_windows
|
|
537
|
+
elif sys.platform == "darwin":
|
|
538
|
+
key_func = _port_sort_key_macos
|
|
539
|
+
else:
|
|
540
|
+
key_func = _port_sort_key_linux
|
|
541
|
+
|
|
542
|
+
sorted_port_info = sorted(ports, key=key_func)
|
|
543
|
+
return sorted_port_info
|
|
544
|
+
|
|
545
|
+
|
|
403
546
|
def parse_port_filters(
|
|
404
547
|
value: tuple[str],
|
|
405
548
|
) -> tuple[list[int], list[int], list[str], list[str]]:
|