Update: 更新esptool ( version: 4.7.0 )
This commit is contained in:
@@ -8,6 +8,7 @@ import time
|
||||
|
||||
from .esp32c3 import ESP32C3ROM
|
||||
from loader import ESPLoader
|
||||
from util import FatalError
|
||||
|
||||
|
||||
class ESP32C2ROM(ESP32C3ROM):
|
||||
@@ -61,6 +62,8 @@ class ESP32C2ROM(ESP32C3ROM):
|
||||
[0x4037C000, 0x403C0000, "IRAM"],
|
||||
]
|
||||
|
||||
UF2_FAMILY_ID = 0x2B88D29C
|
||||
|
||||
def get_pkg_version(self):
|
||||
num_word = 1
|
||||
return (self.read_reg(self.EFUSE_BLOCK2_ADDR + (4 * num_word)) >> 22) & 0x07
|
||||
@@ -82,6 +85,16 @@ class ESP32C2ROM(ESP32C3ROM):
|
||||
num_word = 1
|
||||
return (self.read_reg(self.EFUSE_BLOCK2_ADDR + (4 * num_word)) >> 20) & 0x3
|
||||
|
||||
def get_flash_cap(self):
|
||||
# ESP32-C2 doesn't have eFuse field FLASH_CAP.
|
||||
# Can't get info about the flash chip.
|
||||
return 0
|
||||
|
||||
def get_flash_vendor(self):
|
||||
# ESP32-C2 doesn't have eFuse field FLASH_VENDOR.
|
||||
# Can't get info about the flash chip.
|
||||
return ""
|
||||
|
||||
def get_crystal_freq(self):
|
||||
# The crystal detection algorithm of ESP32/ESP8266 works for ESP32-C2 as well.
|
||||
return ESPLoader.get_crystal_freq(self)
|
||||
@@ -110,7 +123,7 @@ class ESP32C2ROM(ESP32C3ROM):
|
||||
|
||||
def _post_connect(self):
|
||||
# ESP32C2 ECO0 is no longer supported by the flasher stub
|
||||
if self.get_chip_revision() == 0:
|
||||
if not self.secure_download_mode and self.get_chip_revision() == 0:
|
||||
self.stub_is_disabled = True
|
||||
self.IS_STUB = False
|
||||
|
||||
@@ -142,6 +155,10 @@ class ESP32C2ROM(ESP32C3ROM):
|
||||
return True
|
||||
return False
|
||||
|
||||
def check_spi_connection(self, spi_connection):
|
||||
if not set(spi_connection).issubset(set(range(0, 21))):
|
||||
raise FatalError("SPI Pin numbers must be in the range 0-20.")
|
||||
|
||||
|
||||
class ESP32C2StubLoader(ESP32C2ROM):
|
||||
"""Access class for ESP32C2 stub loader, runs on top of ROM.
|
||||
|
||||
Reference in New Issue
Block a user