Overview of migrating Tuya's MCU SDK

Overview of migrating Tuya’s MCU SDK

1. Introduction

The mcu_sdk package contains the MCU code that is automatically generated based on product functions defined on the Tuya Smart platform. The communication and protocol resolution architecture is prepared and can be directly added to the original MCU project to quickly develop MCU programs.

2. Precautions

The SDK package has the following requirements on MCU hardware resources:

  • Flash memory: 4 KB

  • RAM: tens of bytes (depending on the DP data length), or 260 KB or higher if the OTA upgrade function is required

  • The number of nested functions is 9.

Users without sufficient resources can implement protocol interworking without using the MCU SDK.

3. ile Structure

Execution File Header File Description
mcu_api.c mcu_api.h Contain Wi-Fi–related functions. Customers can invoke the functions on demand.
protocol.c protocol.h Protocol files that contain data processing functions. Users need to modify the two files based on project requirements.
system.c system.h Contain detailed implementation of the serial port communication protocol.
wifi.h Contains Wi-Fi–related macro definitions.

4. Roadmap

Step 1: Compile the MCU basic program and migrate the SDK file.

Step 2: Verify the macro definition in protocol.h.

Step 3: Migrate the protocol.c file and invoke functions.

Step 4: Optimize the DP data report and delivery functions.

Step 5: Optimize the network configuration and indicator functions.

Step 6: Optimize the product testing function.

400 Call