mqtt/ssl_ds: Add documentation on how to use esp-secure-cert-tool with

the example
This commit is contained in:
Aditya Patwardhan 2022-08-25 09:11:30 +05:30
parent 69be3b6955
commit cbecb2e944
4 changed files with 17 additions and 3 deletions

View File

@ -9,4 +9,11 @@ set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_exam
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(mqtt_ssl_ds)
# Flash the custom partition named `esp_secure_cert`.
set(partition esp_secure_cert)
idf_build_get_property(project_dir PROJECT_DIR)
set(image_file ${project_dir}/esp_secure_cert_data/${partition}.bin)
partition_table_get_partition_info(offset "--partition-name ${partition}" "offset")
esptool_py_flash_target_image(flash "${partition}" "${offset}" "${image_file}")
target_add_binary_data(${CMAKE_PROJECT_NAME}.elf "main/mosquitto.org.crt" TEXT)

View File

@ -48,11 +48,12 @@ Paste the generated CSR in the [Mosquitto test certificate signer](https://test.
```
pip install esp-secure-cert-tool
```
* The DS peripheral can be configured by executing the following command:
* ii) The DS peripheral can be configured by executing the following command:
```
configure_esp_secure_cert.py -p /* Serial port */ --device-cert /* Device cert */ --private-key /* RSA priv key */ --target_chip /* target chip */ --configure_ds
configure_esp_secure_cert.py -p /* Serial port */ --device-cert /* Device cert */ --private-key /* RSA priv key */ --target_chip /* target chip */ --configure_ds --skip_flash
```
This command shall generate a partition named `esp_secure_cert.bin` in the `esp_secure_cert_data` directory. This partition would be aumatically detected by the build system and flashed at appropriate offset when `idf.py flash` command is used. For this process, the command must be executed in the current folder only.
In the command USB COM port is nothing but the serial port to which the ESP chip is connected. see
[check serial port](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/establish-serial-connection.html#check-port-on-windows) for more details.

View File

@ -1,6 +1,6 @@
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
esp_secure_cert,0x3F,,0xD000,0x2000,
esp_secure_cert,0x3F,,,0x2000,
nvs,data,nvs,,24K,
phy_init,data,phy,,4K,
factory,app,factory,0x20000,1M,

1 # ESP-IDF Partition Table
2 # Name, Type, SubType, Offset, Size, Flags
3 esp_secure_cert,0x3F,,0xD000,0x2000, esp_secure_cert,0x3F,,,0x2000,
4 nvs,data,nvs,,24K,
5 phy_init,data,phy,,4K,
6 factory,app,factory,0x20000,1M,

View File

@ -1 +1,7 @@
CONFIG_PARTITION_TABLE_CUSTOM=y
# Setting partition table offset to 0xC000 would make the address of
# `esp_secure_cert` partition as 0xD000 (comes next in the sequence).
# Modules that are programmed with Espressif Secure Pre Provisioining service
# uses this offset for `esp_secure_cert` and hence this change aligns this example
# to work on those modules.
CONFIG_PARTITION_TABLE_OFFSET=0xC000