Skip to content

Commit

Permalink
espefuse (esp32c2): Adds wafer major and minor version eFuses
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinKondrashov authored and dobairoland committed Jul 27, 2022
1 parent 7cfb172 commit fcc8dc5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion espefuse/efuse/esp32c2/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self, esp, skip_connect=False, debug=False, do_not_confirm=False):
for efuse in self.Fields.BLOCK2_CALIBRATION_EFUSES
]
else:
if self["BLOCK2_VERSION"].get() == 1:
if self["BLOCK2_VERSION_MINOR"].get() == 1:
self.efuses += [
EfuseField.from_tuple(
self, self.Fields.get(efuse), self.Fields.get(efuse).class_type
Expand Down
12 changes: 5 additions & 7 deletions espefuse/efuse/esp32c2/mem_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,14 @@ class EfuseDefineFields(EfuseFieldsBase):
# Parameters in BLOCK2
# Name Category Block Word Pos Type:len WR_DIS RD_DIS Class Description Dictionary
("MAC", "identity", 2, 0, 0, "bytes:6", 6, None, 'mac', "Factory MAC Address", None),
("WAFER_VERSION", "identity", 2, 1, 16, "uint:3", 6, None, None, "WAFER version",
{0: "(revision 0)",
1: "(revision 1)"}),
("PKG_VERSION", "identity", 2, 1, 19, "uint:3", 6, None, None, "Package version",
("WAFER_VERSION_MINOR", "identity", 2, 1, 16, "uint:4", 6, None, None, "Minor WAFER version", None),
("WAFER_VERSION_MAJOR", "identity", 2, 1, 20, "uint:2", 6, None, None, "Major WAFER version", None),
("PKG_VERSION", "identity", 2, 1, 22, "uint:3", 6, None, None, "Package version",
{0: "ESP32-C2"}),
("BLOCK2_VERSION", "identity", 2, 1, 22, "uint:3", 6, None, None, "Version of BLOCK2",
("BLOCK2_VERSION_MINOR", "identity", 2, 1, 25, "uint:3", 6, None, None, "Minor version of BLOCK2",
{0: "No calibration", 1: "With calibration"}),

("RF_REF_I_BIAS_CONFIG", "rf", 2, 1, 25, "uint:3", 6, None, None, "", None),
("LDO_VOL_BIAS_CONFIG_LOW", "ldo", 2, 1, 29, "uint:3", 6, None, None, "", None),
("BLOCK2_VERSION_MAJOR", "identity", 2, 1, 28, "uint:2", 6, None, None, "Major version of BLOCK2", None),
("LDO_VOL_BIAS_CONFIG_HIGH", "ldo", 2, 2, 0, "uint:27", 6, None, None, "", None),
("PVT_LOW", "pvt", 2, 2, 27, "uint:5", 6, None, None, "", None),
("PVT_HIGH", "pvt", 2, 3, 0, "uint:10", 6, None, None, "", None),
Expand Down
4 changes: 2 additions & 2 deletions espefuse/efuse/esp32c2/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def set_flash_voltage(esp, efuses, args):
def adc_info(esp, efuses, args):
print("")
# fmt: off
if efuses["BLOCK2_VERSION"].get() == 1:
if efuses["BLOCK2_VERSION_MINOR"].get() == 1:
print(" RF_REF_I_BIAS_CONFIG: {}".format(efuses["RF_REF_I_BIAS_CONFIG"].get()))

print(" LDO_VOL_BIAS_CONFIG_LOW: {}".format(efuses["LDO_VOL_BIAS_CONFIG_LOW"].get()))
Expand All @@ -165,7 +165,7 @@ def adc_info(esp, efuses, args):
print(" ADC_CALIBRATION_2: {}".format(efuses["ADC_CALIBRATION_2"].get()))

else:
print("BLOCK2_VERSION = {}".format(efuses["BLOCK2_VERSION"].get_meaning()))
print("BLOCK2_VERSION_MINOR = {}".format(efuses["BLOCK2_VERSION_MINOR"].get_meaning()))
# fmt: on


Expand Down

0 comments on commit fcc8dc5

Please sign in to comment.