Просмотр исходного кода

esp32c3 espefuse: Fix efuse programming timing on ESP32-C3 ECO3

Without this timing change, efuse programming occasionally appears to fail
(although the efuse is programmed correctly).
Angus Gratton 4 лет назад
Родитель
Сommit
7bb5c8cc82
2 измененных файлов с 10 добавлено и 3 удалено
  1. 9 2
      components/efuse/esp32c3/esp_efuse_utility.c
  2. 1 1
      components/esptool_py/esptool

+ 9 - 2
components/efuse/esp32c3/esp_efuse_utility.c

@@ -63,8 +63,15 @@ const esp_efuse_range_addr_t range_write_addr_blocks[] = {
 // Update Efuse timing configuration
 static esp_err_t esp_efuse_set_timing(void)
 {
-    uint32_t clock_hz = esp_clk_apb_freq();
-    return ets_efuse_set_timing(clock_hz) ? ESP_FAIL : ESP_OK;
+    // efuse clock is fixed in ESP32-C3, so the ets_efuse_set_timing() function
+    // takes an argument for compatibility with older ROM functions but it's ignored.
+    int res = ets_efuse_set_timing(0);
+    assert(res == 0);
+    (void)res;
+
+    REG_SET_FIELD(EFUSE_WR_TIM_CONF2_REG, EFUSE_PWR_OFF_NUM, 0x60);
+
+    return ESP_OK;
 }
 #endif // ifndef CONFIG_EFUSE_VIRTUAL
 

+ 1 - 1
components/esptool_py/esptool

@@ -1 +1 @@
-Subproject commit ed04f90c8ee3994bfedf90de8e2450126c69f196
+Subproject commit 4698b396730b23fb4aab023c5fb1744db957fc4c