Set Up Environment for EFR32 Development

Last Updated on : 2024-06-25 10:12:18download

Building projects for EFR32 relies on Python scripts. If you develop on Linux or Windows, you need to install a Python 2.7.x interpreter. It is recommended to install IAR Embedded Workbench on Windows for easy development.

This topic uses the sample project under silicon_labs_zigbee\app\switch\project\sample_switch1\EFR32MG13P732F512 as an example to describe how to set up the development environment.

Install IAR

  1. Go to IAR and download IAR Embedded Workbench for Arm.

    Make sure to use the genuine IAR Embedded Workbench for ARM 8.40.1 or later versions. Version 8.40.1 is strongly recommended.

  2. Install a Python 2.7.x interpreter and set environment variables. Restart your computer after installation. Press the Window + R key to open the Run dialog. Enter CMD and press Enter for the command prompt. Then, enter Python. If Python 2.7 is displayed on the screen, it means the environment variable is configured.
    Set Up Environment for EFR32 Development

    Do not use Python later than 2.7. Otherwise, the production file cannot be built or errors occur.

  3. Restart your computer after setting.
  4. Use sample_switch1 as an example to show you how to build projects with IAR.
    1. Navigate to silicon_labs_zigbee\app\switch\project\sample_switch1\EFR32MG13P732F512.

    2. Double click tuya_sdk.eww to open the project.

    3. Build the project.

      Do not open your project by using Open Workspace. Otherwise, the build process might fail. Before Rebuild All, Clean is recommended.

      Set Up Environment for EFR32 Development

Build with GCC on Linux

Since the Zigbee SDK comes with a GCC compiler, you can navigate to sample_switch1\EFR32MG13P732F512 and run the following command to build projects.

#./ clean       // Removes intermediate files.
#./ build 0    // Build for release.
#./ build 1    // Build for debugging.
  • If you get an error on the first building, check the permissions of files.
    1. Navigate to silicon_lib_zigbee.
    2. Run chmod –R 777 *.
  • If you get an error about the dynamic library (.so), navigate to silicon_labs_zigbee/tools, delete the compiler folder gcc-arm-none-eabi-9-2019-q4-major, and unzip the compiler again.
    	tar -xvf gcc-arm-none-eabi-9-2019-q4-major.tar.bz2
  • Do not open the project with any software on Windows. Otherwise, the encoding error will cause project building on Linux to fail. Make sure to use the git clone command to create a copy of the repository on Linux.