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:
Michael (XIAO Xufeng)
2019-09-12 02:41:00 +08:00
parent e4b44f3488
commit d3b54ec84a
10 changed files with 100 additions and 39 deletions

View File

@@ -45,6 +45,9 @@ typedef struct {
/** Called after completing any flash operation. */
esp_err_t (*end)(void *arg);
/** Called before any erase/write operations to check whether the region is limited by the OS */
esp_err_t (*region_protected)(void* arg, size_t start_addr, size_t size);
/** Delay for at least 'ms' milliseconds. Called in between 'start' and 'end'. */
esp_err_t (*delay_ms)(void *arg, unsigned ms);
} esp_flash_os_functions_t;