mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-19 07:55:54 +00:00
esp_flash: fix the coredump issue
During coredump, dangerous-area-checking should be disabled, and cache disabling should be replaced by a safer version. Dangerous-area-checking used to be in the HAL, but it seems to be more fit to os functions. So it's moved to os functions. Interfaces are provided to switch between os functions during coredump.
This commit is contained in:
@@ -50,6 +50,19 @@ esp_err_t esp_flash_init_default_chip(void);
|
||||
esp_err_t esp_flash_app_init(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Disable OS-level SPI flash protections in IDF
|
||||
*
|
||||
* Called by the IDF internal code (e.g. coredump). You do not need to call this in your own applications.
|
||||
*
|
||||
* @return always ESP_OK.
|
||||
*/
|
||||
#ifdef CONFIG_SPI_FLASH_USE_LEGACY_IMPL
|
||||
#define esp_flash_app_disable_protect(...) ({ESP_OK;})
|
||||
#else
|
||||
esp_err_t esp_flash_app_disable_protect(bool disable);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Initialize OS-level functions for a specific chip.
|
||||
*
|
||||
@@ -62,6 +75,25 @@ esp_err_t esp_flash_app_init(void);
|
||||
*/
|
||||
esp_err_t esp_flash_init_os_functions(esp_flash_t *chip, int host_id);
|
||||
|
||||
/**
|
||||
* Initialize OS-level functions for the main flash chip.
|
||||
*
|
||||
* @param chip The chip to init os functions. Only pointer to the default chip is supported now.
|
||||
*
|
||||
* @return always ESP_OK
|
||||
*/
|
||||
esp_err_t esp_flash_app_init_os_functions(esp_flash_t* chip);
|
||||
|
||||
/**
|
||||
* Disable OS-level functions for the main flash chip during special phases (e.g. coredump)
|
||||
*
|
||||
* @param chip The chip to init os functions. Only "esp_flash_default_chip" is supported now.
|
||||
*
|
||||
* @return always ESP_OK
|
||||
*/
|
||||
esp_err_t esp_flash_app_disable_os_functions(esp_flash_t* chip);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user