Skip to content

Commit 17e1196

Browse files
committed
ESP32: bump encrypted ota component and fix the build errors
- Upgrade esp_encrypted_img dependency to version 2.3.0 - Update OTA documentation with new encrypted image generation method - Add cmake function create_esp_enc_img() to lighting-app example
1 parent 98a55fe commit 17e1196

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

config/esp32/components/chip/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,10 @@ if (CONFIG_SEC_CERT_DAC_PROVIDER)
444444
list(APPEND matter_requires espressif__esp_secure_cert_mgr)
445445
endif()
446446

447+
if (CONFIG_ENABLE_ENCRYPTED_OTA)
448+
list(APPEND matter_requires espressif__esp_encrypted_img)
449+
endif()
450+
447451
add_prebuilt_library(matterlib "${CMAKE_CURRENT_BINARY_DIR}/lib/libCHIP.a"
448452
REQUIRES ${matter_requires})
449453

config/esp32/components/chip/idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
- if: "idf_version >=4.3"
1212

1313
espressif/esp_encrypted_img:
14-
version: "2.1.0"
14+
version: "2.3.0"
1515
require: public
1616
rules:
1717
- if: "idf_version >=4.4"

docs/platforms/esp32/ota.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,21 @@ Please follow the steps below to generate an application image for OTA upgrades:
115115
python3 esp_enc_img_gen.py encrypt lighting-app.bin esp_image_encryption_public_key.pem lighting-app-encrypted.bin
116116
```
117117
118-
- Append the Matter OTA header:
118+
Optionally, you can use the cmake function `create_esp_enc_img()` to encrypt the OTA image during the build process. Please find the usage below. This is also demonstrated in the `examples/lighting-app/esp32/main/CMakeLists.txt` file.
119+
119120
```
120-
src/app/ota_image_tool.py create --vendor-id 0xFFF1 --product-id 0x8000 --version 2 --version-str "v2.0" -da sha256 lighting-app-encrypted.bin lighting-app-encrypted-ota.bin
121+
create_esp_enc_img(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
122+
${project_dir}/esp_image_encryption_public_key.pem
123+
${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-encrypted.bin
124+
app)
121125
```
122126
123-
3. Use the `lighting-app-encrypted-ota.bin` file with the OTA Provider app.
127+
3. Append the Matter OTA header
128+
```
129+
src/app/ota_image_tool.py create --vendor-id 0xFFF1 --product-id 0x8000 --version 2 --version-str "v2.0" -da sha256 lighting-app-encrypted.bin lighting-app-encrypted-ota.bin
130+
```
131+
132+
4. Use the `lighting-app-encrypted-ota.bin` file with the OTA Provider app.
124133
125134
## Delta OTA
126135

examples/lighting-app/esp32/main/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ target_compile_options(${COMPONENT_LIB} PUBLIC
8282
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>"
8383
)
8484

85+
create_esp_enc_img(${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.bin
86+
${project_dir}/esp_image_encryption_public_key.pem
87+
${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-encrypted.bin
88+
app)
89+
8590
if (CONFIG_ENABLE_PW_RPC)
8691

8792
get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH)

0 commit comments

Comments
 (0)