![]() |
Back to main page |
---|
1. General description
1.1. Introduction
X-CUBE-ST67W61 is a set of software components implementing host applications driving a Wi-Fi® and Bluetooth® LE coprocessor (ST67W611M1). The coprocessor is controlled through an AT command over an SPI interface.
Two system architectures are proposed:
- The legacy LWIP off-load architecture (also known as Architecture T01), where LWIP is embedded in the module ST67W611M1. This is implemented in the ST67W611M1 within the st67w611m_mission_t01_v2.x.y.bin binary.
- The LWIP on-host architecture (also known as Architecture T02) where LWIP is embedded in the host STM32. This is implemented in the ST67W611M1 within the st67w611m_mission_t02_v2.x.y.bin binary.
The figure below depicts both system architecture overviews:
1.2. ST67W611M1 features
The ST67W611M1 features the following:
- 2.4 GHz RF transceiver
- Integrated RF balun, PA/LNA
- External PA/LNA support
- Wi-Fi® 6 (IEEE 802.11 b/g/n/ax)
- Wi-Fi®/Bluetooth® coexistence
- Wi-Fi® security WPS/WEP/WPA/WPA2/WPA3
- Wi-Fi® 20/40 MHz bandwidth, 1T1R, up to 229.4 Mbps
- IEEE 802.11e QoS WMM (Wi-Fi® multi-media)
- IEEE 802.11w PMF (Protected Management Frames)
- STA, SoftAP, STA + SoftAP
- LDPC, STBC, beamformee, DL/UL OFDMA, MU-MIMO, Target Wake Time (TWT), Spatial Reuse
- (SR), Dual Carrier Modulation (DCM), Extended Range (ER)
- A-MPDU, A-MSDU, immediate block ACK, fragmentation, and defragmentation
- Rx diversity
- Bluetooth® 5.3 (BLE)
1.3. Overview
1.3.1. SW top view
The X-CUBE-ST67W61 is composed of a set of applications, ST67W6X_Network_Driver middleware, and ST67W61 drivers. In particular, it:
- Exposes the generic API to applications offering:
- System and OTA services
- Bluetooth® LE services
- Wi‑Fi® API services
- Net module is aligned on BSD socket (blocking socket). Note that it is disabled when LWIP is on-host.
- MQTT and HTTP services. Note that it is disabled when LWIP is on-host.
- Encompasses ST67W61 AT driver which:
- Exposes basic AT command API
- Parses AT responses and AT event with modem_cmd_handler.
- Requires SPI sync module:
- For sending and receiving messages to/from SPI link
- Does not have a callback mechanism to be informed that some data are ready to be read; the dedicated Rx thread at higher level handles the received data and messages
- When LWIP is on the host the netif module is enabled, in particular it:
- notifies station link status(up or down)
- sends network data to spi_iface
- receives network data from spi_iface
Eight applications are delivered as part of the X-CUBE-ST67W61:
- ST67W6X_Echo
- ST67W6X_CLI and ST67W6X_CLI_LWIP
- ST67W6X BLE Commissioning
- ST67W6X BLE p2pClient and ST67W6X BLE p2pServer
- ST67W6X HTTP Server
- ST67W6X HTTPS Client
- ST67W6X FOTA
- ST67W6X Wi-Fi Commissioning Application
Additionally, one demonstration is provided:
1.3.2. FreeRTOS implementation view
1.3.2.1. FreeRTOS LWIP offload implementation view
This legacy LWIP off-load architecture, where LWIP is embedded in the module.
Spi_iface runs within a FreeRTOS thread which wakes up any time a DMA from SPI Rx or SPI Tx is triggered. The Spi_iface embeds two buffer queues which contain data to be sent to the ST67W611M1 NCP and data to be received from the ST67W611M1 NCP. The Spi_iface module implements the frame protocol between the host and the ST67W611M1 NCP. This frame protocol features a synchronization word, sequence number, length, the buffer.
The scope of the AT driver is to format the AT messages on the Tx path (host to ST67W611M1 coprocessor) and parse the AT response and events on the Rx path (ST67W611M1 coprocessor to host). Its sits on top of the Spi_iface.
The AT driver is constituted of two units:
- The W61 AT commands which abstract any AT command: Execute, Set or Query.
- AT Execute sends the AT command and waits a command response (OK or ERROR)
- AT Set sends the AT command with the parameters and waits for a command response (OK or ERROR)
- AT Query sends an AT command, waits for queried responses and waits a command response (OK or ERROR)
- Unsolicited events which may be propagated to the upper layer.
- The modem command handler is designed to parse and process AT commands and responses from a modem interface in an embedded system. It manages communication between the system and a modem by parsing, matching, and processing different types of AT commands and responses. It runs in it own FreeRTOS thread. The key functionalities are:
- Command Sending: Provides functions to send commands to the modem, optionally waiting for responses and handling timeouts.
- Command Parsing: It reads data from a modem interface, identifies complete command lines (terminated by CR/LF), and matches them against a set of known command definitions.
- Command Matching: It supports both direct command matching (for commands that must be handled immediately) and regular matching to be parsed (for standard responses and unsolicited messages).
- Parameter Extraction: When a command is matched, it parses its parameters, handling quoted strings and delimiters, and passes them to the appropriate handler function.
- Command Execution: Calls the handler function associated with each command, passing parsed parameters.
- Synchronization: Uses FreeRTOS semaphores to protect shared resources and synchronize command processing and transmission.
- Error Handling: Tracks and reports errors encountered during command processing.
Services APIs are the application APIs provided to the customers to build their application. The services APIs feature:
- System services manage the central system functions of the network control processor (NCP). Key functionalities include:
- Power management: Controls power modes, sleep states, and energy-saving features
- System information: Provides access to system status, diagnostics, and hardware information
- ST67W611M1 FW updates for OTA manage firmware updates and system upgrades.
- Bluetooth® LE services manage Bluetooth® connections and data exchange. Key functionalities include:
- Connection management: Establishes and maintains Bluetooth® LE connections with other devices
- Data transmission: Sends data packets over Bluetooth® LE connections
- Notifications: Receives and processes Bluetooth® LE notifications from connected devices
- Security: Establishes secure Bluetooth® LE connections
- Wi-Fi® services handle Wi-Fi® network control and management. Key functionalities include:
- Network scanning: Searches for available Wi-Fi® networks
- Connection management: Connects to and disconnects from Wi-Fi® networks
- Signal strength monitoring: Monitors and reports the strength of Wi-Fi® signals
- Net services (disabled when LWIP is on-host) manage the TCP/IP stack and routes data across the network. Key functionalities include:
- TCP/IP stack management: Handles the core TCP/IP protocols for data communication
- Data routing: Routes TCP/IP data packets to and from the network
- Network configuration: Manages IP addresses, subnets, and other network settings
- MQTT (message queuing telemetry transport) services (disabled when LWIP is on-host) :
- Publish/subscribe: Manages MQTT topics and message exchanges
- Broker communication: Connects to and communicates with MQTT brokers
- HTTP (HyperText transfer protocol) services (disabled when LWIP is on-host):
- Request handling: Manages HTTP HEAD, GET, POST, and PUT requests
- Response processing: Processes and interprets HTTP responses from servers
1.3.2.2. FreeRTOS LWIP on-host implementation view
This is the LWIP on-host architecture where LWIP is embedded in the host STM32.
- Spi_iface keeps the AT interface as above. The NET_IF interface binds to a new 'receive queue' for the LWIP STAtion network interface. The 'send queue' is used for both AT command and network data output.
- AT driver is the same as above.
- Services APIs are adjusted as follow:
- System services is the same as above.
- ST67W611M1 FW updates for OTA is the same as above.
- Bluetooth® LE services is the same as above.
- Wi-Fi® services is the same as above.
- Net services is disabled. LWIP manages all TCP/IP services and other network services
- MQTT services is disabled. MQTT has to be implemented on top of LWIP.
- HTTP is disabled. HTTP has to be implemented on top of LWIP.
- NET_IF is enabled, in particular it:
- notifies station link status(up or down)
- sends network data to spi_iface
- receives network data from spi_iface dedicated queue
Further details and technical specifications are provided in section Services API of the documentation.
1.3.3. General requirement
- All applications are based on the embedded system RTOS FreeRTOS.
- Each protocol module API has a CLI command (See CLI/Shell).
- Each module uses the logging mechanism from FreeRTOS (see Logging).
- The application is easily portable across different STM32s.
- No secure channel (for example, safelink) is implemented.
1.4. Framework
1.4.1. FreeRTOS
The projects and the middleware are based on the FreeRTOS.
For ThreadX porting, ThreadX to FreeRtos port is available. You can refer to threadx/utility/rtos_compatibility_layers/FreeRTOS
Please Note that stack Size in ThreadX is defined in Bytes while the stack size in FreeRtos is in words.
1.4.2. CLI from shell
The shell features:
- Autocompletion
- Command history (down/up key)
- Right/left key
- Backspace functionality
- Help and command-specific help
- Decentralized command implementation
- Colorized CLI
1.4.3. Logging
The logging component provides 4 logging macros listed in increasing order of verbosity:
- LogError()
- LogWarn()
- LogInfo()
- LogDebug()
The logging component features:
- Differed logging: Message is built within the calling function and sent to a log queue. The log queue is consumed by an output task. This limits the real-time impact of logging.
- Standard log levels: See FreeRtos website [1]
- Add metadata to the log message such as timestamp, filename and line number, task name. Metadata inclusion is configurable.
- Memory consumption scales with needs (dynamic allocation of log buffer). Maximum size is configurable.
- Thread safe
- Output hardware choice is left to the application writer.
For example, LogError() is only called when there is an error, so it is the least verbose, whereas LogDebug() is called more frequently to provide debug level information.
The application can output the logs on:
- UART hardware (same or other UART than CLI)
- ITM (dedicated ARM debug port on SWO)
1.4.4. FreeRTOS low power application
- The low power host supports FreeRTOS™ tickless idle mode to allow the STM32 to enter low power mode anytime FreeRTOS is idle. LPTIM1 is used as a low power timer while the system is in low power mode to maintain the time. Minimum low power mode is configurable in app_conf.h
- The ST67W611M1 power save depends on the connection of the ST67W611M1:
- When unconnected, the power save mode is activated by setting
W6X_SetPowerMode
to 1. This sets the ST67W611M1 in standby low power mode after each command sent to the ST67W611M1 . - If the ST67W611M1 device is connected to an access point, the device enters in DTIM standby power-save mode by default (if
W6X_SetPowerMode
is set to 1). - If the ST67W611M1 device is connected to a Wi-Fi®-6 access point, the individual TWT power save can be entered.
W6X_SetPowerMode
must be set to 1 before configuring and starting TWTTWT W6X_WiFi_SetupTWT
.
- When unconnected, the power save mode is activated by setting
1.4.5. FOTA support
There are two types of FOTA available:
- The FOTA application that updates the NUCLEO-U575ZI-Q and the ST67W611M1 using a FOTA header descriptor in JSON format
- The FOTA application that only updates the ST67W611M1, that does not use a FOTA header descriptor
When the FOTA option is enabled, a low-priority task is initiated and waits for an event to start the FOTA update process (timer, button push, or CLI command for example). Then it fetches all the necessary resources to proceed with the update.
For the NUCLEO-U575ZI-Q FOTA variant, the header descriptor contains information such as the versions of the binaries and values for a binary integrity check. The NUCLEO-U575ZI-Q binary is stored in flash and if the integrity verification passes, it boots on the binary stored in flash on next reboot.
For the ST67W611M1 update, during download of the binary, the data is transferred to the ST67W611M1. When the transfer is done, the ST67W611M1 performs the necessary check and reboots on the new binary.
Pythons scripts are provided to help with FOTA header descriptor generation and run server hosting files needed by the FOTA in a local environment.
2. ST67W6X_Network_Driver Configuration
The ST67W6X_Network_Driver is configured with default values. Each default values can be overridden in w6x_config.h
and w61_driver_config.h
.
See below exhaustive list of configuration that can be overridden:
2.1. System
w6x_config_template.h
- W6X_POWER_SAVE_AUTO: Enables automatic low power mode when ST67W611M1 is idle.
- W6X_CLOCK_MODE: Selects NCP clock source.
- W6X_ASSERT_ENABLE: Enables/disables NULL pointer checks in API functions.
w61_driver_config_template.h
- W61_ASSERT_ENABLE: Enables/disables NULL pointer checks in AT functions.
- SYS_LOG_ENABLE: Enables/disables system module logging.
2.2. Wi-Fi
w6x_config_template.h
- W6X_WIFI_AUTOCONNECT: Enables/disables automatic Wi-Fi connection.
- W6X_WIFI_SAP_MAX_CONNECTED_STATIONS: Max stations for Soft-AP.
- W6X_WIFI_COUNTRY_CODE: Wi-Fi region code.
- W6X_WIFI_ADAPTIVE_COUNTRY_CODE: Match AP country code or use static code.
w61_driver_config_template.h
- W61_WIFI_MAX_DETECTED_AP: Max Wi-Fi APs detected during scan.
- WIFI_LOG_ENABLE: Enables/disables Wi-Fi module logging.
- W61_WIFI_TIMEOUT: Timeout for remote Wi-Fi device operations.
2.3. BLE
w6x_config_template.h
- W6X_BLE_HOSTNAME: BLE device hostname.
w61_driver_config_template.h
- W61_BLE_MAX_DETECTED_PERIPHERAL: Max BLE peripherals detected during scan.
- BLE_LOG_ENABLE: Enables/disables BLE module logging.
- W61_BLE_TIMEOUT: Timeout for remote BLE device operations.
2.4. Net
w6x_config_template.h
- W6X_NET_DHCP: DHCP configuration.
- W6X_NET_SAP_IP_SUBNET: Soft-AP subnet definition.
- W6X_NET_HOSTNAME: Wi-Fi hostname.
- W6X_NET_RECV_TIMEOUT: Socket receive timeout.
- W6X_NET_SEND_TIMEOUT: Socket send timeout.
- W6X_NET_RECV_BUFFER_SIZE: Net socket receive buffer size.
w61_driver_config_template.h
- NET_LOG_ENABLE: Enables/disables network module logging.
- W61_NET_TIMEOUT: Timeout for remote network operations.
2.5. HTTP
w6x_config_template.h
- W6X_HTTP_CLIENT_THREAD_STACK_SIZE: HTTP client thread stack size.
- W6X_HTTP_CLIENT_THREAD_PRIO: HTTP client thread priority.
- W6X_HTTP_CLIENT_DATA_RECV_SIZE: HTTP client data receive buffer size.
- W6X_HTTP_CLIENT_TCP_SOCK_RECV_TIMEOUT: TCP socket receive timeout for HTTP client.
- W6X_HTTP_CLIENT_TCP_SOCKET_SIZE: TCP socket size for HTTP client.
2.6. MQTT
w61_driver_config_template.h
- MQTT_LOG_ENABLE: Enables/disables MQTT module logging.
2.7. AT Common
w61_driver_config_template.h
- W61_MAX_SPI_XFER: Maximum SPI buffer size is a key parameter(between 1520 and 6000 bytes). W61_MAX_SPI_XFER can be used to tune the maximum bytes that can be sent in one AT command.
- In case of LWIP on-host, the value must be set to 1520 bytes ( just greater than MTU size). Setting this to a greater value would be a waste of dynamic memory.
- In case of LWIP off load, the W61_MAX_SPI_XFER is a almost proportional to performance: The greated the value, the better the performance. However, it has been observed (at worst case) that dynamic allocation will be 5 times the W61_MAX_SPI_XFER value (1 Application buffer + 1 AT buffer + 1 Tx buffer + 2 Rx buffer).
- SPI_THREAD_STACK_SIZE: Stack size for SPI thread.
- SPI_THREAD_PRIO: Priority for SPI thread.
- W61_MAX_AT_LOG_LENGTH: Maximum size of AT log.
- W61_AT_LOG_ENABLE: Enables/disables AT command logging.
- W61_NCP_TIMEOUT: Timeout for NCP reply/execute.
- W61_SYS_TIMEOUT: Timeout for special cases (flash write, OTA, etc).
- W61_MDM_RX_TASK_STACK_SIZE_BYTES: Stack size for modem RX task.
- W61_MDM_RX_TASK_PRIO: Priority for modem RX task.
2.8. Utility Performance
w6x_config_template.h
- NET_RECVFROM, NET_RECV, NET_SENDTO, NET_SEND, etc.: Maps generic network operations to W6X API functions.
- IPERF_ENABLE: Iperf feature and options.
- IPERF_TRAFFIC_TASK_PRIORITY, IPERF_TRAFFIC_TASK_STACK, IPERF_REPORT_TASK_STACK: Iperf task settings.
- IPERF_MALLOC, IPERF_FREE: Memory allocation functions for Iperf.
- MEM_PERF_ENABLE: Enables memory performance measurement.
- LEAKAGE_ARRAY: Number of memory allocations tracked.
- ALLOC_BREAK: Max iterations for allocator.
- TASK_PERF_ENABLE: Enables task performance measurement.
- PERF_MAXTHREAD: Max threads monitored.
2.9. WFA Traffic Generator
w6x_config_template.h
- WFA_TG_ENABLE: Enables Wi-Fi Alliance Traffic Generator.
2.10. External Service
w6x_config_template.h
- LFS_ENABLE: Enables LittleFS file system.
3. Services API
3.1. System services
3.1.1. System API functions
The system module proposes an API set of functions needed to control the chip. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_Init | Initialize the LL part of the W6X core. |
W6X_DeInit | De-Initialize the LL part of the W6X core. |
W6X_RegisterAppCb | Register Upper Layer callbacks. |
W6X_GetCbHandler | Get the W6X Callback handler. |
W6X_GetModuleInfo | Get the W6X module info. |
W6X_ModuleInfoDisplay | Display the module information. |
W6X_SetPowerMode | Configure Power mode. |
W6X_GetPowerMode | Get Power mode. |
W6X_FS_WriteFileByName | Write a file from the Host file system to the NCP file system. |
W6X_FS_WriteFileByContent | Write a file from the local memory to the NCP file system. |
W6X_FS_ReadFile | Read a file from the NCP file system. |
W6X_FS_DeleteFile | Delete a file from the NCP file system. |
W6X_FS_GetSizeFile | Get the size of a file in the NCP file system. |
W6X_FS_ListFiles | List files in the file system (NCP and Host if LFS is enabled) |
W6X_Reset | Reset module. |
W6X_ExeATCommand | Execute AT command. |
W6X_StatusToStr | Convert the W6X status to a string. |
W6X_ModelToStr | Convert the W6X module ID to a string. |
3.2. Firmware Update services
The Firmware Update module manages ST67W611M1 firmware updates from the Host. Host can get the FW via the TCP/IP sockets, Bluetooth® LE, or any other means.
3.2.1. ST67W611M1 FW update APIs functions
The firmware update module proposes an API set of functions needed to update the ST67W611M1. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_OTA_Starts | Starts the ST67W611M1 OTA process. |
W6X_OTA_Finish | Finish the ST67W611M1 OTA process which reboot the module to apply the new firmware if verification succeeds. |
W6X_OTA_Send | Send the firmware binary to the ST67W611M1. |
3.3. Wi-Fi® services
3.3.1. Wi-Fi® APIs functions
The Wi-Fi® module proposes an API set of functions needed to control the chip. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_WiFi_Init | Init the Wi-Fi® module. |
W6X_WiFi_DeInit | De-Init the WiFi module. |
W6X_WiFi_Scan | List a defined number of available access points. |
W6X_WiFi_PrintScan | Print the scan results. |
W6X_WiFi_Connect | Join an Access Point. |
W6X_WiFi_Disconnect | Disconnect from a Wi-Fi® Network. |
W6X_WiFi_GetAutoConnect | Retrieve auto connect state. |
W6X_WiFi_GetCountryCode | This function retrieves the country code configuration. |
W6X_WiFi_SetCountryCode | This function set the country code configuration. |
W6X_WiFi_Station_Start | Set the module in station mode. |
W6X_WiFi_Station_GetState | This function retrieves the Wi-Fi® station state. |
W6X_WiFi_Station_GetMACAddress | This function retrieves the Wi-Fi® station MAC address. |
W6X_WiFi_AP_Start | Configure a Soft-AP. |
W6X_WiFi_AP_Stop | Stop the Soft-AP. |
W6X_WiFi_AP_GetConfig | Get the Soft-AP configuration. |
W6X_WiFi_AP_ListConnectedStations | List the connected stations. |
W6X_WiFi_AP_DisconnectStation | Disconnect station from the Soft-AP. |
W6X_WiFi_AP_GetMACAddress | This function retrieves the Wi-Fi® Soft-AP MAC address. |
W6X_WiFi_SetDTIM | Set Low Power Wi-Fi® DTIM (Delivery Traffic Indication Message) |
W6X_WiFi_GetDTIM | Get Low Power Wi-Fi® DTIM (Delivery Traffic Indication Message) |
W6X_WiFi_GetDTIM_AP | Get Low Power Wi-Fi® DTIM (Delivery Traffic Indication Message) for the Access Point. |
W6X_WiFi_TWT_Setup | Setup Target Wake Time (TWT) for the Wi-Fi® station. |
W6X_WiFi_TWT_GetStatus | Get Target Wake Time (TWT) status for the Wi-Fi® station. |
W6X_WiFi_TWT_Teardown | Teardown Target Wake Time (TWT) for the Wi-Fi® station. |
W6X_WiFi_GetAntennaDiversity | Get the antenna diversity information. |
W6X_WiFi_SetAntennaDiversity | Set the antenna diversity configuration. |
W6X_WiFi_StateToStr | Convert the Wi-Fi® state to a string. |
W6X_WiFi_SecurityToStr | Convert the Wi-Fi® security type to a string. |
W6X_WiFi_ReasonToStr | Convert the Wi-Fi® error reason to a string. |
W6X_WiFi_ProtocolToStr | Convert the Wi-Fi® protocol to a string. |
W6X_WiFi_AntDivToStr | Convert the Wi-Fi® antenna mode to a string. |
3.3.2. Wi-Fi® events
The following events are sent back to the application layer:
Event | Description |
---|---|
STA events | |
W6X_WIFI_EVT_CONNECTED_ID | Event received when the station is connected to an access point. |
W6X_WIFI_EVT_DISCONNECTED_ID | Event received when the station is disconnected to an access point. |
W6X_WIFI_EVT_GOT_IP_ID | Event received when the station receives an IP address after a successful connection to an access point. |
W6X_WIFI_EVT_CONNECTING_ID | Event received when the station is in the connection process to an access point. |
W6X_WIFI_EVT_REASON_ID | Event received when the device encouters an issue in the connection process or at disconnection. |
soft-AP events | |
W6X_WIFI_EVT_STA_CONNECTED_ID | Event received when a station is connected to the soft-AP. |
W6X_WIFI_EVT_STA_DISCONNECTED_ID | Event received when a station is disconnected from the soft-AP. |
W6X_WIFI_EVT_DIST_STA_IP_ID | Event received when a station, connected to the soft-AP, receives an IP address. |
3.3.3. Wi-Fi® FSM
Shown below is the Wi-Fi® FSM for the station mode only that describes the different states of the system.
The second chart below shows the behavior of the system when the station and the soft access point modes are enabled (station mode is active by default and cannot be deactivated).
When both interfaces are enabled, some verifications must be done by the user to ensure STA and soft-AP do not use the same subnet IP address to avoid unexpected behaviors. The channel they are operating on is automatically aligned between the STA and the soft-AP.
When the soft-AP is stopped, all connected stations are disconnected from the soft-AP.
3.4. Net services
The net module implements all the API functions related to the internet protocol. It supports the BSD socket API and some specific services that are commonly used, like ping or SNTP services.
Up to five sockets can be managed in parallel.
3.4.1. NET APIs functions
The NET module proposes an API set of functions needed to control TCP/IP stack features. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_Net_Init | Init the Net module. |
W6X_Net_DeInit | De-Init the Net module. |
W6X_Net_SetHostname | Set the Wi-Fi® Station host name. |
W6X_Net_GetHostname | Get the Wi-Fi® Station host name. |
W6X_Net_Station_GetIPAddress | Get the Wi-Fi® Station interface's IP address. |
W6X_Net_Station_SetIPAddress | Set the Wi-Fi® Station interface's IP address. |
W6X_Net_AP_GetIPAddress | Get the Soft-AP IP addresses. |
W6X_Net_AP_SetIPAddress | Set the Soft-AP IP addresses. |
W6X_Net_GetDhcp | Get the DHCP configuration. |
W6X_Net_SetDhcp | Set the DHCP configuration. |
W6X_Net_GetDnsAddress | Get the Wi-Fi® DNS addresses. |
W6X_Net_SetDnsAddress | Set the Wi-Fi® DNS addresses. |
W6X_Net_Ping | Ping an IP address in the network. |
W6X_Net_ResolveHostAddress | Get IP address from URL using DNS. |
W6X_Net_SNTP_GetConfiguration | Get current SNTP status, timezone and servers. |
W6X_Net_SNTP_SetConfiguration | Set SNTP status, timezone and servers. |
W6X_Net_SNTP_GetInterval | Get SNTP Synchronization interval. |
W6X_Net_SNTP_SetInterval | Set SNTP Synchronization interval. |
W6X_Net_SNTP_GetTime | Query date string from SNTP, the used format is asctime style time. |
W6X_Net_GetConnectionStatus | Get information for an opened socket. |
W6X_Net_Socket | Get a socket instance is available. |
W6X_Net_Close | Close a socket instance and release the associated resources. |
W6X_Net_Shutdown | Shutdown a socket instance. |
W6X_Net_Bind | Bind a socket instance to a specific address. |
W6X_Net_Connect | Connect a socket instance to a specific address. |
W6X_Net_Listen | Listen for incoming connections on a socket. |
W6X_Net_Accept | Accept an incoming connection on a socket. |
W6X_Net_Send | Send data on a socket. |
W6X_Net_Recv | Receive data from a socket. |
W6X_Net_Sendto | Send data on a socket to a specific address. |
W6X_Net_Recvfrom | Receive data from a socket from a specific address. |
W6X_Net_Getsockopt | Get a socket option. |
W6X_Net_Setsockopt | Set a socket option. |
W6X_Net_TLS_Credential_AddByContent | Add the credential by local file content to the TLS context. |
W6X_Net_TLS_Credential_AddByName | Add the credential by name from Host LFS to the TLS context. |
W6X_Net_TLS_Credential_Delete | Delete the credential from the TLS context. |
W6X_Net_Inet_ntop | Convert an IP address from uint32_t format to text. |
W6X_Net_Inet_pton | Convert an IP address from text format to uint32_t. |
3.4.2. NET events
The following net events are sent back to the application layer:
Event | Description |
---|---|
W6X_NET_EVT_SOCK_DATA_ID | Event sent when data is received on a socket |
3.4.3. NET FSM
The following figure shows the FSM for both TCP client and server socket.
There are six possible states:
- RESET: Default state
- ALLOCATED: An available socket has been reserved.
- CONNECTED: Connection is established; socket is ready to exchange data. It can be either a client or a server (for incoming connections).
- BIND: Socket is set to server mode and port and protocol are set, but the server is not running yet.
- LISTENING: Server is running, ready to accept incoming connections.
- CLOSING: Temporary state, when close or shutdown operations are being performed, after that, state is set to RESET again.
Since UDP is a connectionless protocol, UDP sockets use a slightly different state machine. State 'CONNECTED' is used here after the first call to 'sendto()' to signal that incoming data can be expected since communication with a server has been initiated:
3.5. Bluetooth® LE services
3.5.1. Bluetooth® LE APIs functions
The Bluetooth® LE module proposes an API set of functions needed to control the chip. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_Ble_GetInitMode | Get BLE initialization mode. |
W6X_Ble_Init | Initialize BLE Server/Client. |
W6X_Ble_DeInit | De-Initialize BLE Server/Client. |
W6X_Ble_SetRecvDataPtr | Set/change the pointer where to copy the Recv Data. |
W6X_Ble_SetTxPower | BLE Set TX Power. |
W6X_Ble_GetTxPower | BLE Get TX Power. |
W6X_Ble_AdvStart | BLE Server Start Advertising. |
W6X_Ble_AdvStop | BLE Server Stop Advertising. |
W6X_Ble_GetBDAddress | Retrieves the BLE BD address. |
W6X_Ble_Disconnect | Disconnect from a BLE remote device. |
W6X_Ble_ExchangeMTU | Exchange BLE MTU length. |
W6X_Ble_SetBdAddress | Set BLE BD Address. |
W6X_Ble_SetDeviceName | Set BLE device Name. |
W6X_Ble_GetDeviceName | This function retrieves the BLE device name. |
W6X_Ble_SetAdvData | Set BLE Advertising Data. |
W6X_Ble_SetScanRespData | Set BLE scan response Data. |
W6X_Ble_SetAdvParam | Set BLE Advertising Parameters. |
W6X_Ble_StartScan | Start BLE Device scan. |
W6X_Ble_StopScan | Stop BLE Device scan. |
W6X_Ble_SetScanParam | Set the BLE scan parameters. |
W6X_Ble_GetScanParam | Get the Scan parameters. |
W6X_Ble_Print_Scan | Print the scan results. |
W6X_Ble_GetAdvParam | Get BLE Advertising Parameters. |
W6X_Ble_SetConnParam | Set BLE Connection Parameters. |
W6X_Ble_GetConnParam | Get the connection parameters. |
W6X_Ble_GetConn | Get the connection information. |
W6X_Ble_Connect | Create connection to a remote device. |
W6X_Ble_SetDataLength | Set the BLE Data length. |
W6X_Ble_CreateService | Create BLE Service. |
W6X_Ble_DeleteService | Delete BLE Service. |
W6X_Ble_CreateCharacteristic | Create BLE Characteristic. |
W6X_Ble_GetServicesAndCharacteristics | List BLE Services and their Characteristics. |
W6X_Ble_RegisterCharacteristics | Register BLE characteristics. |
W6X_Ble_RemoteServiceDiscovery | Discover BLE services of remote device. |
W6X_Ble_RemoteCharDiscovery | Discover BLE Characteristics of a service remote device. |
W6X_Ble_ServerSendNotification | Notify the Characteristic Value from the Server to a Client. |
W6X_Ble_ServerSendIndication | Indicate the Characteristic Value from the Server to a Client. |
W6X_Ble_ServerSetReadData | Set the data when Client read characteristic from the Server. |
W6X_Ble_ClientWriteData | Write data to a Server characteristic. |
W6X_Ble_ClientReadData | Read data from a Server characteristic. |
W6X_Ble_ClientSubscribeChar | Subscribe to notifications or indications from a Server characteristic. |
W6X_Ble_ClientUnsubscribeChar | Unsubscribe to notifications or indications from a Server characteristic. |
W6X_Ble_SetSecurityParam | Set BLE security parameters. |
W6X_Ble_GetSecurityParam | Get BLE security parameters. |
W6X_Ble_SecurityStart | Start BLE security. |
W6X_Ble_SecurityPassKeyConfirm | BLE security pass key confirm. |
W6X_Ble_SecurityPairingConfirm | BLE pairing confirm. |
W6X_Ble_SecuritySetPassKey | BLE set passkey. |
W6X_Ble_SecurityPairingCancel | BLE pairing cancel. |
W6X_Ble_SecurityUnpair | BLE unpair. |
W6X_Ble_SecurityGetBondedDeviceList | BLE get paired device list. |
3.5.2. Bluetooth® LE events
The following Bluetooth® LE events are sent back to the application layer:
Event | Description |
---|---|
W6X_BLE_EVT_CONNECTED_ID | Bluetooth® LE connection established. |
W6X_BLE_EVT_DISCONNECTED_ID | Bluetooth® LE connection ends. |
W6X_BLE_EVT_CONNECTION_PARAM_ID | Bluetooth® LE connection parameters update. |
W6X_BLE_EVT_READ_ID | Read operation from Bluetooth® LE remote device. |
W6X_BLE_EVT_WRITE_ID | Write operation from Bluetooth® LE remote device. |
W6X_BLE_EVT_SERVICE_FOUND_ID | Bluetooth® LE service discovered on remote device. |
W6X_BLE_EVT_CHAR_FOUND_ID | Bluetooth® LE characteristic discovered on remote device. |
W6X_BLE_EVT_INDICATION_STATUS_ENABLED_ID | Bluetooth® LE indication enabled. |
W6X_BLE_EVT_INDICATION_STATUS_DISABLED_ID | Bluetooth® LE indication disabled. |
W6X_BLE_EVT_NOTIFICATION_STATUS_ENABLED_ID | Bluetooth® LE notification enabled. |
W6X_BLE_EVT_NOTIFICATION_STATUS_DISABLED_ID | Bluetooth® LE notification disabled. |
W6X_BLE_EVT_INDICATION_ACK_ID | Bluetooth® LE Indication acknowledged. |
W6X_BLE_EVT_INDICATION_NACK_ID | Bluetooth® LE Indication unacknowledged. |
W6X_BLE_EVT_NOTIFICATION_DATA_ID | Bluetooth® LE service receives notification/indication data. |
W6X_BLE_EVT_MTU_SIZE_ID | Bluetooth® LE MTU size update. |
W6X_BLE_EVT_PAIRING_FAILED_ID | Bluetooth® LE pairing failed. |
W6X_BLE_EVT_PAIRING_COMPLETED_ID | Bluetooth® LE pairing completed. |
W6X_BLE_EVT_PAIRING_CONFIRM_ID | Bluetooth® LE pairing confirm notification. |
W6X_BLE_EVT_PASSKEY_ENTRY_ID | Bluetooth® LE pairing passkey entry notification. |
W6X_BLE_EVT_PASSKEY_DISPLAY_ID | Bluetooth® LE pairing passkey display notification. |
W6X_BLE_EVT_PASSKEY_CONFIRM_ID | Bluetooth® LE pairing passkey confirm notification. |
3.6. HTTP Services
The HTTP module offers HTTP requests and processes and interprets HTTP responses from servers.
It supports both HTTP and HTTPS with HEAD, GET, PUT and POST methods.
For POST and PUT requests, the following content types can be used:
- Text/plain : Regular text without any formatting
- Application/x-www-form-urlencoded : Data is given as key value pairs (key1=value1&key2=value2...)
- Application/json : JSON format
- Application/xml : XML format
- Application/octet-stream : Binary data
3.6.1. HTTP APIs function
The HTTP module proposes an API function to create HTTP client requests.
Function | Description |
---|---|
W6X_HTTP_Client_Request | HTTP Client request based on BSD socket. |
3.7. MQTT services
3.7.1. MQTT APIs functions
The MQTT module proposes an API set of functions needed to control the chip. Below is a list of the available main functions:
Function | Description |
---|---|
W6X_MQTT_Init | Init the MQTT module. |
W6X_MQTT_DeInit | De-Init the MQTT module. |
W6X_MQTT_SetRecvDataPtr | Set/change the pointer where to copy the Recv Data. |
W6X_MQTT_Configure | MQTT Set user configuration. |
W6X_MQTT_Connect | MQTT Connect to broker. |
W6X_MQTT_GetConnectionStatus | MQTT Get connection status. |
W6X_MQTT_Disconnect | MQTT Disconnect from broker. |
W6X_MQTT_Subscribe | MQTT Subscribe to a topic. |
W6X_MQTT_GetSubscribedTopics | MQTT Get subscribed topics. |
W6X_MQTT_Unsubscribe | MQTT Unsubscribe from a topic. |
W6X_MQTT_Publish | MQTT Publish a message to a topic. |
W6X_MQTT_StateToStr | Convert the MQTT state to a string. |
3.7.2. MQTT events
The following MQTT events are sent back to the application layer:
Event | Description |
---|---|
W6X_MQTT_EVT_CONNECTED_ID | Event received when the MQTT client is connected to the broker. |
W6X_MQTT_EVT_DISCONNECTED_ID | Event received when the MQTT client is disconnected from the broker. |
W6X_MQTT_EVT_SUBSCRIPTION_RECEIVED_ID | Event received when the MQTT client receives data from a topic it subscribed to. |
3.8. Netif services
3.8.1. Netif APIs functions
The netif module implements all the API functions related to the direct network link between LwIP on-host and Wi-Fi® stack in ST67W611M1. There is a link for the station mode only (soft-AP not available yet). These services are only available with the ST67 T02 Architecture.
Below is a list of the available main functions:
Function | Description |
---|---|
W6X_Netif_Init | Initialize the Network Interface. |
W6X_Netif_DeInit | De-Initialize the Network Interface. |
W6X_Netif_output | Send data on the Network Interface. |
W6X_Netif_input | Read data from the Network Interface. |
W6X_Netif_free | Free internal buffer containing the data. |
4. References