From 0bafdaf5f0f44295597cf2db8c36447675183339 Mon Sep 17 00:00:00 2001 From: Glenn Moloney Date: Thu, 17 Aug 2023 13:24:25 +1000 Subject: [PATCH] esp32: Skip validation of image on boot from deepsleep. sdkconfig.base: Add CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y. This reduces time to boot from deepsleep by at least 200ms and can provide significant power savings for deepsleep-based battery applications. docs/library/esp32.rst: Add note cautioning not to enter deepsleep after changing the boot partition, without first performing a hard reset. Signed-off-by: Glenn Moloney --- docs/library/esp32.rst | 5 +++++ ports/esp32/boards/sdkconfig.base | 1 + 2 files changed, 6 insertions(+) diff --git a/docs/library/esp32.rst b/docs/library/esp32.rst index 856d9aef8d..d6b4051a2f 100644 --- a/docs/library/esp32.rst +++ b/docs/library/esp32.rst @@ -114,6 +114,11 @@ methods to enable over-the-air (OTA) updates. Sets the partition as the boot partition. + .. note:: Do not enter :func:`deepsleep` after changing + the OTA boot partition, without first performing a hard + :func:`reset` or power cycle. This ensures the bootloader + will validate the new image before booting. + .. method:: Partition.get_next_update() Gets the next update partition after this one, and returns a new Partition object. diff --git a/ports/esp32/boards/sdkconfig.base b/ports/esp32/boards/sdkconfig.base index 7443b34aa7..4b7c852332 100644 --- a/ports/esp32/boards/sdkconfig.base +++ b/ports/esp32/boards/sdkconfig.base @@ -13,6 +13,7 @@ CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR=y # Bootloader config CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y +CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y # Change default log level to "ERROR" (instead of "INFO") CONFIG_LOG_DEFAULT_LEVEL_INFO=n