Supported Targets | ESP32-C2 | ESP32-C3 |
---|
This example demonstrates how to use compressed OTA by the bootloader support plus component.
The basic flow of compressed OTA:
Plaintext
************ *************
*bootloader* ---------------------->* ota_0 * <-----
************ ************* |
|decompress
************* |
* ota_1 * ------
*************
The example is a copy of simple_ota_example. Please refer the README.md for setup details.
You can also use the other samples in esp-idf/examples/system/ota directory to verify compressed OTA.
Generate the compressed app firmware in an ESP-IDF "project" directory by running:
Plaintext
idf.py gen_compressed_ota
This command will compile the project first, then it will generate the compressed app firmware. If there are no errors, the build/custom_ota_binaries
directory may contain the following file:
Plaintext
simple_ota.bin.xz
simple_ota.bin.xz.packed
The file named simple_ota.bin.xz.packed
is the actual compressed app binary file to be transferred.
In addition, if secure boot is enabled, the command will generate the signed compressed app binary file:
Plaintext
simple_ota.bin.xz.packed.signed
you can also use the script gen_custom_ota.py to compress the specified app:
Plaintext
python3 gen_custom_ota.py -hv v3 -i simple_ota.bin --add_app_header
To create a project from this example, run:
idf.py create-project-from-example "espressif/bootloader_support_plus=0.2.0:simple_ota_example"