mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/fix_ota_crash' into 'master'
fix: app crash when OTA because the OTA task's stack is in rtc fast memory See merge request espressif/esp-idf!15720
This commit is contained in:
commit
caa9e323cc
@ -80,6 +80,17 @@ static volatile bool s_flash_op_complete = false;
|
||||
static volatile int s_flash_op_cpu = -1;
|
||||
#endif
|
||||
|
||||
static inline bool esp_task_stack_is_sane_cache_disabled(void)
|
||||
{
|
||||
const void *sp = (const void *)esp_cpu_get_sp();
|
||||
|
||||
return esp_ptr_in_dram(sp)
|
||||
#if CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP
|
||||
|| esp_ptr_in_rtc_dram_fast(sp)
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
void spi_flash_init_lock(void)
|
||||
{
|
||||
s_flash_op_mutex = xSemaphoreCreateRecursiveMutex();
|
||||
@ -127,7 +138,7 @@ void IRAM_ATTR spi_flash_op_block_func(void *arg)
|
||||
|
||||
void IRAM_ATTR spi_flash_disable_interrupts_caches_and_other_cpu(void)
|
||||
{
|
||||
assert(esp_ptr_in_dram((const void *)esp_cpu_get_sp()));
|
||||
assert(esp_task_stack_is_sane_cache_disabled());
|
||||
|
||||
spi_flash_op_lock();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user