feat(bootloader): add xmc spi_flash startup flow to improve reliability

This commit is contained in:
Dong Heng
2022-08-10 16:04:45 +08:00
parent 7270911082
commit b5301bf124
5 changed files with 192 additions and 11 deletions

View File

@@ -642,6 +642,8 @@ esp_err_t bootloader_init()
static esp_err_t bootloader_main()
{
esp_err_t ret;
#ifdef CONFIG_BOOTLOADER_DISABLE_JTAG_IO
/* Set GPIO 12-15 to be normal GPIO */
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12);
@@ -655,6 +657,11 @@ static esp_err_t bootloader_main()
uart_console_configure();
if ((ret = bootloader_flash_xmc_startup()) != ESP_OK) {
ESP_LOGE(TAG, "failed when running XMC startup flow, reboot!");
return ESP_FAIL;
}
esp_image_header_t fhdr;
if (bootloader_flash_read(ESP_BOOTLOADER_OFFSET, &fhdr, sizeof(esp_image_header_t), true) != ESP_OK) {
ESP_LOGE(TAG, "failed to load bootloader header!");