Skip to content

Commit 0716db7

Browse files
committed
esp32c2: Correct revision reading, deprecate eco0 stub
1 parent ee40afa commit 0716db7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

esptool.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2417,7 +2417,8 @@ class ESP32C2ROM(ESP32C3ROM):
24172417
DROM_MAP_START = 0x3c000000
24182418
DROM_MAP_END = 0x3c400000
24192419

2420-
CHIP_DETECT_MAGIC_VALUE = [0x7c41a06f]
2420+
# Magic value for ESP32C2 ECO0 and ECO1 respectively
2421+
CHIP_DETECT_MAGIC_VALUE = [0x6F51306F, 0x7c41a06f]
24212422

24222423
EFUSE_BASE = 0x60008800
24232424
MAC_EFUSE_REG = EFUSE_BASE + 0x040
@@ -2444,6 +2445,16 @@ def get_chip_description(self):
24442445

24452446
return "%s (revision %d)" % (chip_name, chip_revision)
24462447

2448+
def get_chip_revision(self):
2449+
si = self.get_security_info()
2450+
return si["api_version"]
2451+
2452+
def _post_connect(self):
2453+
# ESP32C2 ECO0 is no longer supported by the flasher stub
2454+
if self.get_chip_revision() == 0:
2455+
self.stub_is_disabled = True
2456+
self.IS_STUB = False
2457+
24472458

24482459
class ESP32C6BETAROM(ESP32C3ROM):
24492460
CHIP_NAME = "ESP32-C6(beta)"

0 commit comments

Comments
 (0)