TuyaOSBluetooth FrameworkEnvironment Setup

Environment Setup

Last Updated on : 2024-02-07 04:42:34download

This topic describes how to set up the compilation environment for Bluetooth sub-device development frameworks.

Install Git

Go to the Git website, download the latest release, and install it using the default settings.

Install Python

Go to the Python website, download Python 3.8.10, and install it using the default settings.

Note: After you have installed Python on Windows, the executable in the installation location is python.exe by default. Make a copy of it and rename it to python3.exe. If python3.exe already exists, skip this step.

Environment Setup

Verify the installation.

Environment Setup

Install Visual Studio Code

Go to the Visual Studio Code website, download the latest release, and install it using the default settings. The following Visual Studio Code extension is recommended:

Environment Setup

Install Tuya Wind IDE

Search for Tuya Wind IDE in the extension marketplace and install it. For more information, see Tuya Wind IDE.

Log in to Tuya Wind IDE using your Tuya IoT Development Platform account. If you do not have an account yet, register with the Tuya IoT Development Platform.

Environment Setup

Install chip-specific environment

Install the software environment for your chip platform. For more information, see Development Platform.

Get development framework

  1. Log in to Tuya Wind IDE with the account of Tuya IoT Development Platform. Click Create Framework.

    Environment Setup
  2. Select the desired development kit and click Finish to start downloading the file.

    Environment Setup
  3. Wait for the development framework to finish downloading.

    Environment Setup

Build development framework

  1. Right-click the demo directory and choose Build Project.

    Note: Before you start building, ensure that you have completed all the necessary software environment setup.

    Environment Setup
  2. Enter a version number. The version number will be applied to the generated firmware, used for authorization and OTA updates.

    Environment Setup
  3. Wait for the building to complete.

    Environment Setup

Build with third-party tools

Make sure you have built your project using Visual Studio Code before proceeding to build with third-party tools such as Keil.

Before opening a third-party tool, make sure to close Visual Studio Code to avoid any conflicts.

Find the project file for third-party tools such as Keil in the directory shown below. Open the project and start building and debugging.

Environment Setup

Add file

Do not use Keil to add source files and header files.

  1. Add the source file to the directory shown below.

    Environment Setup
  2. Add the header file to the directory shown below.

    Environment Setup
  3. After you have added the source or header files, build the code using Visual Studio Code at least once. After that, you can proceed with debugging either in Visual Studio Code or using a third-party tool.

Things to note

  • The first-time building must be done with Visual Studio Code. The script will automatically set up the compilation environment. After that, you can proceed with debugging using a third-party tool such as IAR and Keil.

  • The script in Visual Studio Code will traverse the tuyaos_demo_ble_peripheral folder and add all the source files and header files to the compilation environment.

  • Visual Studio Code generates a compilation environment each time it is going to build a project. Take care of the following:

    • When you use Tuya Wind IDE to build a project, quit third-party tools such as IAR and Keil to avoid project files being used by another program.

    • When you use a third-party tool such as IAR and Keil for debugging, do not manually add source files or header files to your project.