You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
esptool.py v3.3.1
Serial port /dev/cu.usbserial-14110
Connecting....
Detecting chip type... ESP32-C2
Chip is ESP32-C2 (revision 1)
Features: Wi-Fi
Crystal is 40MHz
MAC: 10:97:bd:f1:e6:3c
Uploading stub...
Running stub...
Stub running...
Manufacturer: 5e
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...
More Information
esptool.py works well, actually. But after reviewing the code, I found something inconsistent.
According to esp_efuse_table.csv#L69 in ESP-IDF, the position of PKG_VERSION is at bit 54 of EFUSE_BLK2 (which is also EFUSE_RD_BLK2_DATA0_REG).
As we learn from efuse_reg.h#L312, the value of EFUSE_RD_BLK2_DATA0_REG is DR_REG_EFUSE_BASE + 0x40 and EFUSE_RD_BLK2_DATA1_REG is DR_REG_EFUSE_BASE + 0x44. So we can infer that the bit position of PKG_VERSION counting from 0x044 should be 22.
While in esp32c2.py#L55, we read the forth word (EFUSE_BASE + 0x044 plus 12 bytes) and right shifted 21 bits (considering the byte order, means moving the pointer right 21 bits). This is actually 12 bytes + 21 bits = 117 bits counting from 0x044, or bit 149 counting from EFUSE_BLK2.
github-actionsbot
changed the title
Inconsistency of bit position reading pkg_version from ESP32-C2
Inconsistency of bit position reading pkg_version from ESP32-C2 (ESPTOOL-487)
Jul 18, 2022
Operating System
macOS 12.4
Esptool Version
v4.1-15-g65f8614
Python Version
Python 3.9.13
Chip Description
ESP32-C2
Device Description
ESP8684-DevKitM-1
Hardware Configuration
No response
How is Esptool Run
Terminal (iTerm.app)
Full Esptool Command Line that Was Run
esptool.py --port /dev/cu.usbserial-14110 flash_id
Esptool Output
More Information
esptool.py
works well, actually. But after reviewing the code, I found something inconsistent.According to esp_efuse_table.csv#L69 in ESP-IDF, the position of
PKG_VERSION
is at bit54
ofEFUSE_BLK2
(which is alsoEFUSE_RD_BLK2_DATA0_REG
).As we learn from efuse_reg.h#L312, the value of
EFUSE_RD_BLK2_DATA0_REG
isDR_REG_EFUSE_BASE + 0x40
andEFUSE_RD_BLK2_DATA1_REG
isDR_REG_EFUSE_BASE + 0x44
. So we can infer that the bit position ofPKG_VERSION
counting from0x044
should be22
.While in esp32c2.py#L55, we read the forth word (
EFUSE_BASE + 0x044
plus 12 bytes) and right shifted 21 bits (considering the byte order, means moving the pointer right 21 bits). This is actually12 bytes + 21 bits = 117 bits
counting from0x044
, or bit149
counting fromEFUSE_BLK2
.esptool/esptool/targets/esp32c2.py
Lines 52 to 55 in 65f8614
Other Steps to Reproduce
No response
I Have Read the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: