diff --git a/examples/openthread/ot_br/main/idf_component.yml b/examples/openthread/ot_br/main/idf_component.yml index 6567df8d22..947edba2dd 100644 --- a/examples/openthread/ot_br/main/idf_component.yml +++ b/examples/openthread/ot_br/main/idf_component.yml @@ -1,7 +1,7 @@ ## IDF Component Manager Manifest File dependencies: espressif/esp_ot_cli_extension: - version: "~0.4.0" + version: "~1.0.0" espressif/mdns: "^1.0.3" ## Required IDF version idf: diff --git a/examples/openthread/ot_br/partitions.csv b/examples/openthread/ot_br/partitions.csv index 4305c74725..1da5005fac 100644 --- a/examples/openthread/ot_br/partitions.csv +++ b/examples/openthread/ot_br/partitions.csv @@ -2,4 +2,4 @@ # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap nvs, data, nvs, 0x9000, 0x6000, phy_init, data, phy, 0xf000, 0x1000, -factory, app, factory, 0x10000, 1600K, +factory, app, factory, 0x10000, 1700K, diff --git a/examples/openthread/ot_rcp/README.md b/examples/openthread/ot_rcp/README.md index 0096e99bb6..a3f1b8eefd 100644 --- a/examples/openthread/ot_rcp/README.md +++ b/examples/openthread/ot_rcp/README.md @@ -19,6 +19,34 @@ To run this example, a board with IEEE 802.15.4 module (for example ESP32-H2) is The default communication interface is port 0 of ESP32-H2 UART running at 460800 baud, change the configuration in [esp_ot_config.h](main/esp_ot_config.h) if you want to use another interface or need different communication parameters. +### RCP Size Optimization Configuration + +To optimize the size of the RCP firmware, the following configurations are enabled by default: + +``` +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y +CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y +CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS=y +CONFIG_ESP_ERR_TO_NAME_LOOKUP=n +CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT=y +CONFIG_LOG_DEFAULT_LEVEL_NONE=y +CONFIG_NEWLIB_NANO_FORMAT=y +CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n +CONFIG_OPENTHREAD_LOG_LEVEL_NONE=y +``` +Configure them via `idf.py menuconfig` if you need. + +The firmware size are as follows (reference value): + +``` + Before Optimization After Optimization + +esp_ot_rcp.bin for esp32h2 314KB 184KB + +esp_ot_rcp.bin for esp32c6 299KB 208kb +``` + ### Build and Flash Build the project and flash it to the board: diff --git a/examples/openthread/ot_rcp/sdkconfig.defaults b/examples/openthread/ot_rcp/sdkconfig.defaults index 3b8c9d13e4..cc6c671d8e 100644 --- a/examples/openthread/ot_rcp/sdkconfig.defaults +++ b/examples/openthread/ot_rcp/sdkconfig.defaults @@ -19,12 +19,13 @@ CONFIG_PARTITION_TABLE_MD5=y # CONFIG_OPENTHREAD_ENABLED=y CONFIG_OPENTHREAD_RADIO=y -CONFIG_OPENTHREAD_DIAG=y +CONFIG_OPENTHREAD_DIAG=n CONFIG_OPENTHREAD_COMMISSIONER=n CONFIG_OPENTHREAD_JOINER=n CONFIG_OPENTHREAD_BORDER_ROUTER=n CONFIG_OPENTHREAD_CLI=n CONFIG_OPENTHREAD_SRP_CLIENT=n +CONFIG_OPENTHREAD_DNS_CLIENT=n # end of OpenThread @@ -34,3 +35,18 @@ CONFIG_OPENTHREAD_SRP_CLIENT=n CONFIG_LOG_BOOTLOADER_LEVEL_ERROR=y CONFIG_LOG_BOOTLOADER_LEVEL_INFO=n # End of deprecated options + + +# +# Configurations for optimizing the size of ot_rcp firmware +# +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y +CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y +CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS=y +CONFIG_ESP_ERR_TO_NAME_LOOKUP=n +CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT=y +CONFIG_LOG_DEFAULT_LEVEL_NONE=y +CONFIG_NEWLIB_NANO_FORMAT=y +CONFIG_OPENTHREAD_LOG_LEVEL_DYNAMIC=n +CONFIG_OPENTHREAD_LOG_LEVEL_NONE=y