esptool 4.9.dev3__tar.gz → 4.9.dev4__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.9.dev3/esptool.egg-info → esptool-4.9.dev4}/PKG-INFO +2 -2
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h2/fields.py +4 -13
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h2/mem_definition.py +3 -1
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h2/operations.py +10 -8
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32h2.yaml +7 -6
- esptool-4.9.dev4/espefuse/efuse_defs/esp32h2_v0.0_v1.1.yaml +3 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espsecure/__init__.py +31 -10
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/__init__.py +24 -6
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/cmds.py +1 -1
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/loader.py +36 -4
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32c2.py +0 -3
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32c3.py +3 -9
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32c5.py +5 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32c6.py +3 -3
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32c61.py +5 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32h2.py +6 -3
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32h21.py +0 -5
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32p4.py +5 -5
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32s2.py +5 -5
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32s3.py +6 -6
- {esptool-4.9.dev3 → esptool-4.9.dev4/esptool.egg-info}/PKG-INFO +2 -2
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool.egg-info/SOURCES.txt +1 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/LICENSE +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/MANIFEST.in +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/README.md +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esp_rfc2217_server/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esp_rfc2217_server/__main__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esp_rfc2217_server/esp_port_manager.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esp_rfc2217_server/redirector.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esp_rfc2217_server.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/__main__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/base_fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/base_operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/csv_table_parser.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/emulate_efuse_controller_base.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c2/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c2/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c2/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c2/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c2/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c3/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c3/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c3/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c3/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c3/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c5/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c5/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c5/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c5/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c5/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c5beta3/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c5beta3/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c5beta3/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c5beta3/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c5beta3/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c6/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c6/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c6/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c6/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c6/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c61/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c61/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c61/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c61/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32c61/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h2/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h2/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h21/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h21/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h21/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h21/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h21/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h2beta1/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h2beta1/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h2beta1/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h2beta1/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32h2beta1/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32p4/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32p4/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32p4/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32p4/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32p4/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s2/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s2/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s2/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s2/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s2/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s3/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s3/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s3/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s3/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s3/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s3beta2/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s3beta2/emulate_efuse_controller.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s3beta2/fields.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s3beta2/mem_definition.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/esp32s3beta2/operations.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/mem_definition_base.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse/util.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32c2.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32c3.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32c5.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32c5beta3.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32c6.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32c61.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32h21.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32p4.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32s2.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse/efuse_defs/esp32s3.yaml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espefuse.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espsecure/__main__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espsecure/esp_hsm_sign/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espsecure/esp_hsm_sign/exceptions.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/espsecure.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/__main__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/bin_image.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/config.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/reset.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/__init__.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32c5beta3.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32c6beta.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32h2beta1.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32h2beta2.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp32s3beta2.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/esp8266.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/README.md +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32c2.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32c3.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32c5.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32c5beta3.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32c6.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32c61.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32c6beta.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32h2.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32h2beta1.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32h2beta2.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32p4.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32s2.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32s3.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp32s3beta2.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/1/esp8266.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/2/LICENSE-APACHE +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/2/LICENSE-MIT +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/2/README.md +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/2/esp32.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/2/esp32c2.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/2/esp32c3.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/2/esp32c6.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/2/esp32h2.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/2/esp32s2.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/targets/stub_flasher/2/esp32s3.json +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/uf2_writer.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool/util.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool.egg-info/dependency_links.txt +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool.egg-info/requires.txt +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool.egg-info/top_level.txt +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/esptool.py +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/pyproject.toml +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/setup.cfg +0 -0
- {esptool-4.9.dev3 → esptool-4.9.dev4}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: esptool
|
|
3
|
-
Version: 4.9.
|
|
3
|
+
Version: 4.9.dev4
|
|
4
4
|
Summary: A serial utility to communicate & flash code to Espressif chips.
|
|
5
5
|
Author: Fredrik Ahlberg (themadinventor), Angus Gratton (projectgus), Espressif Systems
|
|
6
6
|
License: GPLv2+
|
|
@@ -111,6 +111,10 @@ class EspEfuses(base_fields.EspEfusesBase):
|
|
|
111
111
|
EfuseField.convert(self, efuse) for efuse in self.Fields.CALC
|
|
112
112
|
]
|
|
113
113
|
|
|
114
|
+
if self.get_chip_version() <= 101:
|
|
115
|
+
rev = EfuseDefineFields(None, revision="esp32h2_v0.0_v1.1")
|
|
116
|
+
self.efuses += [EfuseField.convert(self, efuse) for efuse in rev.EFUSES]
|
|
117
|
+
|
|
114
118
|
def __getitem__(self, efuse_name):
|
|
115
119
|
"""Return the efuse field with the given name"""
|
|
116
120
|
for e in self.efuses:
|
|
@@ -302,22 +306,9 @@ class EfuseField(base_fields.EfuseFieldBase):
|
|
|
302
306
|
"keypurpose": EfuseKeyPurposeField,
|
|
303
307
|
"t_sensor": EfuseTempSensor,
|
|
304
308
|
"adc_tp": EfuseAdcPointCalibration,
|
|
305
|
-
"wafer": EfuseWafer,
|
|
306
309
|
}.get(efuse.class_type, EfuseField)(parent, efuse)
|
|
307
310
|
|
|
308
311
|
|
|
309
|
-
class EfuseWafer(EfuseField):
|
|
310
|
-
def get(self, from_read=True):
|
|
311
|
-
hi_bits = self.parent["WAFER_VERSION_MINOR_HI"].get(from_read)
|
|
312
|
-
assert self.parent["WAFER_VERSION_MINOR_HI"].bit_len == 1
|
|
313
|
-
lo_bits = self.parent["WAFER_VERSION_MINOR_LO"].get(from_read)
|
|
314
|
-
assert self.parent["WAFER_VERSION_MINOR_LO"].bit_len == 3
|
|
315
|
-
return (hi_bits << 3) + lo_bits
|
|
316
|
-
|
|
317
|
-
def save(self, new_value):
|
|
318
|
-
raise esptool.FatalError("Burning %s is not supported" % self.name)
|
|
319
|
-
|
|
320
|
-
|
|
321
312
|
class EfuseTempSensor(EfuseField):
|
|
322
313
|
def get(self, from_read=True):
|
|
323
314
|
value = self.get_bitstring(from_read)
|
|
@@ -111,7 +111,7 @@ class EfuseDefineBlocks(EfuseBlocksBase):
|
|
|
111
111
|
|
|
112
112
|
|
|
113
113
|
class EfuseDefineFields(EfuseFieldsBase):
|
|
114
|
-
def __init__(self, extend_efuse_table) -> None:
|
|
114
|
+
def __init__(self, extend_efuse_table, revision=None) -> None:
|
|
115
115
|
# List of efuse fields from TRM the chapter eFuse Controller.
|
|
116
116
|
self.EFUSES = []
|
|
117
117
|
self.KEYBLOCKS = []
|
|
@@ -120,6 +120,8 @@ class EfuseDefineFields(EfuseFieldsBase):
|
|
|
120
120
|
|
|
121
121
|
dir_name = os.path.dirname(os.path.abspath(__file__))
|
|
122
122
|
dir_name, file_name = os.path.split(dir_name)
|
|
123
|
+
if revision is not None:
|
|
124
|
+
file_name = revision
|
|
123
125
|
file_name = file_name + ".yaml"
|
|
124
126
|
dir_name, _ = os.path.split(dir_name)
|
|
125
127
|
efuse_file = os.path.join(dir_name, "efuse_defs", file_name)
|
|
@@ -318,14 +318,16 @@ def burn_key(esp, efuses, args, digest=None):
|
|
|
318
318
|
if efuses[block.key_purpose_name].is_writeable():
|
|
319
319
|
disable_wr_protect_key_purpose = True
|
|
320
320
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
321
|
+
# >= ESP32-H2 ECO5 revision (v1.2) does not have ECDSA_FORCE_USE_HARDWARE_K
|
|
322
|
+
if efuses.get_chip_version() <= 101:
|
|
323
|
+
if keypurpose == "ECDSA_KEY":
|
|
324
|
+
if efuses["ECDSA_FORCE_USE_HARDWARE_K"].get() == 0:
|
|
325
|
+
# For ECDSA key purpose block permanently enable
|
|
326
|
+
# the hardware TRNG supplied k mode (most secure mode)
|
|
327
|
+
print("\tECDSA_FORCE_USE_HARDWARE_K: 0 -> 1")
|
|
328
|
+
efuses["ECDSA_FORCE_USE_HARDWARE_K"].save(1)
|
|
329
|
+
else:
|
|
330
|
+
print("\tECDSA_FORCE_USE_HARDWARE_K is already '1'")
|
|
329
331
|
|
|
330
332
|
if disable_wr_protect_key_purpose:
|
|
331
333
|
print("\tDisabling write to '%s'." % block.key_purpose_name)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
VER_NO:
|
|
1
|
+
VER_NO: 44563d2af4ebdba4db6c0a34a50c94f9
|
|
2
2
|
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]'}
|
|
@@ -18,9 +18,9 @@ EFUSES:
|
|
|
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
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 : '', desc: 'Represents whether the D+ and D- pins is exchanged. 1: exchanged. 0: not exchanged', rloc: 'EFUSE_RD_REPEAT_DATA0_REG[25]', bloc: 'B7[1]'}
|
|
20
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 : '', desc: 'Represents whether vdd spi pin is functioned as gpio. 1: functioned. 0: not functioned', rloc: 'EFUSE_RD_REPEAT_DATA0_REG[26]', bloc: 'B7[2]'}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
ECDSA_CURVE_MODE : {show: y, blk : 0, word: 1, pos: 27, len : 2, start : 59, type : 'uint:2', wr_dis : 17, rd_dis: null, alt : '', dict : '', desc: 'Configures the curve of ECDSA calculation: 0: only enable P256. 1: only enable P192. 2: both enable P256 and P192. 3: only enable P256', rloc: 'EFUSE_RD_REPEAT_DATA0_REG[28:27]', bloc: 'B7[4:3]'}
|
|
22
|
+
ECC_FORCE_CONST_TIME : {show: y, blk : 0, word: 1, pos: 29, len : 1, start : 61, type : bool, wr_dis : 17, rd_dis: null, alt : '', dict : '', desc: Set this bit to permanently turn on ECC const-time mode, rloc: 'EFUSE_RD_REPEAT_DATA0_REG[29]', bloc: 'B7[5]'}
|
|
23
|
+
XTS_DPA_PSEUDO_LEVEL : {show: y, blk : 0, word: 1, pos: 30, len : 2, start : 62, type : 'uint:2', wr_dis : 14, rd_dis: null, alt : '', dict : '', desc: 'Set this bit to control the xts pseudo-round anti-dpa attack function: 0: controlled by register. 1-3: the higher the value is; the more pseudo-rounds are inserted to the xts-aes calculation', rloc: 'EFUSE_RD_REPEAT_DATA0_REG[31:30]', bloc: 'B7[7:6]'}
|
|
24
24
|
RPT4_RESERVED1_1 : {show: n, blk : 0, word: 2, pos : 0, len : 16, start : 64, type : 'uint:16', wr_dis: null, rd_dis: null, alt : '', dict : '', desc: Reserved, rloc: 'EFUSE_RD_REPEAT_DATA1_REG[15:0]', bloc: 'B8,B9'}
|
|
25
25
|
WDT_DELAY_SEL : {show: y, blk : 0, word: 2, pos: 16, len : 2, start : 80, type : 'uint:2', wr_dis : 3, rd_dis: null, alt : '', dict : '', desc: 'Represents whether RTC watchdog timeout threshold is selected at startup. 1: selected. 0: not selected', rloc: 'EFUSE_RD_REPEAT_DATA1_REG[17:16]', bloc: 'B10[1:0]'}
|
|
26
26
|
SPI_BOOT_CRYPT_CNT : {show: y, blk : 0, word: 2, pos: 18, len : 3, start : 82, 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[20:18]', bloc: 'B10[4:2]'}
|
|
@@ -34,11 +34,12 @@ EFUSES:
|
|
|
34
34
|
KEY_PURPOSE_4 : {show: y, blk : 0, word: 3, pos : 8, len : 4, start: 104, type : 'uint:4', wr_dis : 12, rd_dis: null, alt : KEY4_PURPOSE, dict : '', desc: Represents the purpose of Key4, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[11:8]', bloc: 'B13[3:0]'}
|
|
35
35
|
KEY_PURPOSE_5 : {show: y, blk : 0, word: 3, pos: 12, len : 4, start: 108, type : 'uint:4', wr_dis : 13, rd_dis: null, alt : KEY5_PURPOSE, dict : '', desc: Represents the purpose of Key5, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[15:12]', bloc: 'B13[7:4]'}
|
|
36
36
|
SEC_DPA_LEVEL : {show: y, blk : 0, word: 3, pos: 16, len : 2, start: 112, type : 'uint:2', wr_dis : 14, rd_dis: null, alt : '', dict : '', desc: Represents the spa secure level by configuring the clock random divide mode, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[17:16]', bloc: 'B14[1:0]'}
|
|
37
|
-
|
|
37
|
+
RESERVE_0_114 : {show: n, blk : 0, word: 3, pos: 18, len : 1, start: 114, type : bool, wr_dis : 17, rd_dis: null, alt : '', dict : '', desc: Reserved, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[18]', bloc: 'B14[2]'}
|
|
38
38
|
CRYPT_DPA_ENABLE : {show: y, blk : 0, word: 3, pos: 19, len : 1, start: 115, type : bool, wr_dis : 14, rd_dis: null, alt : '', dict : '', desc: 'Represents whether anti-dpa attack is enabled. 1:enabled. 0: disabled', rloc: 'EFUSE_RD_REPEAT_DATA2_REG[19]', bloc: 'B14[3]'}
|
|
39
39
|
SECURE_BOOT_EN : {show: y, blk : 0, word: 3, pos: 20, len : 1, start: 116, type : bool, wr_dis : 15, rd_dis: null, alt : '', dict : '', desc: 'Represents whether secure boot is enabled or disabled. 1: enabled. 0: disabled', rloc: 'EFUSE_RD_REPEAT_DATA2_REG[20]', bloc: 'B14[4]'}
|
|
40
40
|
SECURE_BOOT_AGGRESSIVE_REVOKE : {show: y, blk : 0, word: 3, pos: 21, len : 1, start: 117, type : bool, wr_dis : 16, rd_dis: null, alt : '', dict : '', desc: 'Represents whether revoking aggressive secure boot is enabled or disabled. 1: enabled. 0: disabled', rloc: 'EFUSE_RD_REPEAT_DATA2_REG[21]', bloc: 'B14[5]'}
|
|
41
|
-
|
|
41
|
+
POWERGLITCH_EN1 : {show: y, blk : 0, word: 3, pos: 22, len : 5, start: 118, type : 'uint:5', wr_dis : 2, rd_dis: null, alt : '', dict : '', desc: Set these bits to enable power glitch function when chip power on, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[26:22]', bloc: 'B14[7:6],B15[2:0]'}
|
|
42
|
+
RESERVED_0_123 : {show: n, blk : 0, word: 3, pos: 27, len : 1, start: 123, type : bool, wr_dis: null, rd_dis: null, alt : '', dict : '', desc: reserved, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[27]', bloc: 'B15[3]'}
|
|
42
43
|
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; in unit of ms. When the value less than 15; the waiting time is the programmed value. Otherwise; the waiting time is 2 times the programmed value, rloc: 'EFUSE_RD_REPEAT_DATA2_REG[31:28]', bloc: 'B15[7:4]'}
|
|
43
44
|
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 : '', desc: 'Represents whether Download mode is disabled or enabled. 1: disabled. 0: enabled', rloc: 'EFUSE_RD_REPEAT_DATA3_REG[0]', bloc: 'B16[0]'}
|
|
44
45
|
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 : '', desc: 'Represents whether direct boot mode is disabled or enabled. 1: disabled. 0: enabled', rloc: 'EFUSE_RD_REPEAT_DATA3_REG[1]', bloc: 'B16[1]'}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
VER_NO: 44563d2af4ebdba4db6c0a34a50c94f9
|
|
2
|
+
EFUSES:
|
|
3
|
+
ECDSA_FORCE_USE_HARDWARE_K : {show: y, blk : 0, word: 3, pos: 18, len : 1, start: 114, type : bool, wr_dis : 17, rd_dis: null, alt : '', dict : '', desc: 'Represents whether hardware random number k is forced used in ESDCA. 1: force used. 0: not force used', rloc: 'EFUSE_RD_REPEAT_DATA2_REG[18]', bloc: 'B14[2]'}
|
|
@@ -65,7 +65,7 @@ def swap_word_order(source):
|
|
|
65
65
|
return struct.pack(words, *reversed(struct.unpack(words, source)))
|
|
66
66
|
|
|
67
67
|
|
|
68
|
-
def _load_hardware_key(keyfile):
|
|
68
|
+
def _load_hardware_key(keyfile, is_flash_encryption_key, aes_xts=None):
|
|
69
69
|
"""Load a 128/256/512-bit key, similar to stored in efuse, from a file
|
|
70
70
|
|
|
71
71
|
128-bit keys will be extended to 256-bit using the SHA256 of the key
|
|
@@ -78,6 +78,17 @@ def _load_hardware_key(keyfile):
|
|
|
78
78
|
"Key file contains wrong length (%d bytes), 16, 24, 32 or 64 expected."
|
|
79
79
|
% len(key)
|
|
80
80
|
)
|
|
81
|
+
if is_flash_encryption_key:
|
|
82
|
+
if aes_xts:
|
|
83
|
+
if len(key) not in [16, 32, 64]:
|
|
84
|
+
raise esptool.FatalError(
|
|
85
|
+
f"AES_XTS supports only 128, 256, and 512-bit keys. Provided key is {len(key) * 8} bits."
|
|
86
|
+
)
|
|
87
|
+
else:
|
|
88
|
+
if len(key) not in [24, 32]:
|
|
89
|
+
raise esptool.FatalError(
|
|
90
|
+
f"ESP32 supports only 192 and 256-bit keys. Provided key is {len(key) * 8} bits. Use --aes_xts for other chips."
|
|
91
|
+
)
|
|
81
92
|
if len(key) == 16:
|
|
82
93
|
key = _sha256_digest(key)
|
|
83
94
|
print("Using 128-bit key (extended)")
|
|
@@ -129,7 +140,7 @@ def digest_secure_bootloader(args):
|
|
|
129
140
|
# produce the digest. Each block in/out of ECB is reordered
|
|
130
141
|
# (due to hardware quirks not for security.)
|
|
131
142
|
|
|
132
|
-
key = _load_hardware_key(args.keyfile)
|
|
143
|
+
key = _load_hardware_key(args.keyfile, False)
|
|
133
144
|
backend = default_backend()
|
|
134
145
|
cipher = Cipher(algorithms.AES(key), modes.ECB(), backend=backend)
|
|
135
146
|
encryptor = cipher.encryptor()
|
|
@@ -1233,7 +1244,19 @@ def generate_flash_encryption_key(args):
|
|
|
1233
1244
|
def _flash_encryption_operation_esp32(
|
|
1234
1245
|
output_file, input_file, flash_address, keyfile, flash_crypt_conf, do_decrypt
|
|
1235
1246
|
):
|
|
1236
|
-
|
|
1247
|
+
"""
|
|
1248
|
+
Perform flash encryption or decryption operation for ESP32.
|
|
1249
|
+
|
|
1250
|
+
This function handles the encryption or decryption of flash data for the ESP32 chip.
|
|
1251
|
+
It reads data from the input file, processes it in 16-byte blocks, and writes the
|
|
1252
|
+
processed data to the output file. The function ensures that the key length is either
|
|
1253
|
+
192 or 256 bits, as required by the ESP32 chip. It also checks that the flash address
|
|
1254
|
+
is a multiple of 16.
|
|
1255
|
+
|
|
1256
|
+
Note: This function is specific to the ESP32 chip. For other chips, use the --aes_xts
|
|
1257
|
+
flag to call the correct function.
|
|
1258
|
+
"""
|
|
1259
|
+
key = _load_hardware_key(keyfile, True, aes_xts=False)
|
|
1237
1260
|
|
|
1238
1261
|
if flash_address % 16 != 0:
|
|
1239
1262
|
raise esptool.FatalError(
|
|
@@ -1322,7 +1345,7 @@ def _flash_encryption_operation_aes_xts(
|
|
|
1322
1345
|
"""
|
|
1323
1346
|
|
|
1324
1347
|
backend = default_backend()
|
|
1325
|
-
key = _load_hardware_key(keyfile)
|
|
1348
|
+
key = _load_hardware_key(keyfile, True, aes_xts=True)
|
|
1326
1349
|
indata = input_file.read()
|
|
1327
1350
|
|
|
1328
1351
|
if flash_address % 16 != 0:
|
|
@@ -1789,8 +1812,7 @@ def main(custom_commandline=None):
|
|
|
1789
1812
|
p.add_argument(
|
|
1790
1813
|
"--aes_xts",
|
|
1791
1814
|
"-x",
|
|
1792
|
-
help="Decrypt data using AES-XTS
|
|
1793
|
-
"ESP32-S2, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-C5, ESP32-C61 and ESP32-P4",
|
|
1815
|
+
help="Decrypt data using AES-XTS (not applicable for ESP32)",
|
|
1794
1816
|
action="store_true",
|
|
1795
1817
|
)
|
|
1796
1818
|
p.add_argument(
|
|
@@ -1816,7 +1838,7 @@ def main(custom_commandline=None):
|
|
|
1816
1838
|
)
|
|
1817
1839
|
p.add_argument(
|
|
1818
1840
|
"--flash_crypt_conf",
|
|
1819
|
-
help="Override FLASH_CRYPT_CONF efuse value (default is 0XF).",
|
|
1841
|
+
help="Override FLASH_CRYPT_CONF efuse value (default is 0XF) (applicable only for ESP32).",
|
|
1820
1842
|
required=False,
|
|
1821
1843
|
default=0xF,
|
|
1822
1844
|
type=esptool.arg_auto_int,
|
|
@@ -1829,8 +1851,7 @@ def main(custom_commandline=None):
|
|
|
1829
1851
|
p.add_argument(
|
|
1830
1852
|
"--aes_xts",
|
|
1831
1853
|
"-x",
|
|
1832
|
-
help="Encrypt data using AES-XTS
|
|
1833
|
-
"ESP32-S2, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-C5, ESP32-C61 and ESP32-P4",
|
|
1854
|
+
help="Encrypt data using AES-XTS (not applicable for ESP32)",
|
|
1834
1855
|
action="store_true",
|
|
1835
1856
|
)
|
|
1836
1857
|
p.add_argument(
|
|
@@ -1856,7 +1877,7 @@ def main(custom_commandline=None):
|
|
|
1856
1877
|
)
|
|
1857
1878
|
p.add_argument(
|
|
1858
1879
|
"--flash_crypt_conf",
|
|
1859
|
-
help="Override FLASH_CRYPT_CONF efuse value (default is 0XF)
|
|
1880
|
+
help="Override FLASH_CRYPT_CONF efuse value (default is 0XF) (applicable only for ESP32)",
|
|
1860
1881
|
required=False,
|
|
1861
1882
|
default=0xF,
|
|
1862
1883
|
type=esptool.arg_auto_int,
|
|
@@ -29,7 +29,7 @@ __all__ = [
|
|
|
29
29
|
"write_mem",
|
|
30
30
|
]
|
|
31
31
|
|
|
32
|
-
__version__ = "4.9.
|
|
32
|
+
__version__ = "4.9.dev4"
|
|
33
33
|
|
|
34
34
|
import argparse
|
|
35
35
|
import inspect
|
|
@@ -151,7 +151,13 @@ def main(argv=None, esp=None):
|
|
|
151
151
|
"--after",
|
|
152
152
|
"-a",
|
|
153
153
|
help="What to do after esptool.py is finished",
|
|
154
|
-
choices=[
|
|
154
|
+
choices=[
|
|
155
|
+
"hard_reset",
|
|
156
|
+
"soft_reset",
|
|
157
|
+
"no_reset",
|
|
158
|
+
"no_reset_stub",
|
|
159
|
+
"watchdog_reset",
|
|
160
|
+
],
|
|
155
161
|
default=os.environ.get("ESPTOOL_AFTER", "hard_reset"),
|
|
156
162
|
)
|
|
157
163
|
|
|
@@ -823,11 +829,14 @@ def main(argv=None, esp=None):
|
|
|
823
829
|
)
|
|
824
830
|
|
|
825
831
|
if esp.secure_download_mode:
|
|
826
|
-
print("Chip is
|
|
832
|
+
print(f"Chip is {esp.CHIP_NAME} in Secure Download Mode")
|
|
827
833
|
else:
|
|
828
|
-
print("Chip is
|
|
829
|
-
print("Features:
|
|
830
|
-
print("Crystal is
|
|
834
|
+
print(f"Chip is {esp.get_chip_description()}")
|
|
835
|
+
print(f"Features: {', '.join(esp.get_chip_features())}")
|
|
836
|
+
print(f"Crystal is {esp.get_crystal_freq()}MHz")
|
|
837
|
+
usb_mode = esp.get_usb_mode()
|
|
838
|
+
if usb_mode is not None:
|
|
839
|
+
print(f"USB mode: {usb_mode}")
|
|
831
840
|
read_mac(esp, args)
|
|
832
841
|
|
|
833
842
|
if not args.no_stub:
|
|
@@ -1065,6 +1074,15 @@ def main(argv=None, esp=None):
|
|
|
1065
1074
|
esp.soft_reset(False)
|
|
1066
1075
|
elif args.after == "no_reset_stub":
|
|
1067
1076
|
print("Staying in flasher stub.")
|
|
1077
|
+
elif args.after == "watchdog_reset":
|
|
1078
|
+
if esp.secure_download_mode:
|
|
1079
|
+
print(
|
|
1080
|
+
"WARNING: Watchdog hard reset is not supported in Secure Download "
|
|
1081
|
+
"Mode, attempting classic hard reset instead."
|
|
1082
|
+
)
|
|
1083
|
+
esp.hard_reset()
|
|
1084
|
+
else:
|
|
1085
|
+
esp.watchdog_reset()
|
|
1068
1086
|
else: # args.after == 'no_reset'
|
|
1069
1087
|
print("Staying in bootloader.")
|
|
1070
1088
|
if esp.IS_STUB:
|
|
@@ -495,7 +495,7 @@ def write_flash(esp, args):
|
|
|
495
495
|
else: # Check against real flash chip size if not in SDM
|
|
496
496
|
flash_end_str = detect_flash_size(esp)
|
|
497
497
|
flash_end = flash_size_bytes(flash_end_str)
|
|
498
|
-
if set_flash_size and set_flash_size > flash_end:
|
|
498
|
+
if set_flash_size and flash_end and set_flash_size > flash_end:
|
|
499
499
|
print(
|
|
500
500
|
f"WARNING: Set --flash_size {args.flash_size} "
|
|
501
501
|
f"is larger than the available flash size of {flash_end_str}."
|
|
@@ -737,7 +737,7 @@ class ESPLoader(object):
|
|
|
737
737
|
" if ESP32-C2 doesn't connect"
|
|
738
738
|
" (at least 115200 Bd is recommended)."
|
|
739
739
|
)
|
|
740
|
-
|
|
740
|
+
self._port.close()
|
|
741
741
|
raise FatalError(
|
|
742
742
|
"Failed to connect to {}: {}"
|
|
743
743
|
f"{additional_msg}"
|
|
@@ -1047,9 +1047,34 @@ class ESPLoader(object):
|
|
|
1047
1047
|
"""
|
|
1048
1048
|
Read the UARTDEV_BUF_NO register to get the number of the currently used console
|
|
1049
1049
|
"""
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1050
|
+
# Some ESP chips do not have this register
|
|
1051
|
+
try:
|
|
1052
|
+
if self.cache["uart_no"] is None:
|
|
1053
|
+
self.cache["uart_no"] = self.read_reg(self.UARTDEV_BUF_NO) & 0xFF
|
|
1054
|
+
return self.cache["uart_no"]
|
|
1055
|
+
except AttributeError:
|
|
1056
|
+
return None
|
|
1057
|
+
|
|
1058
|
+
def uses_usb_jtag_serial(self):
|
|
1059
|
+
"""
|
|
1060
|
+
Check if the chip uses USB JTAG/SERIAL mode.
|
|
1061
|
+
"""
|
|
1062
|
+
return False
|
|
1063
|
+
|
|
1064
|
+
def uses_usb_otg(self):
|
|
1065
|
+
"""
|
|
1066
|
+
Check if the chip uses USB OTG mode.
|
|
1067
|
+
"""
|
|
1068
|
+
return False
|
|
1069
|
+
|
|
1070
|
+
def get_usb_mode(self):
|
|
1071
|
+
"""
|
|
1072
|
+
Get the USB mode of the chip: USB-Serial/JTAG or USB-OTG. If the usb_mode is None, external USB-UART is used.
|
|
1073
|
+
"""
|
|
1074
|
+
usb_jtag_serial = self.uses_usb_jtag_serial()
|
|
1075
|
+
usb_otg = self.uses_usb_otg()
|
|
1076
|
+
|
|
1077
|
+
return "USB-Serial/JTAG" if usb_jtag_serial else "USB-OTG" if usb_otg else None
|
|
1053
1078
|
|
|
1054
1079
|
@classmethod
|
|
1055
1080
|
def parse_flash_size_arg(cls, arg):
|
|
@@ -1581,6 +1606,13 @@ class ESPLoader(object):
|
|
|
1581
1606
|
# in the stub loader
|
|
1582
1607
|
self.command(self.ESP_RUN_USER_CODE, wait_response=False)
|
|
1583
1608
|
|
|
1609
|
+
def watchdog_reset(self):
|
|
1610
|
+
print(
|
|
1611
|
+
f"WARNING: Watchdog hard reset is not supported on {self.CHIP_NAME}, "
|
|
1612
|
+
"attempting classic hard reset instead."
|
|
1613
|
+
)
|
|
1614
|
+
self.hard_reset()
|
|
1615
|
+
|
|
1584
1616
|
|
|
1585
1617
|
def slip_reader(port, trace_function):
|
|
1586
1618
|
"""Generator to read SLIP packets from a serial port.
|
|
@@ -133,9 +133,6 @@ class ESP32C2ROM(ESP32C3ROM):
|
|
|
133
133
|
self.stub_is_disabled = True
|
|
134
134
|
self.IS_STUB = False
|
|
135
135
|
|
|
136
|
-
def hard_reset(self):
|
|
137
|
-
ESPLoader.hard_reset(self)
|
|
138
|
-
|
|
139
136
|
""" Try to read (encryption key) and check if it is valid """
|
|
140
137
|
|
|
141
138
|
def is_flash_encryption_key_valid(self):
|
|
@@ -253,21 +253,15 @@ class ESP32C3ROM(ESP32ROM):
|
|
|
253
253
|
if not self.sync_stub_detected: # Don't run if stub is reused
|
|
254
254
|
self.disable_watchdogs()
|
|
255
255
|
|
|
256
|
-
def
|
|
257
|
-
|
|
258
|
-
self.rtc_wdt_reset()
|
|
259
|
-
sleep(0.5) # wait for reset to take effect
|
|
260
|
-
else:
|
|
261
|
-
ESPLoader.hard_reset(self)
|
|
262
|
-
|
|
263
|
-
def rtc_wdt_reset(self):
|
|
264
|
-
print("Hard resetting with RTC WDT...")
|
|
256
|
+
def watchdog_reset(self):
|
|
257
|
+
print("Hard resetting with a watchdog...")
|
|
265
258
|
self.write_reg(self.RTC_CNTL_WDTWPROTECT_REG, self.RTC_CNTL_WDT_WKEY) # unlock
|
|
266
259
|
self.write_reg(self.RTC_CNTL_WDTCONFIG1_REG, 2000) # set WDT timeout
|
|
267
260
|
self.write_reg(
|
|
268
261
|
self.RTC_CNTL_WDTCONFIG0_REG, (1 << 31) | (5 << 28) | (1 << 8) | 2
|
|
269
262
|
) # enable WDT
|
|
270
263
|
self.write_reg(self.RTC_CNTL_WDTWPROTECT_REG, 0) # lock
|
|
264
|
+
sleep(0.5) # wait for reset to take effect
|
|
271
265
|
|
|
272
266
|
def check_spi_connection(self, spi_connection):
|
|
273
267
|
if not set(spi_connection).issubset(set(range(0, 22))):
|
|
@@ -6,6 +6,7 @@ import struct
|
|
|
6
6
|
import time
|
|
7
7
|
from typing import Dict
|
|
8
8
|
|
|
9
|
+
from .esp32c3 import ESP32C3ROM
|
|
9
10
|
from .esp32c6 import ESP32C6ROM
|
|
10
11
|
from ..loader import ESPLoader
|
|
11
12
|
from ..util import FatalError
|
|
@@ -162,6 +163,10 @@ class ESP32C5ROM(ESP32C6ROM):
|
|
|
162
163
|
"consider using other pins for SPI flash connection."
|
|
163
164
|
)
|
|
164
165
|
|
|
166
|
+
def watchdog_reset(self):
|
|
167
|
+
# Watchdog reset disabled in parent (ESP32-C6) ROM, re-enable it
|
|
168
|
+
ESP32C3ROM.watchdog_reset(self)
|
|
169
|
+
|
|
165
170
|
|
|
166
171
|
class ESP32C5StubLoader(ESP32C5ROM):
|
|
167
172
|
"""Access class for ESP32C5 stub loader, runs on top of ROM.
|
|
@@ -192,10 +192,10 @@ class ESP32C6ROM(ESP32C3ROM):
|
|
|
192
192
|
"consider using other pins for SPI flash connection."
|
|
193
193
|
)
|
|
194
194
|
|
|
195
|
-
def
|
|
195
|
+
def watchdog_reset(self):
|
|
196
196
|
# Bug in the USB-Serial/JTAG controller can cause the port to disappear
|
|
197
|
-
# if
|
|
198
|
-
ESPLoader.
|
|
197
|
+
# if watchdog reset happens, disable it on ESP32-C6
|
|
198
|
+
ESPLoader.watchdog_reset(self)
|
|
199
199
|
|
|
200
200
|
|
|
201
201
|
class ESP32C6StubLoader(ESP32C6ROM):
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import struct
|
|
6
6
|
from typing import Dict
|
|
7
7
|
|
|
8
|
+
from .esp32c3 import ESP32C3ROM
|
|
8
9
|
from .esp32c6 import ESP32C6ROM
|
|
9
10
|
|
|
10
11
|
|
|
@@ -118,6 +119,10 @@ class ESP32C61ROM(ESP32C6ROM):
|
|
|
118
119
|
}
|
|
119
120
|
return macs.get(mac_type, None)
|
|
120
121
|
|
|
122
|
+
def watchdog_reset(self):
|
|
123
|
+
# Watchdog reset disabled in parent (ESP32-C6) ROM, re-enable it
|
|
124
|
+
ESP32C3ROM.watchdog_reset(self)
|
|
125
|
+
|
|
121
126
|
|
|
122
127
|
class ESP32C61StubLoader(ESP32C61ROM):
|
|
123
128
|
"""Access class for ESP32C61 stub loader, runs on top of ROM.
|
|
@@ -24,6 +24,9 @@ class ESP32H2ROM(ESP32C6ROM):
|
|
|
24
24
|
RTC_CNTL_SWD_WPROTECT_REG = DR_REG_LP_WDT_BASE + 0x0024 # LP_WDT_SWD_WPROTECT_REG
|
|
25
25
|
RTC_CNTL_SWD_WKEY = 0x50D83AA1 # LP_WDT_SWD_WKEY, same as WDT key in this case
|
|
26
26
|
|
|
27
|
+
UARTDEV_BUF_NO = 0x4084FEFC # Variable in ROM .bss which indicates the port in use
|
|
28
|
+
UARTDEV_BUF_NO_USB_JTAG_SERIAL = 3 # The above var when USB-JTAG/Serial is used
|
|
29
|
+
|
|
27
30
|
FLASH_FREQUENCY = {
|
|
28
31
|
"48m": 0xF,
|
|
29
32
|
"24m": 0x0,
|
|
@@ -76,9 +79,9 @@ class ESP32H2ROM(ESP32C6ROM):
|
|
|
76
79
|
# ESP32H2 XTAL is fixed to 32MHz
|
|
77
80
|
return 32
|
|
78
81
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
ESPLoader.
|
|
82
|
+
# Watchdog reset is not supported on ESP32-H2
|
|
83
|
+
def watchdog_reset(self):
|
|
84
|
+
ESPLoader.watchdog_reset(self)
|
|
82
85
|
|
|
83
86
|
def check_spi_connection(self, spi_connection):
|
|
84
87
|
if not set(spi_connection).issubset(set(range(0, 28))):
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
from .esp32h2 import ESP32H2ROM
|
|
8
|
-
from ..loader import ESPLoader
|
|
9
8
|
from ..util import FatalError
|
|
10
9
|
|
|
11
10
|
|
|
@@ -46,10 +45,6 @@ class ESP32H21ROM(ESP32H2ROM):
|
|
|
46
45
|
# ESP32H21 XTAL is fixed to 32MHz
|
|
47
46
|
return 32
|
|
48
47
|
|
|
49
|
-
def hard_reset(self):
|
|
50
|
-
# RTC WDT reset not available, do a classic reset
|
|
51
|
-
ESPLoader.hard_reset(self)
|
|
52
|
-
|
|
53
48
|
def check_spi_connection(self, spi_connection):
|
|
54
49
|
if not set(spi_connection).issubset(set(range(0, 28))):
|
|
55
50
|
raise FatalError("SPI Pin numbers must be in the range 0-27.")
|
|
@@ -262,19 +262,19 @@ class ESP32P4ROM(ESP32ROM):
|
|
|
262
262
|
"consider using other pins for SPI flash connection."
|
|
263
263
|
)
|
|
264
264
|
|
|
265
|
-
def
|
|
266
|
-
print("Hard resetting with
|
|
265
|
+
def watchdog_reset(self):
|
|
266
|
+
print("Hard resetting with a watchdog...")
|
|
267
267
|
self.write_reg(self.RTC_CNTL_WDTWPROTECT_REG, self.RTC_CNTL_WDT_WKEY) # unlock
|
|
268
268
|
self.write_reg(self.RTC_CNTL_WDTCONFIG1_REG, 2000) # set WDT timeout
|
|
269
269
|
self.write_reg(
|
|
270
270
|
self.RTC_CNTL_WDTCONFIG0_REG, (1 << 31) | (5 << 28) | (1 << 8) | 2
|
|
271
271
|
) # enable WDT
|
|
272
272
|
self.write_reg(self.RTC_CNTL_WDTWPROTECT_REG, 0) # lock
|
|
273
|
+
sleep(0.5) # wait for reset to take effect
|
|
273
274
|
|
|
274
275
|
def hard_reset(self):
|
|
275
|
-
if self.
|
|
276
|
-
self.
|
|
277
|
-
sleep(0.5) # wait for reset to take effect
|
|
276
|
+
if self.uses_usb_otg():
|
|
277
|
+
self.watchdog_reset()
|
|
278
278
|
else:
|
|
279
279
|
ESPLoader.hard_reset(self)
|
|
280
280
|
|
|
@@ -288,27 +288,27 @@ class ESP32S2ROM(ESP32ROM):
|
|
|
288
288
|
if self.uses_usb_otg():
|
|
289
289
|
self.ESP_RAM_BLOCK = self.USB_RAM_BLOCK
|
|
290
290
|
|
|
291
|
-
def
|
|
292
|
-
print("Hard resetting with
|
|
291
|
+
def watchdog_reset(self):
|
|
292
|
+
print("Hard resetting with a watchdog...")
|
|
293
293
|
self.write_reg(self.RTC_CNTL_WDTWPROTECT_REG, self.RTC_CNTL_WDT_WKEY) # unlock
|
|
294
294
|
self.write_reg(self.RTC_CNTL_WDTCONFIG1_REG, 2000) # set WDT timeout
|
|
295
295
|
self.write_reg(
|
|
296
296
|
self.RTC_CNTL_WDTCONFIG0_REG, (1 << 31) | (5 << 28) | (1 << 8) | 2
|
|
297
297
|
) # enable WDT
|
|
298
298
|
self.write_reg(self.RTC_CNTL_WDTWPROTECT_REG, 0) # lock
|
|
299
|
+
sleep(0.5) # wait for reset to take effect
|
|
299
300
|
|
|
300
301
|
def hard_reset(self):
|
|
301
302
|
uses_usb_otg = self.uses_usb_otg()
|
|
302
303
|
if uses_usb_otg:
|
|
303
|
-
# Check the strapping register to see if we can perform
|
|
304
|
+
# Check the strapping register to see if we can perform a watchdog reset
|
|
304
305
|
strap_reg = self.read_reg(self.GPIO_STRAP_REG)
|
|
305
306
|
force_dl_reg = self.read_reg(self.RTC_CNTL_OPTION1_REG)
|
|
306
307
|
if (
|
|
307
308
|
strap_reg & self.GPIO_STRAP_SPI_BOOT_MASK == 0 # GPIO0 low
|
|
308
309
|
and force_dl_reg & self.RTC_CNTL_FORCE_DOWNLOAD_BOOT_MASK == 0
|
|
309
310
|
):
|
|
310
|
-
self.
|
|
311
|
-
sleep(0.5) # wait for reset to take effect
|
|
311
|
+
self.watchdog_reset()
|
|
312
312
|
return
|
|
313
313
|
|
|
314
314
|
ESPLoader.hard_reset(self, uses_usb_otg)
|
|
@@ -352,14 +352,15 @@ class ESP32S3ROM(ESP32ROM):
|
|
|
352
352
|
if not self.sync_stub_detected: # Don't run if stub is reused
|
|
353
353
|
self.disable_watchdogs()
|
|
354
354
|
|
|
355
|
-
def
|
|
356
|
-
print("Hard resetting with
|
|
355
|
+
def watchdog_reset(self):
|
|
356
|
+
print("Hard resetting with a watchdog...")
|
|
357
357
|
self.write_reg(self.RTC_CNTL_WDTWPROTECT_REG, self.RTC_CNTL_WDT_WKEY) # unlock
|
|
358
358
|
self.write_reg(self.RTC_CNTL_WDTCONFIG1_REG, 2000) # set WDT timeout
|
|
359
359
|
self.write_reg(
|
|
360
360
|
self.RTC_CNTL_WDTCONFIG0_REG, (1 << 31) | (5 << 28) | (1 << 8) | 2
|
|
361
361
|
) # enable WDT
|
|
362
362
|
self.write_reg(self.RTC_CNTL_WDTWPROTECT_REG, 0) # lock
|
|
363
|
+
sleep(0.5) # wait for reset to take effect
|
|
363
364
|
|
|
364
365
|
def hard_reset(self):
|
|
365
366
|
try:
|
|
@@ -372,16 +373,15 @@ class ESP32S3ROM(ESP32ROM):
|
|
|
372
373
|
# Skip if response was not valid and proceed to reset; e.g. when monitoring while resetting
|
|
373
374
|
pass
|
|
374
375
|
uses_usb_otg = self.uses_usb_otg()
|
|
375
|
-
if uses_usb_otg
|
|
376
|
-
# Check the strapping register to see if we can perform
|
|
376
|
+
if uses_usb_otg:
|
|
377
|
+
# Check the strapping register to see if we can perform a watchdog reset
|
|
377
378
|
strap_reg = self.read_reg(self.GPIO_STRAP_REG)
|
|
378
379
|
force_dl_reg = self.read_reg(self.RTC_CNTL_OPTION1_REG)
|
|
379
380
|
if (
|
|
380
381
|
strap_reg & self.GPIO_STRAP_SPI_BOOT_MASK == 0 # GPIO0 low
|
|
381
382
|
and force_dl_reg & self.RTC_CNTL_FORCE_DOWNLOAD_BOOT_MASK == 0
|
|
382
383
|
):
|
|
383
|
-
self.
|
|
384
|
-
sleep(0.5) # wait for reset to take effect
|
|
384
|
+
self.watchdog_reset()
|
|
385
385
|
return
|
|
386
386
|
|
|
387
387
|
ESPLoader.hard_reset(self, uses_usb_otg)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: esptool
|
|
3
|
-
Version: 4.9.
|
|
3
|
+
Version: 4.9.dev4
|
|
4
4
|
Summary: A serial utility to communicate & flash code to Espressif chips.
|
|
5
5
|
Author: Fredrik Ahlberg (themadinventor), Angus Gratton (projectgus), Espressif Systems
|
|
6
6
|
License: GPLv2+
|
|
@@ -99,6 +99,7 @@ espefuse/efuse_defs/esp32c6.yaml
|
|
|
99
99
|
espefuse/efuse_defs/esp32c61.yaml
|
|
100
100
|
espefuse/efuse_defs/esp32h2.yaml
|
|
101
101
|
espefuse/efuse_defs/esp32h21.yaml
|
|
102
|
+
espefuse/efuse_defs/esp32h2_v0.0_v1.1.yaml
|
|
102
103
|
espefuse/efuse_defs/esp32p4.yaml
|
|
103
104
|
espefuse/efuse_defs/esp32s2.yaml
|
|
104
105
|
espefuse/efuse_defs/esp32s3.yaml
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|