Skip to content

Commit

Permalink
Merge branch 'merge' into main_work
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Feb 8, 2024
2 parents f4c0f27 + 80304e6 commit 51ce4a8
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 6 deletions.
6 changes: 6 additions & 0 deletions ci/gh_changelog_template.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@
{% endfor %}

Thanks to <FILL OUT CONTRIBUTORS>, and others for contributing to this release!

# Results of checking the release against common anti-virus SW

<Upload the release binaries to VirusTotal and ADD a link to the report here>

The failures are probably false positives. You can mark esptool as safe in your anti-virus SW, or [install esptool from source](https://docs.espressif.com/projects/esptool/en/latest/installation.html).
2 changes: 1 addition & 1 deletion docs/en/espefuse/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The coding scheme helps the eFuse controller to detect an error of the eFuse blo

.. only:: esp32

* ``None`` no need any special encoding data. BLOCK0.
* ``None`` no need any special encoding data. BLOCK0 is always None.
* ``3/4``, requires encoding data. The BLOCK length is reduced from 256 bits to 192 bits.
* ``Repeat`` not supported by this tool and IDF. The BLOCK length is reduced from 256 bits to 128 bits.

Expand Down
6 changes: 5 additions & 1 deletion espefuse/efuse/esp32/emulate_efuse_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,14 @@ def handle_writing_event(self, addr, value):
self.save_to_file()

def read_raw_coding_scheme(self):
return (
coding_scheme = (
self.read_efuse(self.REGS.EFUSE_CODING_SCHEME_WORD)
& self.REGS.EFUSE_CODING_SCHEME_MASK
)
if coding_scheme == self.REGS.CODING_SCHEME_NONE_RECOVERY:
return self.REGS.CODING_SCHEME_NONE
else:
return coding_scheme

def write_raw_coding_scheme(self, value):
self.write_efuse(
Expand Down
6 changes: 5 additions & 1 deletion espefuse/efuse/esp32/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,14 @@ def __getitem__(self, efuse_name):
raise KeyError

def read_coding_scheme(self):
self.coding_scheme = (
coding_scheme = (
self.read_efuse(self.REGS.EFUSE_CODING_SCHEME_WORD)
& self.REGS.EFUSE_CODING_SCHEME_MASK
)
if coding_scheme == self.REGS.CODING_SCHEME_NONE_RECOVERY:
self.coding_scheme = self.REGS.CODING_SCHEME_NONE
else:
self.coding_scheme = coding_scheme

def print_status_regs(self):
print("")
Expand Down
9 changes: 6 additions & 3 deletions esptool/targets/esp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,12 @@ def get_chip_features(self):
coding_scheme = word6 & 0x3
features += [
"Coding Scheme %s"
% {0: "None", 1: "3/4", 2: "Repeat (UNSUPPORTED)", 3: "Invalid"}[
coding_scheme
]
% {
0: "None",
1: "3/4",
2: "Repeat (UNSUPPORTED)",
3: "None (may contain encoding data)",
}[coding_scheme]
]

return features
Expand Down
13 changes: 13 additions & 0 deletions test/test_espefuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ def get_esptool(self):
def _set_34_coding_scheme(self):
self.espefuse_py("burn_efuse CODING_SCHEME 1")

def _set_none_recovery_coding_scheme(self):
self.espefuse_py("burn_efuse CODING_SCHEME 3")

def check_data_block_in_log(
self, log, file_path, repeat=1, reverse_order=False, offset=0
):
Expand Down Expand Up @@ -1683,6 +1686,16 @@ def test_burn_bit_with_34_coding_scheme(self):
ret_code=2,
)

@pytest.mark.skipif(arg_chip != "esp32", reason="ESP32-only")
def test_burn_bit_with_none_recovery_coding_scheme(self):
self._set_none_recovery_coding_scheme()
self.espefuse_py("burn_bit BLOCK3 0 1 2 4 8 16 32 64 96 128 160 192 224 255")
self.espefuse_py(
"summary",
check_msg="17 01 01 00 01 00 00 00 01 00 00 00 01 00 00 "
"00 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 80",
)


@pytest.mark.skipif(
arg_chip != "esp32", reason="Tests are only for esp32. (TODO: add for all chips)"
Expand Down

0 comments on commit 51ce4a8

Please sign in to comment.