Wi-Fi Basic Architecture

WHC IPC is the default wireless communication architecture in the SDK, offering full-chip compatibility. Its core features include:

  • Dual-core Architecture

    • Based on the AP and NP dual-core design of the Ameba chip

    • Enables communication between Host and Device through internal IPC interfaces

    • No external Host controller required

  • Parallel Protocol Stack Execution

    • LWIP network protocol layer and Wi-Fi driver layer run on separate cores

    • Enables parallel processing to enhance data transmission efficiency

  • Modular Isolation Design

    • Achieves secure decoupling between the WiFi driver layer and user application layer

    • Improves system security, reliability, and robustness


../../_images/wifi_basic_architecture.svg

WHC IPC architecture

Wi-Fi Initialization

The SDK enables Wi-Fi functionality by default. In the main() function, it automatically calls wifi_init() to initialize Wi-Fi. The complete Wi-Fi initialization flow is shown below:

../../_images/wifi_basic_init.svg

Note

  • After successful Wi-Fi initialization, the device defaults to STA Mode.

  • To enable SoftAP Mode, call wifi_start_ap() after Wi-Fi initialization is complete. Refer to Common SoftAP Workflows for details.

Wi-Fi Scan

This section introduces several common scan configurations. For advanced configurations, please refer to wifi_scan_networks().

Wi-Fi scanning modes include synchronous scanning and asynchronous scanning, with the complete workflow as follows:

Configuration:

Features:

  • Thread-safe: Only blocks the calling thread, allowing other threads to continue running

  • Recommended for: Most basic use cases

../../_images/wifi_basic_scan_sync.svg

Synchronous scan flow

STA Mode

STA Connection Flow

This section introduces several common STA connection flows. For advanced configurations, refer to wifi_connect().

Configuration:

Features:

  • Thread-safe: Only blocks the calling thread, allowing other threads to continue running

  • Recommended for: Most basic use cases

../../_images/wifi_basic_connect_sync.svg

Synchronous Connection Flow

Note

Setting rtw_network_info::channel (e.g., obtained through a separate scan) can significantly reduce connection latency if the AP channel is known.

STA Auto-reconnect on Disconnection

TBD

STA Auto-reconnect on Power-up

TBD

STA Power-saving Mode

TBD

SoftAP Mode

Common SoftAP Workflows

This section introduces common workflows for SoftAP. For advanced configurations, please refer to the SoftAP-related API documentation.

The common SoftAP workflow is shown in the following figure:

../../_images/wifi_basic_softap_workflow.svg

SoftAP MAC Address Configuration

The SoftAP MAC address is derived from the chip’s base MAC address and can be configured in the file component/soc/usrcfg/amebaxxx/ameba_wificfg.c.

Assuming the chip’s base MAC address is 00:e0:4c:01:02:03, the SoftAP MAC address can be configured as follows:

SoftAP MAC address: 00:e1:4c:01:02:03

wifi_user_config.concurrent_enabled = 1;
wifi_user_config.softap_addr_offset_idx = 1;

MAC Address Conflict Restriction

When the SoftAP MAC address matches the chip’s MAC address (Example 3), STA and SoftAP cannot operate simultaneously:

  • STA cannot connect to any AP after SoftAP is activated.

  • SoftAP cannot start if STA is already connected.

Channel Switch Announcement (CSA) for SoftAP

TBD

STA and SoftAP Coexistence

TBD

Promiscuous Mode

TBD

Country Code Configuration

TBD

Transmit Power Configuration

TBD