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

fix: Fix ESP32-C6 SPI config retreival

The efuse positions in ESP32-C6 for SPI config were changed, however as
the chip itself and some other new chips lacks support for configurable
SPI completely, we are adding a function to bypass the check.

Closes https://github.com/espressif/esp-serial-flasher/issues/80
Djordje Nedic 2 лет назад
Родитель
Сommit
4787c45084
2 измененных файлов с 10 добавлено и 2 удалено
  1. 1 1
      idf_component.yml
  2. 9 1
      src/esp_targets.c

+ 1 - 1
idf_component.yml

@@ -1,3 +1,3 @@
-version: "0.4.0"
+version: "0.4.1"
 description: Serial flasher component provides portable library for flashing or loading ram loadble app to Espressif SoCs from other host microcontroller
 url: https://github.com/espressif/esp-serial-flasher

+ 9 - 1
src/esp_targets.c

@@ -39,6 +39,7 @@ typedef struct {
 
 static esp_loader_error_t spi_config_esp32(uint32_t efuse_base, uint32_t *spi_config);
 static esp_loader_error_t spi_config_esp32xx(uint32_t efuse_base, uint32_t *spi_config);
+static esp_loader_error_t spi_config_unsupported(uint32_t efuse_base, uint32_t *spi_config);
 
 static const esp_target_t esp_target[ESP_MAX_CHIP] = {
 
@@ -188,7 +189,7 @@ static const esp_target_t esp_target[ESP_MAX_CHIP] = {
         },
         .efuse_base = 0x600B0800,
         .chip_magic_value = { 0x2CE0806F, 0 },
-        .read_spi_config = spi_config_esp32xx,
+        .read_spi_config = spi_config_unsupported,
         .encryption_in_begin_flash_cmd = true,
     },
 };
@@ -282,6 +283,13 @@ static esp_loader_error_t spi_config_esp32xx(uint32_t efuse_base, uint32_t *spi_
     return ESP_LOADER_SUCCESS;
 }
 
+// Some newer chips like the esp32c6 do not support configurable SPI
+static esp_loader_error_t spi_config_unsupported(uint32_t efuse_base, uint32_t *spi_config)
+{
+    *spi_config = 0;
+    return ESP_LOADER_SUCCESS;
+}
+
 bool encryption_in_begin_flash_cmd(const target_chip_t target)
 {
     return esp_target[target].encryption_in_begin_flash_cmd;