mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-28 04:42:11 +08:00
Merge branch 'feature/esptool_download_by_dio_mdoe_when_config_qio_qout' into 'master'
Flash firmware by DIO mode if configuration is "DIO", "QIO" or "QOUT“ See merge request sdk/ESP8266_RTOS_SDK!664
This commit is contained in:
@ -621,12 +621,16 @@ static esp_err_t bootloader_main()
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
update_flash_config(&fhdr);
|
||||
|
||||
ESP_LOGI(TAG, "ESP-IDF %s 2nd stage bootloader", IDF_VER);
|
||||
|
||||
ESP_LOGI(TAG, "compile time " __TIME__ );
|
||||
|
||||
#if defined(CONFIG_FLASHMODE_QIO) || defined(CONFIG_FLASHMODE_QOUT)
|
||||
fhdr.spi_mode = CONFIG_SPI_FLASH_MODE;
|
||||
#endif
|
||||
|
||||
update_flash_config(&fhdr);
|
||||
|
||||
print_flash_info(&fhdr);
|
||||
|
||||
return ESP_OK;
|
||||
|
@ -53,6 +53,8 @@ choice FLASHMODE
|
||||
Mode the flash chip is flashed in, as well as the default mode for the
|
||||
binary to run in.
|
||||
|
||||
The esptool.py flashes firmware at DIO mode when user select "QIO", "QOUT" or "DIO" mode.
|
||||
|
||||
config FLASHMODE_QIO
|
||||
bool "QIO"
|
||||
config FLASHMODE_QOUT
|
||||
@ -63,21 +65,13 @@ config FLASHMODE_DOUT
|
||||
bool "DOUT"
|
||||
endchoice
|
||||
|
||||
config FLASHMODE_SWITCH_TO_QIO
|
||||
bool "Try to switch to QIO mode at startup"
|
||||
default y
|
||||
depends on FLASHMODE_DIO
|
||||
help
|
||||
If users use SPI flash DIO mode to download firmware, bootloader or application
|
||||
can switch to QIO mode by enable this option.
|
||||
|
||||
# Note: we use esptool.py to flash bootloader in
|
||||
# dio mode for QIO/QOUT, bootloader then upgrades
|
||||
# itself to quad mode during initialisation
|
||||
config ESPTOOLPY_FLASHMODE
|
||||
string
|
||||
default "qio" if FLASHMODE_QIO
|
||||
default "qout" if FLASHMODE_QOUT
|
||||
default "dio" if FLASHMODE_QIO
|
||||
default "dio" if FLASHMODE_QOUT
|
||||
default "dio" if FLASHMODE_DIO
|
||||
default "dout" if FLASHMODE_DOUT
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "esp_system.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_task_wdt.h"
|
||||
#include "esp_image_format.h"
|
||||
|
||||
#define SPI_FLASH_ISSI_ENABLE_QIO_MODE (BIT(6))
|
||||
|
||||
@ -744,8 +745,9 @@ void esp_spi_flash_init(uint32_t spi_speed, uint32_t spi_mode)
|
||||
}
|
||||
SET_PERI_REG_BITS(PERIPHS_SPI_FLASH_CTRL, 0xfff, freqbits, 0);
|
||||
|
||||
#ifndef CONFIG_FLASHMODE_SWITCH_TO_QIO
|
||||
if (spi_mode == 0)
|
||||
#endif
|
||||
if (spi_mode == ESP_IMAGE_SPI_MODE_QIO || spi_mode == ESP_IMAGE_SPI_MODE_QOUT) {
|
||||
user_spi_flash_dio_to_qio_pre_init();
|
||||
|
||||
ESP_EARLY_LOGI("qio_mode", "Enabling default flash chip QIO");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user