app_update: fix intermittent failure with firmware updates

Routine `spi_flash_cache2phys` sometimes return incorrect value,
resulting in failure in getting currently running ota partition.
This in turn aborts firmware update process.This issue was more
prominent with SPIRAM enabled cases.

Fix ensures proper cache guards during `spi_flash_cache2phys`, and
also for few other similar APIs.

In addition, `esp_ota_get_running_partition` has also been optimized
to save currently running partition for subsequent invocations.

Fixes https://github.com/espressif/esp-idf/issues/2451
This commit is contained in:
Mahavir Jain
2018-09-28 15:59:52 +05:30
committed by bot
parent 18684f53ee
commit b3aff63db4
4 changed files with 48 additions and 17 deletions

View File

@@ -68,4 +68,7 @@
// after restart or during a deep sleep / wake cycle.
#define RTC_NOINIT_ATTR __attribute__((section(".rtc_noinit")))
// Forces to not inline function
#define NOINLINE_ATTR __attribute__((noinline))
#endif /* __ESP_ATTR_H__ */