-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32: Add OTA function for thread border router device #37099
base: master
Are you sure you want to change the base?
Conversation
7ae5070
to
fad010a
Compare
668d121
to
6851717
Compare
PR #37099: Size comparison from d7e30d0 to 6851717 Full report (3 builds for cc32xx, stm32)
|
6851717
to
c13b4f4
Compare
PR #37099: Size comparison from f3e4e39 to c13b4f4 Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #37099: Size comparison from 593861d to ad949c7 Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #37099: Size comparison from b02badf to 2f0bce1 Full report (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
2f0bce1
to
f487cc2
Compare
PR #37099: Size comparison from 1348a8a to 28f443f Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
@@ -92,3 +93,15 @@ the Thread network. | |||
``` | |||
./chip-tool pairing ble-wifi 2 hex:<dataset_tlvs> <pincode> <discriminator> | |||
``` | |||
|
|||
### Generate OTA Firmware For BR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users don't need to do this manually, the esp_rcp_update
component will do this automatically if option RCP_PARTITION_NAME is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we do it automatically when CHIP_OTA_IMAGE_BUILD
is enabled?
ota_1, app, ota_1, , 1800K, | ||
rcp_fw, data, spiffs, , 300K, | ||
ota_0, app, ota_0, , 1700k, | ||
ota_1, app, ota_1, , 1600k, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The size of ota_0 and ota_1 should be the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -29,8 +29,9 @@ CONFIG_BT_NIMBLE_ENABLE_CONN_REATTEMPT=n | |||
|
|||
# Increase some stack size | |||
CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=7200 | |||
CONFIG_ESP_MAIN_TASK_STACK_SIZE=5120 | |||
CONFIG_ESP_MAIN_TASK_STACK_SIZE=10240 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you double check if this change is necessary, 10K is too large..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -196,8 +196,18 @@ static void try_update_ot_rcp(const esp_openthread_platform_config_t * config) | |||
static void rcp_failure_handler(void) | |||
{ | |||
esp_rcp_mark_image_unusable(); | |||
try_update_ot_rcp(s_platform_config); | |||
esp_rcp_reset(); | |||
char internal_rcp_version[kRcpVersionMaxSize]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try esp_rcp_reset()
first, RCP update or restart should be used only when esp_rcp_reset()
can't recover it.
28f443f
to
6b97dd6
Compare
6b97dd6
to
6c4ea89
Compare
PR #37099: Size comparison from 0bae36f to 7d42b64 Full report (71 builds for bl602, bl702, bl702l, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
|
||
#if defined(CONFIG_AUTO_UPDATE_RCP) && defined(CONFIG_OPENTHREAD_BORDER_ROUTER) | ||
esp_rcp_ota_handle_t mRcpOtaHandle; | ||
bool mRcpDone; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to rename it to mRcpFirmwareDownloaded
.
@@ -92,3 +93,15 @@ the Thread network. | |||
``` | |||
./chip-tool pairing ble-wifi 2 hex:<dataset_tlvs> <pincode> <discriminator> | |||
``` | |||
|
|||
### Generate OTA Firmware For BR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we do it automatically when CHIP_OTA_IMAGE_BUILD
is enabled?
@@ -280,6 +280,37 @@ esp_err_t OTAImageProcessorImpl::DeltaOTAWriteCallback(const uint8_t * buf, size | |||
} | |||
#endif // CONFIG_ENABLE_DELTA_OTA | |||
|
|||
#if defined(CONFIG_AUTO_UPDATE_RCP) && defined(CONFIG_OPENTHREAD_BORDER_ROUTER) | |||
esp_err_t OTAImageProcessorImpl::ProcessRcpImage(intptr_t context, const uint8_t * buffer, uint32_t bufLen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we use a context for an OTAImageProcessorImpl in a non-static function? Please use this
instead.
2a0471b
to
cd39362
Compare
cd39362
to
1a51dfe
Compare
PR #37099: Size comparison from 79da246 to c6a1c74 Full report (75 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
Add OTA function for Thread border, the OTA firmware include both Thread BR's firmware and RCP's firmware.
Testing
Tested on thread_br_app example for esp32