openthread: support updating RCP with OTA over spinel

This commit is contained in:
Jiacheng Guo 2021-10-19 14:29:14 +08:00
parent 579aa4bd90
commit 674a3ff878
6 changed files with 61 additions and 5 deletions

View File

@ -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

@ -1 +1 @@
Subproject commit be71bb03345f963ee745f5e7c7e3fcdef24bf482
Subproject commit 27aede10c12614498e30151abc7117e07b3948b7

@ -1 +1 @@
Subproject commit c36c0e77a2465355bcf13bd7dc718d8c9aa6ff64
Subproject commit 0298586f97889a6609acff35e94507d0bd5d9b37

View File

@ -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

View File

@ -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
*/

View File

@ -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,

1 # Name, Type, SubType, Offset, Size, Flags
2 # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
3 nvs, data, nvs, 0x9000, 0x6000,
4 phy_init, data, phy, 0xf000, 0x1000, otadata, data, ota, , 0x2000,
5 factory, app, factory, 0x10000, 1M, phy_init, data, phy, , 0x1000,
6 ot_storage, data, 0x3a, , 0x2000, ot_storage, data, 0x3a, , 0x2000,
7 ota_0, app, ota_0, , 900K,
8 ota_1, app, ota_1, , 900K,