Last Updated on : 2024-06-24 10:14:05download
This topic describes firmware updates via OTA, where the update is sent over the GATT connection between the device and either the mobile app or gateway.
Firmware updates depend on the chip platform architecture. Therefore, adaptations at the kernel layer are required for each platform. For chip platforms that have been adapted by Tuya, no more adaptations are needed. The application only needs to populate the OTA callback with the GATT data received in the Bluetooth LE data callback. For more information, see the demo in the SDK.
How firmware updates work:
The SDK supports resumable downloads for all chip platforms except TLSR825x. This feature allows the update download to be resumed from where it left off if there is a lost connection.
If the device is disconnected from the mobile app or gateway during the update process, it will restart immediately.
During initialization, the device calls the OTA initialization API to initialize variables. This API is already initialized internally in the SDK, without the application handling it.
VOID tal_ble_ota_init(VOID);
After receiving OTA data through the GATT callback, call this API to send the data to the OTA component for decryption and processing.
VOID tal_ble_ota_data_recv(UINT8_T *buf, UINT16_T len);
Implement the Bluetooth data reception callback in the application and register it to the SDK using the registration API. In this callback, pass the received TAL_BLE_EVT_WRITE_REQ
to the OTA data reception API.
VOID app_ble_data_recv(TAL_BLE_EVT_PARAMS_T *p_event)
{
switch (p_event->type) {
case TAL_BLE_EVT_WRITE_REQ:
tal_ble_ota_data_recv(p_event->ble_event.write_report.report.p_data, p_event->ble_event.write_report.report.len);
break;
default:
break;
}
}
OPERATE_RET tal_mesh_ble_recv_cb_init(TAL_BLE_EVT_FUNC_CB ble_event);
Create and manage firmware on the Tuya Developer Platform.
Log in to the Tuya Developer Platform. Go to Hardware Development and click OTA Update.
Alternatively, navigate to Firmware Update and generate a product-specific firmware update.
Update options:
Support for incremental updates varies by platform. To deploy an incremental update, you must upload the corresponding incremental package.
Before release, a firmware update needs to be verified to ensure it is properly deployed.
Enter the virtual ID of the test device. When you open the control panel of this device in the mobile app, you will receive an update notification.
Note: The test device must match the PID to which the update is deployed.
Once the update is verified, you can release it to make it available to all devices associated with the target PID.
For more information about canary release and full release, see Update Firmware.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback