TuyaOS SDK Development

Last Updated on : 2024-04-26 06:33:20download

This topic describes how to integrate and develop laser robot vacuums with TuyaOS SDK development kit.

Contact your Tuya project manager to get the TuyaOS SDK development kit.

Directory

Key files

The directory of the TuyaOS SDK development kit includes the following key files:

Name Description
apps The application code.
build The build configuration files (leave it as is).
include The header files.
libs The libraries.
Makefile The Makefile.
scripts The build framework (leave it as is).
build_app.sh The build script.

Compile code as instructed in Quick Start, and the script will automatically download your development platform. After the download is successful, the vendor folder appears in the TuyaOS directory.

Directory of vendor

The main directory of vendor is as follows: Pay attention to the TKL adaptation under the tuyaos_adapter folder.

├── docs      ## BSP documentation.
├── toolchain ## Chip platform toolchain.
└── tuyaos    ## The directory of vendor build.
    ├── build ## The entry point to vendor build.
    ├── include         ## The tuyao_iot_config.h directory.
    ├── scripts         ## The script to create libtuyaos_adapter_custom.so.
    ├── tuyaos_adapter  ## TKL functional components.
    │   ├── include   ## TKL header files.
    │   ├── src    ## TKL interface file that needs to be adapted.
    ├── build.conf   ## The URL to download BSP's library dependencies.
    ├── build_path   ## The path specified for the build toolchain.
    ├── build.sh     ## The entry point to vendor build.
    ├── IoTOSconfig     ## The main entry point to vendor configuration.
    ├── makefile        ## The main entry point to vendor build makefile.
    ├── platform.mk     ## The build parameter that the vendor passes to the application.
    └── tuyaos_kernel.config ## TKL capability configuration.

Development method

Method 1 (recommended): Develop with TuyaOS framework

Developing with the TuyaOS framework is easy and efficient. You can take advantage of the tools available in Tuya Wind IDE, leverage Tuya’s script and makefile for compilation and debugging.

  1. Copy the directory of the sample app to your build framework TuyaOS/apps/ and build all the .c files in this directory. For more information, see Quick Start.

  2. Add your BSP functional components to the vendor directory. Since firmware packaging is highly dependent on BSP, you need to complete firmware packaging. The TuyaOS framework only outputs executable programs by default.

  3. In the folder TuyaOS/vendor/<development environment>/tuyaos/tuyaos_adapter, complete the KTL interface adaptation. For more information, see Port SDK.

Method 2: Develop with SDK

If you already have your own robot vacuum code architecture and only need the library (.lib) and header (.h) files to build the executable for connecting to the Tuya platform, you can choose this development method.

  1. Copy the TuyaOS lib and include directories to your build framework, and write a build rule to specify the include path. Write the link rule to specify the lib path and link the respective library.

  2. Copy the TuyaOS/vendor/<development environment>/tuyaos/tuyaos_adapter directory to your build framework, and write a build rule to specify the tuyaos_adapter/include path.

  3. In the folder TuyaOS/vendor/<development environment>/tuyaos/tuyaos_adapter, complete the KTL interface adaptation. For more information, see Port SDK.

This way, the development kit can be integrated into your build framework.