diff --git a/components/openthread/include/esp_openthread_rcp_update.h b/components/openthread/include/esp_openthread_rcp_update.h new file mode 100644 index 0000000000..5caa5eafbb --- /dev/null +++ b/components/openthread/include/esp_openthread_rcp_update.h @@ -0,0 +1,50 @@ +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "esp_openthread.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief This function triggers an RCP firmware update. + * + * @return + * - ESP_OK + * - ESP_FAIL + * + */ +esp_err_t esp_openthread_rcp_update_start(void); + +/** + * @brief This function writes sequential firmware update data to the RCP. + * + * @param[in] data The firmware data slice + * @param[in] size The data slice size + * + * @return + * - ESP_OK + * - ESP_FAIL + * + */ +esp_err_t esp_openthread_rcp_update_write(uint8_t *data, size_t size); + +/** + * @brief This function commits the firmware update and reboots the RCP. + * + * @return + * - ESP_OK + * - ESP_FAIL + * + */ +esp_err_t esp_openthread_rcp_update_commit(void); + +#ifdef __cplusplus +} +#endif diff --git a/components/openthread/lib b/components/openthread/lib index be71bb0334..27aede10c1 160000 --- a/components/openthread/lib +++ b/components/openthread/lib @@ -1 +1 @@ -Subproject commit be71bb03345f963ee745f5e7c7e3fcdef24bf482 +Subproject commit 27aede10c12614498e30151abc7117e07b3948b7 diff --git a/components/openthread/openthread b/components/openthread/openthread index c36c0e77a2..0298586f97 160000 --- a/components/openthread/openthread +++ b/components/openthread/openthread @@ -1 +1 @@ -Subproject commit c36c0e77a2465355bcf13bd7dc718d8c9aa6ff64 +Subproject commit 0298586f97889a6609acff35e94507d0bd5d9b37 diff --git a/components/openthread/private_include/openthread-core-esp32x-ftd-config.h b/components/openthread/private_include/openthread-core-esp32x-ftd-config.h index bee73b8082..663cfcd3bb 100644 --- a/components/openthread/private_include/openthread-core-esp32x-ftd-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-ftd-config.h @@ -391,6 +391,8 @@ #endif #endif +#define OPENTHREAD_ENABLE_NCP_VENDOR_HOOK 1 + #if CONFIG_OPENTHREAD_FTD #define OPENTHREAD_FTD 1 #elif CONFIG_OPENTHREAD_MTD diff --git a/components/openthread/private_include/openthread-core-esp32x-radio-config.h b/components/openthread/private_include/openthread-core-esp32x-radio-config.h index d5be07f5ef..270f136e13 100644 --- a/components/openthread/private_include/openthread-core-esp32x-radio-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-radio-config.h @@ -286,6 +286,8 @@ */ #define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1 +#define OPENTHREAD_ENABLE_NCP_VENDOR_HOOK 1 + /** * The configurable definitions via Kconfig */ diff --git a/examples/openthread/ot_rcp/partitions.csv b/examples/openthread/ot_rcp/partitions.csv index dad8b3ef5e..520796efa2 100644 --- a/examples/openthread/ot_rcp/partitions.csv +++ b/examples/openthread/ot_rcp/partitions.csv @@ -1,6 +1,8 @@ # Name, Type, SubType, Offset, Size, Flags # 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, 1M, -ot_storage, data, 0x3a, , 0x2000, +otadata, data, ota, , 0x2000, +phy_init, data, phy, , 0x1000, +ot_storage, data, 0x3a, , 0x2000, +ota_0, app, ota_0, , 900K, +ota_1, app, ota_1, , 900K,