bootloader: add xmc spi_flash startup flow to improve reliability

This commit is contained in:
Michael (XIAO Xufeng)
2021-08-01 14:23:36 +08:00
parent ce9e615679
commit e00f6cbde9
10 changed files with 249 additions and 30 deletions

View File

@@ -18,10 +18,19 @@
#include "sdkconfig.h"
#include "soc/soc_caps.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Read flash ID by sending RDID command (0x9F)
* @return flash raw ID
* mfg_id = (ID >> 16) & 0xFF;
flash_id = ID & 0xffff;
*/
uint32_t bootloader_read_flash_id(void);
#if SOC_CACHE_SUPPORT_WRAP
/**
* @brief Set the burst mode setting command for specified wrap mode.
@@ -40,6 +49,13 @@ esp_err_t bootloader_flash_wrap_set(spi_flash_wrap_mode_t mode);
*/
esp_err_t bootloader_flash_unlock(void);
/**
* @brief Startup flow recommended by XMC. Call at startup before any erase/write operation.
*
* @return ESP_OK When startup successfully, otherwise ESP_FAIL (indiciating you should reboot before erase/write).
*/
esp_err_t bootloader_flash_xmc_startup(void);
#ifdef __cplusplus
}
#endif