At -O2 optimization level, GCC seems to optimize out the copying of the
first byte of the checksum, assuming it is zero. This "miscompilation"
happens because the esp_app_desc struct is declared const, but then modified
post-compilation. Casting to volatile disables the optimization.
Closes: https://github.com/espressif/esp-idf/pull/6389
This patch modifies the OTA implementation to incremental erase flash sectors
as they are written, rather than bulk erasing them all at once when OTA begins.
This solves several problems:
- The bulk flash erase can take so long that it triggers the watchdog timer.
Disabling the watchdog is an undesirable risk.
- The bulk erase interferes with the responsiveness of the system to user input.
- Incremental erasing eliminates the need to pass the firmware image size to
esp_ota_begin to avoid erasing more flash sectors than required.
- When installing an OTA received via HTTP, the size of the firmware image is
known when the content-length header is received. Calling esp_ota_begin at that
time causes a long delay to do the bulk erase which causes the TCP transfer
speed to be measurably slowed when the transfer resumes after the erase.
Incremental erasing eliminates this TCP slowdown.
Update:
Rework so erase optimization is only applied when image_size is set to
OTA_WITH_SEQUENTIAL_WRITES #5246
Merges https://github.com/espressif/esp-idf/pull/5246
* changing dependencies from unity->cmock
* added component.mk and Makefile.projbuild
* ignore test dir in gen_esp_err_to_name.py
* added some brief introduction of CMock in IDF
Commit fc03161f updated esp_ota_get_app_elf_sha256 to store and return
X number of bytes of the hash, but the test case still expected 64 bytes.
Updated test case to use CONFIG value for expected length.
DISABLED_FOR_TARGETS macros are used
Partly revert "ci: disable unavailable tests for esp32s2beta"
This partly reverts commit 76a3a5fb48a681c5d209931ea1b1038be201c0ec.
Partly revert "ci: disable UTs for esp32s2beta without runners"
This partly reverts commit eb158e9a22c5743cd116613bac74c92b560b957a.
Partly revert "fix unit test and examples for s2beta"
This partly reverts commit 9baa7826be9e2fcf194a934763f54d3ba0a677ba.
Partly revert "efuse: Add support for esp32s2beta"
This partly reverts commit db84ba868c4c7b266f1574a1dc500203630077d8.