feat(spi_flash): support spi_flash on esp32h21

This commit is contained in:
C.S.M
2025-07-17 16:33:53 +08:00
parent 83ac9be085
commit bc9fa040da
3 changed files with 9 additions and 15 deletions

View File

@@ -125,16 +125,10 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr)
const char *str; const char *str;
switch (bootloader_hdr->spi_speed) { switch (bootloader_hdr->spi_speed) {
case ESP_IMAGE_SPI_SPEED_DIV_2: case ESP_IMAGE_SPI_SPEED_DIV_2:
str = "32MHz"; str = "24MHz";
break;
case ESP_IMAGE_SPI_SPEED_DIV_3:
str = "21.3MHz";
break;
case ESP_IMAGE_SPI_SPEED_DIV_4:
str = "16MHz";
break; break;
case ESP_IMAGE_SPI_SPEED_DIV_1: case ESP_IMAGE_SPI_SPEED_DIV_1:
str = "64MHz"; str = "48MHz";
break; break;
default: default:
str = "16MHz"; str = "16MHz";

View File

@@ -1,10 +1,8 @@
choice ESPTOOLPY_FLASHFREQ choice ESPTOOLPY_FLASHFREQ
prompt "Flash SPI speed" prompt "Flash SPI speed"
default ESPTOOLPY_FLASHFREQ_32M default ESPTOOLPY_FLASHFREQ_48M
config ESPTOOLPY_FLASHFREQ_64M config ESPTOOLPY_FLASHFREQ_48M
bool "64 MHz" bool "48 MHz"
config ESPTOOLPY_FLASHFREQ_32M config ESPTOOLPY_FLASHFREQ_24M
bool "32 MHz" bool "24 MHz"
config ESPTOOLPY_FLASHFREQ_16M
bool "16 MHz"
endchoice endchoice

View File

@@ -598,6 +598,8 @@ TEST_CASE_MULTI_FLASH_IGNORE("Test esp_flash_write can toggle QE bit", test_togg
// This table could be chip specific in the future. // This table could be chip specific in the future.
#if CONFIG_IDF_TARGET_ESP32C2 #if CONFIG_IDF_TARGET_ESP32C2
uint8_t flash_frequency_table[5] = {5, 10, 20, 40}; uint8_t flash_frequency_table[5] = {5, 10, 20, 40};
#elif CONFIG_IDF_TARGET_ESP32H21
uint8_t flash_frequency_table[4] = {6, 12, 24, 48};
#else #else
uint8_t flash_frequency_table[6] = {5, 10, 20, 26, 40, 80}; uint8_t flash_frequency_table[6] = {5, 10, 20, 26, 40, 80};
#endif #endif