2 Build Environment Preparation and Source-code Compiling on AmebaD SDK
There are two versions of Realtek’s AmebaD FreeRTOS SDK, namely the public version and the NDA version:
▪Public version: github on https://github.com/ambiot/ambd_sdk
▪NDA version: Required signed NDA, please contact Realtek, its distributors or its IDHs for details
Silicon Labs’ Z3GatewayFreeRTOS library and the Aliyun gateway example could be built on top of both the public version Ame-
baD SDK and the NDA version SDK. The difference is that the RTL872xCS/DN Wi-Fi and EFR32MG13/MG21 Zigbee 2.4GHz ISM
band PTA coexistence is only available on the NDA version AmebaD SDK through a SW-PTA patch applied on it.
2.1 Set up Linux Build Environment for AmebaD SDK.
Public version AmebaD SDK:
•Git clone Realtek’s public version AmebaD SDK repository to local folder, e.g. user root ~
$ cd ~
$ git clone https://github.com/ambiot/ambd_sdk.git
$ cd ambd_sdk
•Aliyun gateway application example in the LCGW v1.0.x GA release package is built on top of AmebaD SDK’s latest commit
d64c72293cd6d4b75f6b6f37eaa61376e1290e9c dated Jan 20, 2020, run below if your cloned repository is not the case:
$ git reset --hard d64c72293cd6d4b75f6b6f37eaa61376e1290e9c
•Fix some bash shell and python scripts whose executable mode were not set correctly when running on Linux:
$ chmod +x ~/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/gnu_utility/prepend_header.sh
$ chmod +x ~/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/gnu_utility/image_tool/imagetool.sh
$ chmod +x ~/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_lp/asdk/gnu_utility/pad.sh
$ chmod +x ~/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/gnu_utility/prepend_header.sh
$ chmod +x ~/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/gnu_utility/image_tool/imagetool.sh
$ chmod +x ~/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/gnu_utility/pad.sh
$ chmod +x ~/ambd_sdk/project/realtek_amebaD_va0_example/GCC-RELEASE/project_hp/asdk/code_analyze.py
NDA version AmebaD SDK:
•Please contact Realtek, its distributor for the NDA version AmebaD SDK and related patches including the SW-PTA patch
•Extract Realtek official sdk-amebad_v6.2b SDK, i.e. "00016286-sdk-amebad_v6.2b-RC.tar.bz2" to a local folder, e.g. ~
•Apply the necessary AmebaD SDK patches to the SDK local folder, e.g. sdk-amebad_v6.2b, including
1. "00016574-v6.2b_intergrated_critical_patch_gcc_IAR_v39533.zip"
2. "00017141-v6.2b_critical_patch_gcc_IAR_v39533_v40238.zip"
3. “20200324_6.2b_other_patch_sw_pta_for_gongniu_r41263.zip”(this is the SW-PTA patch required)
Reference material:
Please refer to Realtek AmebaD SDK document, AN0400 Ameba-D Application Note to compile and flash download:
https://www.amebaiot.com/en/sdk-download-manual-8722dm/
•We recommend Ubuntu 18.04 for Linux env development, it can be native Linux or a Virtual Machine Linux client, while Windows
10 WSL Linux is not recommended. BTW, Cywin 32-bit under Windows will also work but the build building time is much longer.
▪Note: You need to install 32-bit version of build packages on your Ubuntu 18.04 64-bit system as below
$ sudo apt-get update
$ sudo apt-get install build-essential gcc-multilib gcc-4.8-multilib g++-multilib
g++-4.8-multilib lib32z1 lib32ncurses5 libc6-dev libgmp-dev libmpfr-dev libmpc-dev
$ sudo dpkg --add-architecture i386
•After AmebaD environment setup, it is good to build the default sample project realtek_amebaD_va0_example and flash the
built binaries on to LCGWv2 kit to see if everything is ok before moving to the next step