mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-28 21:03:59 +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;
|
return ESP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
update_flash_config(&fhdr);
|
|
||||||
|
|
||||||
ESP_LOGI(TAG, "ESP-IDF %s 2nd stage bootloader", IDF_VER);
|
ESP_LOGI(TAG, "ESP-IDF %s 2nd stage bootloader", IDF_VER);
|
||||||
|
|
||||||
ESP_LOGI(TAG, "compile time " __TIME__ );
|
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);
|
print_flash_info(&fhdr);
|
||||||
|
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
|
@ -53,6 +53,8 @@ choice FLASHMODE
|
|||||||
Mode the flash chip is flashed in, as well as the default mode for the
|
Mode the flash chip is flashed in, as well as the default mode for the
|
||||||
binary to run in.
|
binary to run in.
|
||||||
|
|
||||||
|
The esptool.py flashes firmware at DIO mode when user select "QIO", "QOUT" or "DIO" mode.
|
||||||
|
|
||||||
config FLASHMODE_QIO
|
config FLASHMODE_QIO
|
||||||
bool "QIO"
|
bool "QIO"
|
||||||
config FLASHMODE_QOUT
|
config FLASHMODE_QOUT
|
||||||
@ -63,21 +65,13 @@ config FLASHMODE_DOUT
|
|||||||
bool "DOUT"
|
bool "DOUT"
|
||||||
endchoice
|
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
|
# Note: we use esptool.py to flash bootloader in
|
||||||
# dio mode for QIO/QOUT, bootloader then upgrades
|
# dio mode for QIO/QOUT, bootloader then upgrades
|
||||||
# itself to quad mode during initialisation
|
# itself to quad mode during initialisation
|
||||||
config ESPTOOLPY_FLASHMODE
|
config ESPTOOLPY_FLASHMODE
|
||||||
string
|
string
|
||||||
default "qio" if FLASHMODE_QIO
|
default "dio" if FLASHMODE_QIO
|
||||||
default "qout" if FLASHMODE_QOUT
|
default "dio" if FLASHMODE_QOUT
|
||||||
default "dio" if FLASHMODE_DIO
|
default "dio" if FLASHMODE_DIO
|
||||||
default "dout" if FLASHMODE_DOUT
|
default "dout" if FLASHMODE_DOUT
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_task_wdt.h"
|
#include "esp_task_wdt.h"
|
||||||
|
#include "esp_image_format.h"
|
||||||
|
|
||||||
#define SPI_FLASH_ISSI_ENABLE_QIO_MODE (BIT(6))
|
#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);
|
SET_PERI_REG_BITS(PERIPHS_SPI_FLASH_CTRL, 0xfff, freqbits, 0);
|
||||||
|
|
||||||
#ifndef CONFIG_FLASHMODE_SWITCH_TO_QIO
|
if (spi_mode == ESP_IMAGE_SPI_MODE_QIO || spi_mode == ESP_IMAGE_SPI_MODE_QOUT) {
|
||||||
if (spi_mode == 0)
|
|
||||||
#endif
|
|
||||||
user_spi_flash_dio_to_qio_pre_init();
|
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