Skip to content

Commit

Permalink
esptool: esp32c3: Fix detection of package version
Browse files Browse the repository at this point in the history
The chip is always detected as "unknown ESP32-C3" since the bit length of
the efuse field it reads was wrong.

Closes #638

Closes #639
  • Loading branch information
xingrz authored and radimkarnis committed Jul 9, 2021
1 parent 4a1d104 commit dbbf83f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion espressif/efuse/esp32c3/mem_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class EfuseDefineFields(EfuseFieldsBase):
("SPI_PAD_CONFIG_D7", "spi_pad_config", 1, 3, 12, "uint:6", 20, None, None, "SPI D7 pad", None),
("WAFER_VERSION", "identity", 1, 3, 18, "uint:3", 20, None, None, "WAFER version",
{0: "(revision 0)", 1: "(revision 1)"}),
("PKG_VERSION", "identity", 1, 3, 21, "uint:4", 20, None, None, "Package version",
("PKG_VERSION", "identity", 1, 3, 21, "uint:3", 20, None, None, "Package version",
{0: "ESP32-C3"}),
("BLOCK1_VERSION", "identity", 1, 3, 25, "uint:3", 20, None, None, "BLOCK1 efuse version", None),
("OPTIONAL_UNIQUE_ID", "identity", 2, 0, 0, "bytes:16", 21, None, "keyblock", "Optional unique 128-bit ID", None),
Expand Down
2 changes: 1 addition & 1 deletion esptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,7 @@ def get_pkg_version(self):
num_word = 3
block1_addr = self.EFUSE_BASE + 0x044
word3 = self.read_reg(block1_addr + (4 * num_word))
pkg_version = (word3 >> 21) & 0x0F
pkg_version = (word3 >> 21) & 0x07
return pkg_version

def get_chip_revision(self):
Expand Down

0 comments on commit dbbf83f

Please sign in to comment.