EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1279 background imageLoading...
Page #1279 background image
Chapter 4. API Guides
The timeout period can be adjusted by setting CONFIG_BOOTLOADER_WDT_TIME_MS and recompiling the
bootloader.
The apps behaviour can be adjusted so the RTC Watchdog remains enabled after app startup. The Watch-
dog would need to be explicitly reset (i.e., fed) by the app to avoid a reset. To do this, set the CON-
FIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE option, modify the app as needed, and then recom-
pile the app.
The RTC Watchdog can be disabled in the bootloader by disabling the CON-
FIG_BOOTLOADER_WDT_ENABLE setting and recompiling the bootloader. This is not recommended.
4.3.7 Bootloader Size
When enabling additional bootloader functions, including Flash Encryption or Secure Boot, and especially if setting
a high CONFIG_BOOTLOADER_LOG_LEVEL level, then it is important to monitor the bootloader .bin files size.
When using the default CONFIG_PARTITION_TABLE_OFFSET value 0x8000, the size limit is 0x7000 (28672) bytes.
If the bootloader binary is too large, then the bootloader build will fail with an error Bootloader binary size [..] is
too large for partition table offset. If the bootloader binary is flashed anyhow then the ESP32-S2 will fail to boot -
errors will be logged about either invalid partition table or invalid bootloader checksum.
Note: The bootloader size check only happens in the CMake Build System, when using the legacy GNU Make Build
System the size is not checked but the ESP32-S2 will fail to boot if bootloader is too large.
Options to work around this are:
Set bootloader compiler optimization back to Sizeif it has been changed from this default value.
Reduce bootloader log level. Setting log level to Warning, Error or None all significantly reduce the final binary
size (but may make it harder to debug).
Set CONFIG_PARTITION_TABLE_OFFSET to a higher value than 0x8000, to place the partition table later
in the flash. This increases the space available for the bootloader. If the partition table CSV file con-
tains explicit partition osets, they will need changing so no partition has an offset lower than CON-
FIG_PARTITION_TABLE_OFFSET + 0x1000. (This includes the default partition CSV files supplied
with ESP-IDF.)
When Secure Boot V2 is enabled, there is also an absolute binary size limit of 64KB (0x10000 bytes) (excluding the
4 KB signature), because the bootloader is first loaded into a fixed size buffer for verication.
4.3.8 Fast boot from Deep Sleep
The bootloader has the CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP option which allows the
wake-up time from deep sleep to be reduced (useful for reducing power consumption). This option is available when
CONFIG_SECURE_BOOT option is disabled. Reduction of time is achieved due to the lack of image verification.
During the first boot, the bootloader stores the address of the application being launched in the RTC FAST memory.
And during the awakening, this address is used for booting without any checks, thus fast loading is achieved.
4.3.9 Custom bootloader
The current bootloader implementation allows a project to extend it or modify it. There are two ways of doing it: by
implementing hooks or by overriding it. Both ways are presented in custom_bootloader folder in ESP-IDF examples:
bootloader_hooks which presents how to connect some hooks to the bootloader initialization
bootloader_override which presents how to override the bootloader implementation
In the bootloader space, you cannot use the drivers and functions from other components. If necessary, then the
required functionality should be placed in the projects bootloader_components directory (note that this will increase
its size).
Espressif Systems 1268
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish