Wi-Fi module porting

更新时间:
复制 MD 格式

The IoT Platform software development kit (SDK) for AliOS Things includes the AliOS Things operating system (based on V1.3.4) and Link Kit V2.3.0. This document describes how to port a Wi-Fi module using this SDK.

Overview

The following figure shows the basic flow.

流程图

Chip adaptation

Before you port the IoT Platform SDK, confirm that the Wi-Fi chip in your module supports AliOS or Link Kit. If it does not, you can ask the chip vendor to port the SDK.

The following table lists the Wi-Fi chips that the IoT Platform SDK supports.

Chip vendor

Chip model

Tmall Genie

TG7100C

ASR Microelectronics

ASR5501

ASR5502

UNISOC

RDA5981X

Beken Corporation

BK7231

BK7231S

BK7231U

Realtek

RTL8710BN

MXCHIP

MOC108

MX1101

Module porting

  1. Obtain the SDK for AliOS Things. For more information, see Get the SDK.

  2. Place the application code in the appropriate SDK folder.

  3. Define the Bootloader and Flash partitions.

    The Bootloader and Flash partitions are important components that are defined in the module's folder within the `board` directory.

    AliOS Things maintains a Flash partition table for its features. This table includes the bootloader, Application, Over-the-Air (OTA) TMP, and parameters partitions, as shown in the following diagram.

    flash分区表

    Adjust the Flash partitions based on the module's Flash size and Bootloader implementation. The principles for sizing Flash partitions are as follows.

    • Obtain the Flash size of the chip platform.

    • Obtain the bootloader information. This includes the upgrade type supported by the bootloader (in-place or ping-pong) and the bootloader jump address. A ping-pong upgrade has two jump addresses.

    • Partition the entire Flash based on the information obtained from the bootloader.

    This section uses the HF-LPT230 module as an example to explain how to apply these principles to Flash partitions. This module uses the RDA5981A chip, and its Flash size is 1 MB. The partition table array hal_logic_partition_t hal_partitions[] is defined in the board/hf-lpt230/board.c file.

    Partition

    Address range

    Size

    Notes

    Bootloader

    0x18001000–0x18004000

    12 KB

    Stores the bootloader firmware

    Application

    0x18004000–0x18095000

    580 KB

    Application code partition

    OTA Storage

    0x18095000–0x180F7000

    372 KB

    OTA code partition

    PARAMETER1

    0x180F7000–0x180F8000

    4 KB

    OTA parameter storage area

    PARAMETER2

    0x180F8000–0x180FA000

    8 KB

    Key-value (KV) storage area

    PARAMETER3

    0x180FA000–0x180FB000

    4 KB

    User-defined

    PARAMETER4

    0x180FB000–0x180FC000

    4 KB

    Storage area for security-related parameters, such as ID² keys

    SYS RF Data

    0x180FC000–0x180FD000

    4 KB

    Wi-Fi module RF parameters

    HFILOP

    0x180FD000–0x180FF000

    8 KB

    Used by the module vendor to store device certificates and MAC addresses

Module self-test

After you port the SDK to the module, you must complete the module self-test. Use the test cases specified in the IoT Platform Module Vendor Self-Test Use Case Set document.

The self-test validates the module's features and stability in the following areas.

  • Device pairing

  • Device control (cloud and local)

  • Channel stability

  • Firmware upgrade

Submitting a module for testing

Module testing is optional. After you port the IoT Platform SDK to a module, you can start to develop products. To determine whether module testing is required, you must first confirm with the Alibaba Cloud IoT Smart Living team or the Tmall Genie team.

To submit a module for testing, provide the following items to feiyan_certification@alibabacloud.com.

  • Location of the code repository, including the path to the `board` folder

  • Self-test report

  • Eight module development boards with power cables, serial cables (to obtain device logs), antennas, and other accessories

The module testing flow is as follows.

测试流程

FAQ

Q: What is the relationship between the IoT Platform SDK, AliOS, and Link Kit?

A: The IoT Platform SDK is a stable, production-ready version based on AliOS v1.3.4 and Link Kit v2.3.0. It features optimized connections for regions outside China and is customized for IoT Platform services.

Q: My module is already adapted for another version of AliOS or Link Kit. Do I still need to switch to the IoT Platform SDK?

A: The IoT Platform SDK is optimized for pairing success rate, stability, connections outside China, and customization for IoT Platform services. For mass-produced products, especially those shipped in large quantities to regions outside China, you must switch to the IoT Platform SDK. If you do not switch, you may encounter issues with device pairing, cloud connectivity, stability, and compatibility.

Q: How do I start the device pairing and binding process for a module?

A: Compile the `linkkitapp` application using the command aos make clean; aos make linkkitapp@yourboardname. After the application starts, run the awss command, followed by the active_awss command. The device then enters the pairing and binding process.