Boot From Test Firmware; Rollback; Watchdog - Espressif ESP32-S2 Programming Manual

Table of Contents

Advertisement

Chapter 4. API Guides
• Clear one or more data partitions. The
users to specify which data partitions will be erased when the factory reset is executed.
Users can specify the names of partitions as a comma-delimited list with optional spaces for readability. (Like
this: nvs, phy_init, nvs_custom).
Make sure that the names of partitions specified in the option are the same as those found in the partition table.
Partitions of type "app"cannot be specified here.
• Boot from "factory"app partition. Enabling the
cause the device to boot from the default "factory"app partition after a factory reset (or if there is no factory
app partition in the partition table then the default ota app partition is selected instead). This reset process
involves erasing the OTA data partition which holds the currently selected OTA partition slot. The "factory"
app partition slot (if it exists) is never updated via OTA, so resetting to this allows reverting to a"known good"
firmware application.
Either or both of these configuration options can be enabled independently.
In addition, the following configuration options control the reset condition:
• CONFIG_BOOTLOADER_NUM_PIN_FACTORY_RESET- The input GPIO number used to trigger a factory
reset. This GPIO must be pulled low or high (configurable) on reset to trigger this.
• CONFIG_BOOTLOADER_HOLD_TIME_GPIO- this is hold time of GPIO for reset/test mode (by default 5
seconds). The GPIO must be held continuously for this period of time after reset before a factory reset or test
partition boot (as applicable) is performed.
CONFIG_BOOTLOADER_FACTORY_RESET_PIN_LEVEL
on a high or low level of the GPIO. If the GPIO has an internal pullup then this is enabled before the pin is
sampled, consult the ESP32-S2 datasheet for details on pin internal pullups.

4.3.4 Boot from Test Firmware

It's possible to write a special firmware app for testing in production, and boot this firmware when needed. The
project partition table will need a dedicated app partition entry for this testing app, type app and subtype test (see
Partition
Tables).
Implementing a dedicated test app firmware requires creating a totally separate ESP-IDF project for the test app (each
project in ESP-IDF only builds one app). The test app can be developed and tested independently of the main project,
and then integrated at production testing time as a pre-compiled .bin file which is flashed to the address of the main
project's test app partition.
To support this functionality in the main project's bootloader, set the configuration item
FIG_BOOTLOADER_APP_TEST
CONFIG_BOOTLOADER_NUM_PIN_APP_TEST
will be configured as an input with internal pull-up enabled. To trigger a test app, this GPIO must be pulled
low on reset.
Once the GPIO input is released (allowing it to be pulled up) and the device has been reboot, the normally
configured application will boot (factory or any OTA app partition slot).
CONFIG_BOOTLOADER_HOLD_TIME_GPIO
seconds). The GPIO must be held low continuously for this period of time after reset before a factory reset or
test partition boot (as applicable) is performed.

4.3.5 Rollback

Rollback and anti-rollback features must be configured in the bootloader as well.
Consult the
App rollback
and

4.3.6 Watchdog

By default, the hardware RTC Watchdog timer remains running while the bootloader is running and will automatically
reset the chip if no app has successfully started after 9 seconds.
Espressif Systems
CONFIG_BOOTLOADER_DATA_FACTORY_RESET
and configure the following two items:
- this is hold time of GPIO for reset/test mode (by default 5
Anti-rollback
sections in the
1267
Submit Document Feedback
CONFIG_BOOTLOADER_OTA_DATA_ERASE
- configure whether a factory reset should trigger
- GPIO number to boot TEST partition. The selected GPIO
OTA API reference
document.
option allows
option will
CON-
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Subscribe to Our Youtube Channel

Table of Contents

Save PDF