| Back to main page |
|---|
1. CLI Presentation
These applications aim to evaluate and test the ST67W611M1 Wi-Fi® solution via a command line interface (CLI).
Two CLIs are available in the project directory:
| Project name | Description |
|---|---|
| ST67W6X_CLI | It exercises the capabilities of the network co-processor (ST67W611M1), which embeds the LwIP, Wi-Fi® stack, and Bluetooth® Low Energy stack. |
| ST67W6X_CLI_LWIP | It exercises the capabilities of the network co-processor (ST67W611M1), which embeds the Wi-Fi® stack and Bluetooth® Low Energy stack. LwIP is offloaded and present in the host code. |
Both projects rely on the FreeRTOS real-time operating system to manage the ST67W611M1 expansion board.
The application supports basic Wi-Fi® operations, such as scanning available local access points (APs) and connecting to an AP. It also enables testing of LwIP features, including DHCP, pinging URLs or specific IP addresses, MQTT, and IPerf.
The application supports basic Bluetooth® Low Energy features, such as scanning, connecting, and advertising.
2. Requirements
2.1. Software and system requirements
The software requirements are as follows (minimum IDE versions):
- STM32CubeIDE toolchain V2.1.0 [1].
- IAR Embedded Workbench for Arm (EWARM) toolchain V9.30.1
- RealView Microcontroller Development Kit (MDK-ARM) toolchain V5.39
Programmer:
- STM32CubeProgrammer [2] to program the board with a pre-generated binary file
HyperTerminal:
- Use the application through the serial link
- Open a HyperTerminal client connected to the host ST-LINK COM port
The serial COM port must be configured as shown below:
| Baudrate | 921600 |
| Data | 8b |
| Stopbit | 1b |
| Parity | None |
| Flow control | None |
| Rx | LF |
| Tx | LF |
| Local Echo | Off |
For further details, refer to the HyperTerminal setup page.
2.2. Hardware requirements
This project is supported on NUCLEO-U575ZI-Q, NUCLEO-H563ZI, NUCLEO-H7S3L8, or NUCLEO-N657X0-Q host boards combined with the X-NUCLEO-67W61M1 board.
The X-NUCLEO-67W61M1 board is connected to the NUCLEO host board via the Arduino® connectors:
- 5V, 3V3, GND through the CN6
- SPI (CLK, MOSI, MISO), SPI_CS and USER_BUTTON signals through the CN5
- BOOT, CHIP_EN, SPI_RDY and UART TX/RX signals through the CN9
3. ST67W6X_CLI application description
3.1. Project directory
The ST67W6X_CLI and ST67W6X_CLI_LWIP applications are available by downloading the X-CUBE-ST67W61 Expansion Package.
Refer to the Project directory wiki page for more information on the project directory.
3.2. Project description
3.2.1. Topology structure
The ST67W6X_CLI and ST67W6X_CLI_LWIP projects can operate in station mode or in both station and soft-access point (soft-AP) modes.
The STA mode can be described with the following scheme:
Station and soft-AP modes can be described with the following scheme:
3.2.2. Project initialization
The different steps in the application initialization are described below:
3.3. Build and Install
Refer to the build and load chapter for detailed instructions on how to build and download the software onto the device.
3.3.1. ST67W6X default configuration
The default system configuration can be modified in "ST67W6X/Target/w6x_config.h":
/** NCP power save mode : 0: NCP stays always active / 1: NCP goes in low power mode when idle */ #define W6X_POWER_SAVE_AUTO 1 /* DEFINE TO 0 IN ST67W6X_CLI_LWIP PROJECT */ /** ST67W611M clock mode : 1: Internal RC oscillator, 2: External passive crystal, 3: External active crystal */ #define W6X_CLOCK_MODE 1
The default Wi-Fi® configuration can be modified in the "ST67W6X/Target/w6x_config.h" file:
/** Boolean to enable/disable autoconnect functionality */ #define W6X_WIFI_AUTOCONNECT 1 /* DEFINE TO 0 IN ST67W6X_CLI_LWIP PROJECT */ /** Define the max number of stations that can connect to the Soft-AP */ #define W6X_WIFI_SAP_MAX_CONNECTED_STATIONS 4 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */ /** Define the region code, supported values : [CN, JP, US, EU, 00] */ #define W6X_WIFI_COUNTRY_CODE "00" /** Define if the country code will match AP's one. * 0: match AP's country code, * 1: static country code */ #define W6X_WIFI_ADAPTIVE_COUNTRY_CODE 0
The default Bluetooth® Low Energy configuration can be modified in the "ST67W6X/Target/w6x_config.h" file:
/** String defining BLE hostname */ #define W6X_BLE_HOSTNAME "ST67W61_BLE"
The default Net configuration can be modified in the "ST67W6X/Target/w6x_config.h" file:
/** Define the DHCP configuration : 0: NO DHCP, 1: DHCP CLIENT STA, 2:DHCP SERVER AP, 3: DHCP STA+AP */
#define W6X_NET_DHCP 3 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */
/** String defining Soft-AP subnet to use.
* Last digit of IP address automatically set to 1 */
#define W6X_NET_SAP_IP_SUBNET {10, 19, 96} /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */
/** String defining Wi-Fi hostname */
#define W6X_NET_HOSTNAME "ST67W61_WiFi" /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */
/** Timeout in ticks when calling W6X_Net_Recv() */
#define W6X_NET_RECV_TIMEOUT 10000 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */
/** Timeout in ticks when calling W6X_Net_Send() */
#define W6X_NET_SEND_TIMEOUT 10000 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */
The default HTTP configuration can be modified in the "ST67W6X/Target/w6x_config.h" file:
/** HTTP Client thread stack size */ #define W6X_HTTP_CLIENT_THREAD_STACK_SIZE 1536 /** HTTP Client thread priority */ #define W6X_HTTP_CLIENT_THREAD_PRIO 30 /** Timeout value in millisecond for receiving data via TCP socket used by the HTTP client. * This value is set to compensate for when the NCP get stuck for a long time (1 second or more) * when retrieving data from an HTTP server for example */ #define W6X_HTTP_CLIENT_TCP_SOCK_RECV_TIMEOUT 1000 /** Size of the TCP socket used by the HTTP client, recommended to be at least 0x2000 when fetching lots of data. * 0x2000 is the value used in the SPI host project for OTA update, which retrieves around 1 mega bytes of data. */ #define W6X_HTTP_CLIENT_TCP_SOCKET_SIZE 12288
The default utilities configuration can be modified in the "ST67W6X/Target/w6x_config.h" file:
/** Enable Iperf feature */ #define IPERF_ENABLE 1 /** Enable IPv6 for Iperf */ #define IPERF_V6 1 /* DEFINE NOT PRESENT IN ST67W6X_CLI PROJECT */ /** Enable memory performance measurement */ #define MEM_PERF_ENABLE 0 /** Enable task performance measurement */ #define TASK_PERF_ENABLE 1 /** Enable LittleFS */ #define LFS_ENABLE 0 /** Enable Wi-Fi Alliance Traffic Generator */ #define WFA_TG_ENABLE 1
The shell can be configured in the "ST67W6X/Target/shell_config.h" file:
/** Enable the shell component */ #define SHELL_ENABLE 1 /** Default shell commands list level (0: Minimal, 1: Full) */ #define SHELL_CMD_LEVEL 0 /** Shell command maximum size */ #define SHELL_CMD_SIZE 256 /** Shell using color */ #define SHELL_USING_COLOR 1 /** Print an additional status message at the end of the command execution */ #define SHELL_PRINT_STATUS 0 /** Shell receive buffer size */ #define SHELL_FREERTOS_RX_BUFF_SIZE 256
The AT driver can be configured in "ST67W6X/Target/w61_driver_config.h":
/** Maximum number of detected AP during the scan. Cannot be greater than 50 */ #define W61_WIFI_MAX_DETECTED_AP 20 /** Enable/Disable Wi-Fi module logging */ #define WIFI_LOG_ENABLE 1 /** Enable/Disable Network module logging */ #define NET_LOG_ENABLE 1 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */ /** Maximum number of detected peripheral during the scan. Cannot be greater than 50 */ #define W61_BLE_MAX_DETECTED_PERIPHERAL 10 /** Enable/Disable BLE module logging */ #define BLE_LOG_ENABLE 1 /** Enable/Disable MQTT module logging */ #define MQTT_LOG_ENABLE 1 /* DEFINE NOT PRESENT IN ST67W6X_CLI_LWIP PROJECT */ /** Maximum SPI buffer size */ #define W61_MAX_SPI_XFER 6000 /* DEFINE to 1520 IN ST67W6X_CLI_LWIP PROJECT */ /** Enable IPv6 support : 0: Disabled, 1: Enabled */ #define W61_NET_IPV6_ENABLE 0 /** Debugging only: Enable AT log, i.e. logs the AT commands incoming/outcoming from/to the NCP */ #define W61_AT_LOG_ENABLE 0 /** Enable/Disable System module logging */ #define SYS_LOG_ENABLE 1
Additionally, some other options can be modified in the "ST67W6X/Target" directory using different configuration files, as outlined below:
- logging_config.h: This file provides configuration for the logging component, enabling the setting of the log level
- shell_config.h: This file provides configuration for the Shell component.
- w6x_config.h: This file provides configuration for the W6X APIs (used during init).
- w61_driver_config.h: This file provides configuration for the W61 configuration module.
All available defines are provided in the template directory "Middlewares/ST/ST67W6X_Network_Driver/Conf"
3.3.2. Application configuration
- The three sections below are common to both ST67W6X_CLI and ST67W6X_CLI_LWIP projects.
The logging output mode can be modified in "Appli/App/app_config.h":
/** Select output log mode [0: printf / 1: UART / 2: ITM] */ #define LOG_OUTPUT_MODE LOG_OUTPUT_UART
The host low-power mode can be modified in "Appli/App/app_config.h":
/** Low power configuration [0: disable / 1: sleep / 2: stop / 3: standby] */ #define LOW_POWER_MODE LOW_POWER_DISABLE
The host debugger pins can be modified in "Appli/App/app_config.h":
/** * Enable/Disable MCU Debugger pins (dbg serial wires) * @note by HW serial wires are ON by default, need to put them OFF to save power */ #define DEBUGGER_ENABLED 1
- The sections below concern only the ST67W6X_CLI project.
The echo client configuration can be modified in "Appli/App/echo.h":
/** URL of Echo TCP remote server */ #define ECHO_SERVER_URL "tcpbin.com" /** Port of Echo TCP remote server */ #define ECHO_SERVER_PORT 4242 /** Minimal size of a packet */ #define ECHO_TRANSFER_SIZE_START 1000 /** Maximal size of a packet */ #define ECHO_TRANSFER_SIZE_MAX 2000 /** To increment the size of a group of packets */ #define ECHO_TRANSFER_SIZE_ITER 250 /** Number of packets to be sent */ #define ECHO_ITERATION_COUNT 10
The FOTA client configuration can be modified in "Appli/App/fota.h":
/** Timeout value to set the FOTA timer to when the FOTA application encountered an error for the first time. * This allows to tune the timeout value before doing a retry attempt. (not applicable if FOTA timer is not used)*/ #define FOTA_TIMEOUT 20000 /** Delay to wait before rebooting the host device, waiting for NCP device to finish update */ #define FOTA_DELAY_BEFORE_REBOOT 16000 /** Stack size of the FOTA application, this value needs to take into account the HTTP client * and NCP FWU static data allocation */ #define FOTA_TASK_STACK_SIZE 1800 /** The max size of the URI supported, this because the buffer * that will receive this info is allocated at compile time (static) */ #define FOTA_URI_MAX_SIZE 256 /** Default HTTP server address */ #define FOTA_HTTP_SERVER_ADDR "192.168.8.105" /** Default HTTP port */ #define FOTA_HTTP_SERVER_PORT 8000 /** The folder containing the FOTA header, ST67 binary and the STM32 binary */ #define FOTA_HTTP_URI_TARGET "/STM32U575ZI_NUCLEO" /** Root folder of interest on the HTTP server */ #define FOTA_HTTP_COMMON_URI "/download" FOTA_HTTP_URI_TARGET /** Default URI for the ST67 binary, should be smaller in bytes size than the value defined by FOTA_URI_MAX_SIZE */ #define FOTA_HTTP_URI FOTA_HTTP_COMMON_URI "/st67w611m_mission_t01_v2.0.97.bin.ota" /** Default URI for the STM32 binary, should be smaller in bytes size than the value defined by FOTA_URI_MAX_SIZE */ #define FOTA_HTTP_URI_STM32 FOTA_HTTP_COMMON_URI "/fota_ST67W6X_CLI.bin" /** Default URI for the FOTA header */ #define FOTA_HTTP_URI_HEADER FOTA_HTTP_COMMON_URI "/ST67W611_STM32U575ZI_NUCLEO.json"
3.4. How it works
Once the application starts, it enters a state where it waits for commands to be executed via the terminal. To list all available commands, along with their descriptions and parameters, type "help". To display the help for a specific command, simply type "help <your command>".
w61/>help
3.4.1. Available commands
Below is a description of the commands available in the two projects ST67W6X_CLI (CLI) and ST67W6X_CLI_LWIP (CLI_LWIP).
By default, CLI projects are configured with a Minimal configuration, exposing only a subset of the available commands. To make all commands available in the shell, set the define SHELL_CMD_LEVEL to 1 in the "ST67W6X/Target/shell_config.h" file.
System Commands
| Command | Description | CLI | CLI_LWIP | Minimal Shell |
|---|---|---|---|---|
| help | help [ command ]. Display all available commands and the relative help message | ✔ | ✔ | ✔ |
| powersave | powersave [ 0: disable; 1: enable ] | ✔ | ✔ | ✔ |
| fs_list | fs_list. List all files in the file system | ✔ | ✔ | |
| fs_delete | fs_delete < filename >. Delete file from the ST67W611M1 file system | ✔ | ✔ | |
| fs_read | fs_read < filename >. Read file content | ✔ | ✔ | |
| fs_write | fs_write < filename >. Write file content from the Host to the ST67W611M1 | ✔ | ✔ | |
| reset | reset < 0: HAL_Reset; 1: NCP_Restore; 2: NCP_Reset >. Reset the system | ✔ | ✔ | ✔ |
| info | info. Display ST67W6X module info | ✔ | ✔ | ✔ |
| atcmd | atcmd < AT+CMD? >. Execute AT command | ✔ | ✔ | |
| spi_dump | spi_dump | ✔ | ✔ |
Wi-Fi® Commands
| Command | Description | CLI | CLI_LWIP | Minimal Shell |
|---|---|---|---|---|
| wifi_antenna | wifi_antenna [ mode [0: disabled; 1: static; 2: dynamic ] ] | ✔ | ✔ | |
| wifi_twt_teardown | wifi_twt_teardown < all_twt [0: a single flow; 1: all flows] > [ flow_id(in case all_twt param equals 0) [0 ; 8]] | ✔ | ||
| wifi_twt_status | wifi_twt_status | ✔ | ||
| wifi_twt_setup | wifi_twt_setup < setup_type(0: request; 1: suggest; 2: demand) > < flow_type(0: announced; 1: unannounced) > < wake_int_exp > < min_wake_duration > < wake_int_mantissa > | ✔ | ||
| wifi_dtim | wifi_dtim < value [greater than 0] > | ✔ | ✔ | |
| wifi_ap_mac | wifi_ap_mac | ✔ | ||
| wifi_ap_disconnect_sta | wifi_ap_disconnect_sta < MAC > | ✔ | ✔ | |
| wifi_ap_list_sta | wifi_ap_list_sta | ✔ | ✔ | |
| wifi_ap_stop | wifi_ap_stop | ✔ | ✔ | |
| wifi_ap_start | wifi_ap_start [ -s SSID ] [ -p Password ] [ -c channel [1; 13] ] [ -e security [0:Open; 2:WPA; 3:WPA2; 4:WPA3] ] [ -h hidden [0; 1] ] [ -m protocol [1: 802 11 b; 2: 802 11 g; 3: 802 11 n; 4: 802 11 ax] ] | ✔ | ✔ | |
| wifi_country_code | wifi_country_code [ 0:AP aligned country code; 1:User country code ] [ Country code [CN; JP; US; EU; 00] ] | ✔ | ✔ | |
| wifi_sta_state | wifi_sta_state | ✔ | ✔ | ✔ |
| wifi_sta_mac | wifi_sta_mac | ✔ | ✔ | |
| wifi_get_cred | wifi_get_cred | ✔ | ✔ | |
| wifi_delete_cred | wifi_delete_cred < SSID > | ✔ | ✔ | |
| wifi_add_cred | wifi_add_cred < SSID > < Password > | ✔ | ✔ | |
| wifi_auto_connect | wifi_auto_connect | ✔ | ✔ | |
| wifi_sta_disconnect | wifi_sta_disconnect [ -r ] | ✔ | ✔ | ✔ |
| wifi_sta_connect | wifi_sta_connect < SSID > [ Password ] [ -b BSSID ] [ -i interval [0; 7200] ] [ -n nb_attempts [0; 1000] ] [ -wps ] [ -wep ] [ -sec ] | ✔ | ✔ | ✔ |
| wifi_scan | wifi_scan [ -p ] [ -s SSID ] [ -b BSSID ] [ -c channel [1; 13] ] [ -n max_count [1; 50] ] | ✔ | ✔ | ✔ |
Bluetooth® Low Energy Commands
| Command | Description | CLI | CLI_LWIP | Minimal Shell |
|---|---|---|---|---|
| ble_init | ble_init [ 1: client mode; 2: server mode; 3:dual mode ] | ✔ | ✔ | ✔ |
| ble_deinit | ble_deinit | ✔ | ✔ | |
| ble_adv | ble_adv [ -a abort adv ] | ✔ | ✔ | ✔ |
| ble_scan | ble_scan [ -a abort scan ] | ✔ | ✔ | ✔ |
| ble_connect | ble_connect < Conn Handle [0; 1] > < BD Addr > | ✔ | ✔ | ✔ |
| ble_disconnect | ble_disconnect < Conn Handle [0; 1] > | ✔ | ✔ | ✔ |
| ble_tx_power | ble_tx_power [ Tx Power [0; 20] ] | ✔ | ✔ | |
| ble_bd_addr | ble_bd_addr [ BD Addr ] | ✔ | ✔ | |
| ble_device_name | ble_device_name [ Device Name ] | ✔ | ✔ | |
| ble_adv_data | ble_adv_data < Advertising Data > | ✔ | ✔ | |
| ble_adv_param | ble_adv_param [ AdvIntMin [32; 16384] ] [ AdvIntMax [32; 16384] ] [ Adv Type [0; 2] ] [ Adv Channel [1: chan 37; 2: chan 38; 3: chan 39; 7: all] ] | ✔ | ✔ | |
| ble_scan_param | ble_scan_param [ Scan Type [0; 1] ] [ OwnAddr Type [0; 3] ] [ Filter Policy [0; 3] ] [ Scan Interval [4; 16384] ] [ Scan Window [4; 16384] ] | ✔ | ✔ | |
| ble_scanrespdata | ble_scanrespdata < Scan Response Data > | ✔ | ✔ | |
| ble_conn_param | ble_conn_param [ Conn Handle [0; 1] ] [ ConnIntMin [6; 3200] ] [ ConnIntMax [6; 3200] ] [ Latency [0; 499] ] [ Timeout [10; 3200] ] | ✔ | ✔ | |
| ble_get_conn | ble_get_conn | ✔ | ✔ | |
| ble_exchange_mtu | ble_exchange_mtu < Conn Handle [0; 1] > | ✔ | ✔ | |
| ble_data_length | ble_data_length < Conn Handle [0; 1] > < TxBytes [27; 251] > < TxTransTime > | ✔ | ✔ | |
| ble_srv_create | ble_srv_create < Service Index [0; 2] > < UUID > < UUID type > | ✔ | ✔ | ✔ |
| ble_srv_delete | ble_srv_delete < Service Index [0; 2] > | ✔ | ✔ | |
| ble_char_create | ble_char_create < Service Index [0; 2] > < Charac Index : [0; 4] > < UUID > < UUID type > < Charac Property > < Charac Permission: read 1; write 2 > | ✔ | ✔ | ✔ |
| ble_srv_list | ble_srv_list | ✔ | ✔ | |
| ble_srv_reg | ble_srv_reg | ✔ | ✔ | ✔ |
| ble_rem_srv_list | ble_rem_srv_list < Conn Handle [0; 1] > | ✔ | ✔ | ✔ |
| ble_rem_char_list | ble_rem_char_list < Conn Handle [0; 1] > < Service Index [1; 4] > | ✔ | ✔ | ✔ |
| ble_send_notif | ble_send_notif < Conn Handle [0; 1] > < Service Index [0; 1] > < Char Index [0; 4] > < Timeout > < Data > | ✔ | ✔ | ✔ |
| ble_send_indication | ble_send_indication < Conn Handle [0; 1] > < Service Index [0; 1] > < Char Index [0; 4] > < Timeout > < Data > | ✔ | ✔ | ✔ |
| ble_read_data | ble_read_data < Service Index [0; 1] > < Char Index [0; 4] > < Timeout > < Data > | ✔ | ✔ | ✔ |
| ble_client_write_data | ble_client_write_data < Conn Handle [0; 1] > < Service Index [1; 5] > < Char Index [1; 5] > < Timeout > < Data > | ✔ | ✔ | ✔ |
| ble_client_read_data | ble_client_read_data < Conn Handle [0; 1] > < Service Index [1; 5] > < Char Index [1; 5] > | ✔ | ✔ | ✔ |
| ble_client_sub_char | ble_client_sub_char < Conn Handle [0; 1] > < CharValue Handle > < Char Prop [1; 2] > | ✔ | ✔ | ✔ |
| ble_client_unsub_char | ble_client_unsub_char < Conn Handle [0; 1] > < CharValue Handle > | ✔ | ✔ | |
| ble_sec_param | ble_sec_param [ Security Parameter [0; 4] ] | ✔ | ✔ | |
| ble_sec_start | ble_sec_start < Conn Handle [0; 1] > < Security Level [1; 4] > | ✔ | ✔ | |
| ble_sec_set_passkey | ble_sec_set_passkey < Conn Handle [0; 1] > < PassKey [0; 999999] > | ✔ | ✔ | |
| ble_sec_passkey_confirm | ble_sec_passkey_confirm < Conn Handle [0; 1] > | ✔ | ✔ | |
| ble_sec_pairing_confirm | ble_sec_pairing_confirm < Conn Handle [0; 1] > | ✔ | ✔ | |
| ble_sec_pairing_cancel | ble_sec_pairing_cancel < Conn Handle [0; 1] > | ✔ | ✔ | |
| ble_sec_unpair | ble_sec_unpair < Remote BD Addr > < Addr Type [0; 3] > | ✔ | ✔ | |
| ble_bonded_device_list | ble_bonded_device_list | ✔ | ✔ | |
| ble_set_gap_appearance | ble_set_gap_appearance < Appearance Value [0; 0xffff] > | ✔ | ✔ |
Net Commands
| Command | Description | CLI | CLI_LWIP | Minimal Shell |
|---|---|---|---|---|
| dnslookup | dnslookup <hostname> | ✔ | ✔ | |
| time | time < timezone : UTC format : range [-12; 14] or HHmm format : with HH in range [-12; +14] and mm in range [00; 59] > | ✔ | ✔ | |
| ping | ping <hostname> [ -c count [1; max(uint16_t) - 1] ] [ -s size [1; 10000] ] [ -i interval [100; 3500] ] [ -t timeout [100; 3500] ] | ✔ | ✔ | ✔ |
| ping6 | ping <hostname> [ -c count [1; max(uint16_t) - 1] ] [ -s size [1; 10000] ] [ -i interval [100; 3500] ] [ -t timeout [100; 3500] ] | ✔ | ✔ | |
| net_dhcp | net_dhcp [ 0:DHCP disabled; 1:DHCP enabled ] [ 1:STA only; 2:AP only; 3:STA + AP ] [ lease_time [1; 2880] ] | ✔ | ✔ | |
| net_ap_ip | net_ap_ip | ✔ | ✔ | |
| net_sta_dns | net_sta_dns [ DNS1 addr ] [ DNS2 addr ] [ DNS3 addr ] | ✔ | ||
| net_sta_ip | net_sta_ip [ IP addr ] [ Gateway addr ] [ Netmask addr ] | ✔ | ✔ | ✔ |
| net_hostname | net_hostname [ hostname ] | ✔ | ✔ |
MQTT Commands
| Command | Description | CLI | CLI_LWIP | Minimal Shell |
|---|---|---|---|---|
| mqtt_publish | mqtt_publish < Topic > < Message > [ -q Qos ] [ -r ] | ✔ | ✔ | |
| mqtt_unsubscribe | mqtt_unsubscribe < Topic > | ✔ | ||
| mqtt_subscribe | mqtt_subscribe < Topic > | ✔ | ✔ | |
| mqtt_disconnect | mqtt_disconnect | ✔ | ✔ | |
| mqtt_connect | mqtt_connect < -h Host > < -p Port > | ✔ | ✔ | |
| mqtt_configure | mqtt_configure < -s Scheme > < -i ClientId > [ -u <Username> ] [ -pw <Password> ] [ -c <Certificate> ] [ -k <PrivateKey> ] [ -ca <CACertificate> ] [ -sni ] [ -ka <KeepAlive> ] [ -q <LWT_QoS> ] [ -cs ] [ -r ] | ✔ | ✔ |
FOTA Commands
| Command | Description | CLI | CLI_LWIP | Minimal Shell |
|---|---|---|---|---|
| fota_http | fota_http < server IP > < server port > < ST67 resource URI > [ STM32 resource URI ] [ FOTA header resource URI ]. Run firmware update over HTTP | ✔ | ✔ |
Applicative Commands
| Command | Description | CLI | CLI_LWIP | Minimal Shell |
|---|---|---|---|---|
| info_app | info_app. Display application info | ✔ | ✔ | ✔ |
| quit | quit. Stop application execution | ✔ | ✔ | ✔ |
| echo | echo [iteration] | ✔ | ✔ | |
| iperf | iperf [options]. Iperf command line tool for network performance measurement. [-h] for help | ✔ | ✔ | ✔ |
| task_report | task_report. Display task performance report | ✔ | ✔ | ✔ |
| task_perf | task_perf [-s]. Start or stop [-s] task performance measurement | ✔ | ✔ | ✔ |
| echostop | echostop. WFA - Stops the UDP echo server. | ✔ | ✔ | ✔ |
| echostart | echostart <port>. WFA - Starts the UDP echo server on the specified port. | ✔ | ✔ | ✔ |
Commands description:
In this project, the following convention is used for getting and setting values. When a command is issued without a parameter, it acts as a "get" operation. Adding a parameter makes it a "set" operation. This applies to all commands capable of "get" functionality. For example:
w61/>net_sta_ip
This returns the station, gateway, and netmask IP addresses.
w61/>net_sta_ip 192.168.1.2
This sets the station IP address to 192.168.1.2.
Convention:
The parameters enclosed in < > are mandatory, while those in [ ] are optional and not required in all cases.
3.4.2. System commands
- help [ command ]
This command is used to display the global help message describing all available commands and their summaries if no argument is given.
To print the help for a specific command, type:
w61/> help help help - help [ command ]. Display all available commands and the relative help message
- reset < 0: HAL_Reset; 1: NCP_Restore; 2: NCP_Reset >
This command is used to perform a hardware reboot of the system, restore the ST67W611M1 to its initial configuration, or reset it.
- info
This command prints different pieces of system information:
- ST67W6X info: ST67W6X MW, AT, SDK and Mac SW versions
- Module and BOM IDs
- Trim values for Wi-Fi®, Bluetooth® Low Energy, and XTAL
- MAC address of the device
- Anti-rollback values (values increased with each release to ensure firmware/hardware compatibility)
w61/>info --------------- ST67W6X info ------------ ST67W6X MW Version: 1.2.0 AT Version: 1.0.0 SDK Version: 2.0.97 Wi-Fi MAC Version: 1.6.44 BT Controller Version: 1.6.121 BT Stack Version: 1.10.70 Build Date: Nov 19 2025 11:20:53 Module ID: C6AFDBD111400004 (-B) BOM ID: 1 Manufacturing Year: 2024 Manufacturing Week: 47 Battery Voltage: 3.304 V Trim Wi-Fi hp: 2,2,2,2,2,2,2,2,2,2,2,2,1,2 Trim Wi-Fi lp: 2,3,3,4,4,5,5,5,5,5,6,6,6,6 Trim BLE: 1,2,1,0,1 Trim XTAL: 43 MAC Address: 40:82:7b:00:11:e2 Anti-rollback Bootloader: 0 Anti-rollback App: 0 -----------------------------------------
- fs_list
This command lists the different files stored in the host and in the ST67W611M1.
Example:
w61/>fs_list NCP Files: ca_1.crt ca_1.key ca_2.crt ca_2.key client_1.crt client_1.key client_2.crt client_2.key google_fr.crt isrgrootx1.pem r12.pem server_1.crt server_1.key server_2.crt server_2.key
- fs_read < filename >
This command displays the contents of the files listed by the fs_list command.
- fs_write < filename >
This command stores the file specified as a parameter in the ST67W611M1 memory.
- fs_delete < filename >
This command deletes the file specified as a parameter from the ST67W611M1 memory.
- powersave [ 0: disable; 1: enable ]
This command specifies whether the ST67W611M1 enters low-power mode whenever it can, typically after sending the response to a command.
Example:
w61/>powersave powersave mode is disabled w61/>powersave 1 w61/>powersave powersave mode is enabled
- atcmd < AT+CMD >
This command sends direct AT commands to the ST67W611M1. This command cannot be used to send commands involving data transfer.
Example:
w61/>atcmd AT+CWMODE? AT+CWMODE? +CWMODE:1 OK
- spi_dump
This command displays information about the SPI interface.
Example:
w61/>spi_dump Master transfer state Idle SPI pending events 0 Slave data ready pin Low TX 74 pkts TX 2077 bytes RX 165 pkts RX 2061 bytes drop mem_err stall IO error header error wait_txn_timeout wait_hdr_ack_timeout TX queue items 0 RX queue[0] items 0
3.4.3. Wi-Fi® management commands
- wifi_sta_state
This command displays the station state.
| States | Description |
|---|---|
|
NO STARTED CONNECTION |
The station is active but has no previous connection. |
|
CONNECTING |
The station tries to connect to a BSS/SSID. |
|
CONNECTED |
The station is connected. |
|
GOTIP |
The station has received an IP address through DHCP. |
|
DISCONNECTED |
The station is disconnected from the previous BSS/SSID. |
|
OFF |
The station is off. |
Expected results:
Station is not connected to an access point (AP):
w61/>wifi_sta_state STA state : STA DISCONNECTED
Station is connected:
w61/>wifi_sta_state STA state : STA CONNECTED Connected to following Access Point : [62:5d:b8:7a:b0:ba] Channel: 1 | RSSI: -43 | SSID: ASUS
Station is connected and has an IP:
w61/>wifi_sta_state STA state : STA GOT IP Connected to following Access Point : [62:5d:b8:7a:b0:ba] Channel: 1 | RSSI: -43 | SSID: ASUS
- wifi_country_code [ 0: AP aligned country code; 1: User country code ] [ Country code [CN; JP; US; EU; 00] ]
This command sets/reads the country code for regulatory domains. The available country codes in alpha-2 format include US, EU, JP, CN, and 00 (World).
Example:
w61/>wifi_country_code Country policy : 0 Country code : 00 w61/>wifi_country_code 1 JP Country code configuration succeeds w61/>wifi_country_code Country policy : 1 Country code : JP
- wifi_scan [ -p ][ -s SSID ][ -b BSSID ][ -c channel [1; 13] ][ -n max_count [1; 50] ]
This command launches a scan. Different options can be added to the command:
| Option | Description |
|---|---|
|
-p |
This option is used to start a passive scan. |
|
-s <ssid> |
This option is used to scan only for beacons from the given SSID. |
|
-b <bssid> |
This option is used to scan only for beacons from the given BSSID. |
|
-c <channel> |
This option is used to limit the scan to a specific channel of the 2.4GHz frequency band. |
|
-n <max_count> |
This option is used to limit the number of access points displayed in the scan results. |
Example:
w61/>wifi_scan -c 1 Scan results : [30:de:4b:d3:b9:4d] Channel: 1 | WPA2 | N | RSSI: -48 | SSID: TP-Link_B94D [32:de:4b:d3:b9:4d] Channel: 1 | WPA2 | N | RSSI: -48 | SSID: ASUS
w61/>wifi_scan -s STWLAN2 Scan results : [78:0c:f0:6c:b4:a0] Channel: 6 | WPA-EAP | N | RSSI: -56 | SSID: STWLAN2 [78:0c:f0:74:45:80] Channel: 1 | WPA-EAP | N | RSSI: -60 | SSID: STWLAN2 [78:0c:f0:79:02:20] Channel: 6 | WPA-EAP | N | RSSI: -66 | SSID: STWLAN2
w61/>wifi_scan -b 78:0c:f0:79:02:20 Scan results : [78:0c:f0:79:02:20] Channel: 6 | WPA-EAP | N | RSSI: -66 | SSID: STWLAN2
- wifi_get_cred
This command returns the list of previous access points to which the station connected and whose SSID/password pairs are stored in its secure storage.
Example:
w61/>wifi_get_cred Credentials list : SSID: ASUS SSID: TP-Link
- wifi_delete_cred < SSID >
This command deletes an SSID/password pair from the secure storage of the ST67.
Example:
w61/>wifi_delete_cred TP-Link Credentials deleted successfully
w61/>wifi_get_cred Credentials list : SSID: ASUS
- wifi_add_cred < SSID > < Password >
This command adds an SSID/password pair to the secure storage of the ST67.
Example:
w61/>wifi_add_cred MySSID MyPassword Credentials added successfully
w61/>wifi_get_cred Credentials list : SSID: MySSID SSID: ASUS
- wifi_sta_connect < SSID > [ Password ] [ -b BSSID ][ -i interval [0; 7200] ] [ -n nb_attempts [0; 1000] ] [ -sec ]
This command connects a station to a local access point.
| Option | Description |
|---|---|
| Mandatory | |
|
ssid |
The SSID of the local access point to connect to. Maximum length: 32 characters. |
| Optional | |
|
Password |
This option is needed only if the local access point uses WPA, WPA2, or WPA3 security. Maximum length: 63 characters. |
|
-b <BSSID> |
This option specifies the BSSID of the access point to connect to if there are multiple access points with the same name. |
| -i <interval> | This option specifies the reconnection interval between connection/reconnection attempts if the first attempt fails. Default value: 0. The station does not reconnect to the AP when disconnected. Range: [0;7200]. The value is expressed in seconds. |
| -n <nb_attempts> | This option specifies the number of reconnection attempts in case the initial connection or reconnection fails. Default value: 0 (always try to reconnect), range: [0;1000] |
| -sec | This option specifies that the SSID/password pair must be looked up in the ST67 secure storage bank. The goal is to avoid providing the password each time a connection is made. |
This command executes a scan to retrieve the information needed for the connection, including the security of the access point.
Example:
w61/>wifi_sta_connect ASUS chocolat NCP is treating the connection request DHCP client start, this may take few seconds Connected to following Access Point : [62:5d:b8:7a:b0:ba] Channel: 11 | RSSI: -41 | SSID: ASUS Connection success w61/>Station got a new IP address : 192.168.3.101
- wifi_sta_autoconnect
This command is used to get the auto-connect mode. This command cannot change the auto-connect mode, as this is managed via a define at compile time.
Example:
w61/>wifi_auto_connect Get auto-connect state succeed. Auto-connect state : 1
- wifi_sta_disconnect [ -r ]
This command disconnects the station from a network.
The -r option removes the registered SSID and password for the previously connected access point.
Example:
w61/>wifi_sta_disconnect Reason: WLAN_FW_DISCONNECT_BY_USER_WITH_DEAUTH Station disconnected from Access Point
The "reason" for the disconnection is returned after each disconnection. Below is a list of the different reasons:
- Failure to allocate memory for transmitting an authentication frame.
- Authentication process failed.
- The authentication algorithm was not accepted or failed.
- Failure to allocate memory for transmitting an association frame.
- Association process with the access point failed.
- De-authentication by the access point occurred when not connected.
- De-authentication by the access point occurred while connected.
- A timeout occurred during the 4-way handshake, likely due to PSK (pre-shared key) issues.
- Failed to transmit a de-authentication frame during the 4-way handshake.
- Failed to allocate memory for a de-authentication frame during the 4-way handshake.
- Timeout waiting for authentication or association response.
- No BSSID or channel found during the scan process.
- Failed to create a channel context when attempting to join a network.
- Failure to join a network.
- Failed to add a station (STA) to the network.
- Beacon loss occurred, potentially leading to disconnection.
- The network security settings do not match.
- An error occurred due to an incorrect WEP key length.
- User-initiated disconnection with de-authentication.
- User-initiated disconnection without sending a de-authentication frame.
- Disconnection occurred because the firmware failed to send a power-save null frame.
- Traffic loss was detected.
- Switching to a new channel failed.
- Confirmation of authentication or association response failed.
- Reassociation process is starting.
- wifi_sta_mac
This command prints the MAC address of the station interface.
Example:
w61/>wifi_sta_mac STA MAC : 40:82:7b:00:11:e2
- wifi_ap_start [ -s SSID ] [ -p Password ] [ -c channel [1; 13] ] [ -e security [0:Open; 2:WPA; 3:WPA2; 4:WPA3] ] [ -h hidden [0; 1] ] [ -m protocol [1: 802 11 b; 2: 802 11 g; 3: 802 11 n; 4: 802 11 ax] ]
This command starts the soft-access point (soft-AP), enabling an additional interface dedicated to the soft-AP alongside the station interface.
| Option | Description |
|---|---|
| Mandatory | |
|
-s <SSID> |
This option specifies the SSID name of the soft-AP. |
|
-p <Password> |
This option specifies the password for the SSID. It is mandatory only if security is not OPEN. |
|
-c <channel> |
This option specifies the channel used by the soft-AP. |
|
-e <security> |
This option specifies the security of the soft-AP [0: OPEN, 2: WPA, 3: WPA2] |
| -h <hidden> | This option specifies whether the SSID is broadcast or not [0: broadcasting SSID (default); 1: not broadcasting SSID] |
| -m <protocol> | This option specifies the 802.11 protocol of the access point [1: 802 11 b; 2: 802 11 g; 3: 802 11 n; 4: 802 11 ax]. Default is 802.11ax. |
Example:
w61/>wifi_ap_start -s MyAP -p 12345678 -c 1 -e 3 Soft-AP configuration done
Get command:
w61/>wifi_ap_start AP SSID : MyAP AP Channel : 10 AP Security : WPA2 AP Hidden : 0 AP Protocol : AX
- wifi_ap_stop
This command stops the soft-AP.
- wifi_ap_list_sta
This command prints all the remote stations connected to the soft-AP.
Example:
w61/>wifi_ap_list_sta Connected stations : MAC : 7a:2e:95:96:b0:1f | IP : 192.168.8.2
- wifi_ap_disconnect_sta < MAC >
This command disconnects the remote stations connected to the soft-AP. The MAC address of the remote station must be passed as a parameter.
Example:
w61/>wifi_ap_disconnect_sta 7a:2e:95:96:b0:1f Station disconnected from soft-AP : [7a:2e:95:96:b0:1f] WIFI CLIENT DISCONNECTED SUCCESSFULLY
- wifi_ap_mac
This command prints the MAC address of the soft-AP interface.
Example:
w61/>wifi_ap_mac AP MAC : 42:82:7b:00:0e:af
- wifi_dtim < value [greater than 0] >
This command sets or gets the DTIM interval.
Example:
w61/>wifi_dtim 10
- wifi_twt_teardown < all_twt [0: a single flow; 1: all flows] > [ flow_id(in case all_twt param equals 0) [0 ; 8]]
This command tears down a specific TWT configuration or all of them. (This command does not take any parameters in the v1.2.0 delivery.)
- wifi_twt_setup < setup_type(0: request; 1: suggest; 2: demand) > < flow_type(0: announced; 1: unannounced) > < wake_int_exp > < min_wake_duration > < wake_int_mantissa >
This command sets the TWT parameters.
To calculate the TWT (Target Wake Time) wake interval, use the following equation: TWT Wake Interval = microseconds
- wifi_twt_status
This command returns the status of the current TWT configuration.
- wifi_antenna [ mode [0: disabled; 1: static; 2: dynamic ] ]
This command sets or gets the mode and the antenna used by the ST67W611M1 (antenna is get-only).
| Mode | Description |
|---|---|
|
0 |
This mode uses the default antenna. |
|
1 |
This mode lets the ST67W611M1 run a static algorithm to choose the best antenna to use after the first connection. |
|
2 |
This mode is not available currently. |
3.4.4. Bluetooth® Low Energy commands
- ble_init [ 1: client mode; 2: server mode; 3: dual mode ]
This command initializes the module in Bluetooth® Low Energy client, server, or dual (client/server) mode depending on the parameter value.
It also sets the Bluetooth® Low Energy device name to: "ST67W61_BLE".
Calling this function without a parameter returns the currently initialized mode.
- ble_deinit
This command deinitializes the Bluetooth® Low Energy device.
- ble_adv [ -a abort adv ]
This command starts or stops Bluetooth® Low Energy advertising.
Calling this function without a parameter starts advertising, while calling it with the -a parameter stops it.
- ble_scan [ -a abort scan ]
This command starts or stops Bluetooth® Low Energy scanning.
Calling this function without a parameter starts scanning, while calling it with the -a parameter stops it.
- ble_connect < conn handle: 0 or 1 > < BD addr >
This command connects to a remote device.
The connection handle to use and the BD address of the remote device must be passed as parameters.
Example:
w61/>ble_connect 0 40:82:7b:00:0b:bc BLE connected -> BLE CONNECTED: Conn_Handle: 0 BLE Connection OK
- ble_disconnect < conn handle: 0 or 1 >
This command disconnects the device from a remote device.
The connection handle for this remote device must be passed as a parameter.
- ble_tx_power [ Tx Power [0; 20] ]
This command sets the Tx Power.
Without an argument, this command gets the current TX Power.
- ble_bd_addr [ BD Addr ]
This command sets a new Bluetooth® Low Energy BD address.
Without an argument, this command gets the current Bluetooth® Low Energy BD address.
Example:
w61/>ble_bd_addr 11:22:33:44:55:66 Set BD_ADDR OK w61/>ble_bd_addr BD Addr: 11:22:33:44:55:66
- ble_device_name [ Device Name ]
This command sets a new Bluetooth® Low Energy device name.
Maximum name size is 26.
Without an argument, this command gets the current Bluetooth® Low Energy device name.
Example:
w61/>ble_device_name Hello_BLE Set Device Name OK: Hello_BLE w61/>ble_device_name Get Device Name OK: Hello_BLE
- ble_adv_data < Advertising Data >
This command sets the Bluetooth® Low Energy advertising data.
Advertising data must follow the format below:
| Advertising data | |||||||
|---|---|---|---|---|---|---|---|
|
Example:
w61/>ble_adv_data 0809703270535F32320FFF3000028B830000000008E12C1122020106 Set Advertising Data OK
- ble_adv_param [ AdvIntMin [32; 16384] ] [ AdvIntMax [32; 16384] ] [ Adv Type [0; 2] ] [Adv Channel [1: chan 37; 2: chan 38; 3: chan 39; 7: all] ]
This command sets the Bluetooth® Low Energy advertising parameters.
Without an argument, this command gets the current Bluetooth® Low Energy advertising parameters.
Adv type values are:
- 0: Connectable Undirected Advertising (ADV_TYPE_IND)
- 1: Scannable Undirected Advertising (ADV_TYPE_SCAN_IND)
- 2: Non-Connectable Undirected Advertising (ADV_TYPE_NONCONN_IND)
AdvIntMin and AdvIntMax are in ms.
- ble_scan_param [ Scan Type [0; 1] ] [ OwnAddr Type [0; 3] ] [ Filter Policy [0; 3] ] [ Scan Interval [4; 16384] ] [ Scan Window [4; 16384] ]
This command sets the Bluetooth® Low Energy scan parameters.
Without an argument, this command gets the current Bluetooth® Low Energy scan parameters.
Scan type values are:
- 0: Passive scan
- 1: Active scan
OwnAddr type values are:
- 0: Public address
- 1: Random address
- 2: Public Resolvable Private address
- 3: Random Resolvable Private address
Filter policy values are:
- 0: All
- 1: Only whitelisted addresses
- 2: Resolvable Private Address
- 3: Resolvable Private Address whitelist
Scan Interval and Scan Window are in ms.
- ble_scanrespdata < Scan Response Data >
This command sets the Bluetooth® Low Energy scan response data.
Scan Response data must follow the format below:
| Scan response data | |||||||
|---|---|---|---|---|---|---|---|
|
Example:
w61/>ble_scanrespdata 02010606095757575757 Set Scan Response Data OK: 02010606095757575757
- ble_conn_param [ Conn Handle [0; 1] ] [ ConnIntMin [6; 3200] ] [ConnIntMax [6; 3200] ] [ Latency [0; 499] ] [ Timeout [10; 3200] ]
This command sets the Bluetooth® Low Energy connection parameters.
With only the Conn Handle argument, this command gets the current Bluetooth® Low Energy connection parameters for the specified connection.
ConnIntMin, ConnIntMax, Latency, and Timeout are in ms.
- ble_get_conn
This command gets the Bluetooth® Low Energy connections information.
- ble_exchange_mtu < Conn Handle [0; 1] >
This command launches Maximum Transmission Unit (MTU) exchange on selected connection.
- ble_data_length < Conn Handle [0; 1] > < TxBytes [27; 251] > < TxTransTime >
This command sets the Bluetooth® Low Energy data length on selected connection. TxTransTime is in ms and must be in range [328, 17040].
- ble_srv_create < Service Index [0; 2] > < UUID > < UUID type >
This command creates a Bluetooth® Low Energy service with a specified UUID in 16 or 128 bits.
To set a 16-bit UUID, UUID type must be equal to 0.
To set a 128-bit UUID, UUID type must be equal to 2.
Example:
w61/>ble_srv_create 0 180a 0
- ble_srv_delete < Service Index [0; 2] >
This command deletes an existing Bluetooth® Low Energy service.
- ble_char_create < Service Index [0; 2] > < Charac Index : [0; 4] > < UUID > < UUID type > < Charac Property > < Charac Permission: read 1 write 2 >
This command creates a Bluetooth® Low Energy characteristic for an existing Bluetooth® Low Energy service with a specified UUID in 16 or 128 bits.
To set a 16-bit UUID, UUID type must be equal to 0.
To set a 128-bit UUID, UUID type must be equal to 2.
Characteristic property values are:
- 2: Characteristic read property
- 4: Characteristic write without response property
- 8: Characteristic write with response property
- 16: Characteristic notify property
- 32: Characteristic indicate property
Characteristic permission values are:
- 1: Read permissions
- 2: Write permissions
Example:
w61/>ble_char_create 0 0 2a29 0 2 2
- ble_srv_list
This command lists all Bluetooth® Low Energy services and characteristics created.
- ble_srv_reg
This command registers all Bluetooth® Low Energy services and characteristics created, making them discoverable by remote devices.
- ble_rem_srv_list < Conn Handle [0; 1] >
This command discovers all Bluetooth® Low Energy services on a remote server.
Example:
w61/>ble_rem_srv_list 0 BLE service discovered -> BLE SERVICE DISCOVERED: idx = 1, UUID = 18010000 BLE service discovered -> BLE SERVICE DISCOVERED: idx = 2, UUID = 18000000 BLE service discovered -> BLE SERVICE DISCOVERED: idx = 3, UUID = 180a0000 BLE service discovered -> BLE SERVICE DISCOVERED: idx = 4, UUID = 0000fe40cc7a482a984a7f2ed5b3e58f Remote Service Discovery OK: Connection Handle 0
- ble_rem_char_list < Conn Handle [0; 1] > < Service Index [1; 4] >
This command discovers all Bluetooth® Low Energy characteristics of the specified service on a remote server.
The service must be discovered using ble_rem_srv_list before launching this command.
Example:
w61/>ble_rem_char_list 0 1 BLE characteristic discovered -> BLE CHARACTERISTIC DISCOVERED: Service idx = 1, Charac idx = 1, UUID = 2a050000, Char Handle = 2,Char Value Handle = 3 Remote Characteristic Discovery OK: Connection Handle 0 and Service Index 1
- ble_send_notif < Conn Handle [0; 1] > < Service Index [0; 2] > < Char Index [0; 4] > < Timeout > < Data >
This command sends a notification from a Bluetooth® Low Energy characteristic to a remote client selected by Conn Handle,
using Service Index and Char Index, which are the indexes of the services and characteristics previously created using
ble_srv_create and ble_char_create.
- ble_send_indication < Conn Handle [0; 1] > < Service Index [0; 2] > < Char Index [0; 4] > < Timeout > < Data >
This command sends an indication from a Bluetooth® Low Energy characteristic to a remote client selected by Conn Handle,
using Service Index and Char Index, which are the indexes of the services and characteristics previously created using
ble_srv_create and ble_char_create.
Example:
w61/>ble_send_indication 0 1 1 0 32333435 ble_send_indication 0 1 1 0 32333435 Send Indication OK: Service Index: 1 Char Index: 1 Data: 2345 Requested Length: 4 Sent Length: 4 Timeout: 0 ms
- ble_read_data < Service Index [0; 2] > < Char Index [0; 4] > < Timeout > < Data >
This command sets Bluetooth® Low Energy characteristic data that can be read by the remote client,
with Service Index and Char Index, the indexes of Services and Characteristics previously created using
ble_srv_create and ble_char_create.
- ble_client_write_data < Conn Handle [0; 1] > < Service Index [1; 5] > < Char Index [1; 5] > < Timeout > < Data >
This command writes data to a remote Bluetooth® Low Energy server characteristic,
using Service Index and Char Index, which are the indexes of the remote server services and characteristics discovered using
ble_rem_srv_list and ble_rem_char_list .
- ble_client_read_data < Conn Handle [0; 1] > < Service Index [1; 5] > < Char Index [1; 5] >
This command reads data from a remote Bluetooth® Low Energy server characteristic,
using Service Index and Char Index, which are the indexes of the remote server services and characteristics discovered using
ble_rem_srv_list and ble_rem_char_list .
- ble_client_sub_char < Conn Handle [0; 1] > < CharValue Handle > < Char Prop [1; 2] >
This command subscribes to a remote server Bluetooth® Low Energy characteristic.
The discovered characteristic value handle must be passed as a parameter.
Characteristic property values are:
- 1: Notification
- 2: Indication
Example:
w61/>ble_client_sub_char 0 3 1 Client Subscribe Charac OK: Conn Handle: 0 CharValue Handle: 3 Char Prop: 1
- ble_client_unsub_char < Conn Handle [0; 1] > < CharValue Handle >
This command unsubscribes from a remote server Bluetooth® Low Energy characteristic.
The discovered characteristic value handle must be passed as a parameter.
- ble_sec_param [ Security Parameter [0; 4] ] ]
This command sets Bluetooth® Low Energy security parameters.
Without an argument, this command gets the current security parameters.
Security parameter values are:
- 0: IO display only
- 1: IO display Yes No
- 2: IO keyboard only
- 3: IO No Input Output
- 4: IO keyboard display
- ble_sec_start < Conn Handle [0; 1] > < Security Level [1; 4] >
This command initiates Bluetooth® Low Energy pairing on the selected connection.
Security level values are:
- 1: No encryption and no authentication
- 2: Encryption and no authentication (no MITM)
- 3: Encryption and authentication (MITM)
- 4: Authenticated Secure Connections and 128-bit key
- ble_sec_set_passkey < Conn Handle [0; 1] > < PassKey [0; 999999]>
This command sets the Bluetooth® Low Energy security passkey.
- ble_sec_passkey_confirm < Conn Handle [0; 1] >
This command confirms the received Bluetooth® Low Energy security passkey.
- ble_sec_pairing_confirm < Conn Handle [0; 1] >
This command confirms the Bluetooth® Low Energy security pairing request.
- ble_sec_pairing_cancel < Conn Handle [0; 1] >
This command cancels the Bluetooth® Low Energy security pairing request.
- ble_sec_unpair < Remote BD Addr > < Addr Type [0; 3] >
This command unpairs a remote Bluetooth® Low Energy paired device.
Address type values are:
- 0: Public address
- 1: Random address
- 2: Public Resolvable Private address
- 3: Random Resolvable Private address
Example:
w61/>ble_sec_unpair 40:82:7b:00:0b:bc 0 Unpair Device OK: Remote BD Addr: 40:82:7B:00:0B:BC Addr Type: 0 BLE disconnected -> BLE DISCONNECTED.
- ble_bonded_device_list
This command lists remote Bluetooth® Low Energy paired devices.
Example:
w61/>ble_bonded_device_list Get Bonded Device List: Device 1: BD Addr: 40:82:7B:00:0B:BC BD Addr type: 0 LTK: ca4d4e744ce760bb313175091af03052
- ble_set_gap_appearance < Appearance Value [0; 0xffff] >
This command sets the Bluetooth® Low Energy GAP appearance value.
3.4.5. Network commands
- ping < hostname > [ -c count [1; max(uint16_t) - 1] ] [ -s size [1;10000] ] [ -i interval [100;3500] ] [ -t timeout [100; 3500] ]
This command pings the specified IP address or URL.
| Option | Description |
|---|---|
| Mandatory | |
|
hostname |
The IP address, in the format x.x.x.x, or a valid URL to ping. |
| Optional | |
|
-c count |
This option specifies the number of ping iterations to execute. If no value is set, the default value is 4. Valid range: [1; max(uint16_t) - 1] |
|
-s size |
This option specifies the size (in bytes) of the ping to send. The default value is 64 bytes. Valid range: [1;10000] |
|
-i interval |
This option specifies the interval (in milliseconds) between pings. The default value is 1000 ms. Valid range: [100;3500] |
| -t timeout | This option specifies the waiting time for the ping response (in milliseconds). The timeout is automatically adjusted so that it is not smaller than the interval value. The default value is 1000 ms. |
Example:
w61/>ping www.google.com -c 5 5 packets transmitted, 5 received, 0% packet loss, time 65ms
w61/>ping www.google.com -c 5 -s 256 -i 200 5 packets transmitted, 5 received, 0% packet loss, time 111ms
- ping6 < hostname > [ -c count [1; max(uint16_t) - 1] ] [ -s size [1;10000] ] [ -i interval [100;3500] ] [ -t timeout [100; 3500] ]
This command is available only in the ST67W6X_CLI_LWIP project for IPv6 pinging. The parameters are the same as those described above.
- net_dhcp [ 0:DHCP disabled; 1:DHCP enabled ] [ 1:STA only; 2:AP only; 3:STA + AP ] [ lease_time [1; 2880] ]
This command starts or stops the DHCP client (for the station) and/or the DHCP server for the soft-AP.
The lease time parameter specifies the duration for which an IP address is reserved for the station by the DHCP server. The default value of the lease time is 120 minutes, range: [1;2880]
Example:
w61/>net_dhcp DHCP STA STATE : 1 DHCP AP STATE : 0 DHCP AP RANGE : [192.168.8.2 - 192.168.8.101] DHCP AP LEASE TIME : 120
Enable DHCP server for soft-AP and specify new lease time.
w61/>net_dhcp 1 3 150 DHCP configuration succeed w61/>net_dhcp DHCP STA STATE : 1 DHCP AP STATE : 1 DHCP AP RANGE : [192.168.8.2 - 192.168.8.101] DHCP AP LEASE TIME : 150
- net_ap_ip
This command displays the soft-AP IP address and netmask. The IP address can be modified only via a define in the "ST67W6X/Target/w6x_config.h" file. The netmask value is hardcoded.
Example:
w61/>net_ap_ip Soft-AP IP address : 10.19.96.1 Netmask : 255.255.255.0
- net_sta_dns [ DNS1 addr ] [ DNS2 addr ] [ DNS3 addr ]
This command sets or reads the DNS configuration of the station.
Example:
w61/>net_sta_dns 1.2.3.4 5.6.7.8 12.23.34.45 DNS configuration set successfully w61/>net_sta_dns DNS1 IP : 1.2.3.4 DNS2 IP : 5.6.7.8 DNS3 IP : 12.23.34.45
- net_sta_ip [ IP addr ] [ Gateway addr ] [ Netmask addr ]
This command sets or reads the IP address of the station. The accepted format for the IP address is: x.x.x.x
If IPv6 is enabled, IPv6 addresses of the station can be read.
Examples:
w61/>net_sta_ip STA IP : IP : 192.168.8.138 Gateway : 192.168.8.1 Netmask : 255.255.255.0 IPv6 link-local : fe80::4282:7bff:fe00:e6a IPv6 global 1 : 2a01:cb1d:b02:bf00:4282:7bff:fe00:e6a IPv6 global 2 : not assigned
Set only the device IP address:
w61/>net_sta_ip 192.168.235.9 [WARN] [1945368] [shell_task] (w61_at_net.c:322) Gateway IP NULL or invalid. Previous one will be use. [WARN] [1945368] [shell_task] (w61_at_net.c:322) Netmask IP NULL or invalid. Previous one will be use. STA IP configuration set successfully
Set device and gateway IP addresses:
w61/>net_sta_ip192.168.235.9 192.168.235.13 [WARN] [1945368] [shell_task] (w61_at_net.c:322) Netmask IP NULL or invalid. Previous one will be use. STA IP configuration set successfully
Set device, gateway and netmask IP addresses:
w61/>net_sta_ip192.168.235.9 192.168.235.13 255.255.255.0 STA IP configuration set successfully
The gateway and netmask addresses cannot be modified alone.
If the device is not connected to any AP:
w61/>net_sta_ip [ERROR] [2035708] [shell_task] (w6x_net.c:442) Station is not connected. Connect to an Access Point before querying IPs Get STA IP error
- time < timezone : UTC format : range [-12; 14] or HHmm format : with HH in range [-12; +14] and mm in range [00; 59] >
This command returns the time from a predefined SNTP server. The <timezone> parameter of the command is used to configure the time zone.
The time zone must be set in one of the following two formats:
- With UTC format: range [-12,14], representing most time zones as whole-hour offsets from UTC
- With HHmm format: with HH in range [-12, +14] and mm in range [00,59]
Example: After a successful connection to an access point connected to the Internet:
w61/>time 1 Time: Tue Oct 29 17:52:40 2024
or
w61/>time 100 Time: Tue Oct 29 17:52:40 2024
- dnslookup < hostname >
This command returns the IP address related to the hostname using the DNS service.
Example:
w61/>dnslookup www.google.com IP address: 142.250.185.132
- net_hostname [ hostname ]
This command sets/reads the name of the station, which is displayed on the terminal of the access point (AP) to which the station is connected.
Example:
w61/>net_hostname ST67W61_WiFi_device Host name set successfully w61/>net_hostname Host name : ST67W61_WiFi_device
3.4.6. MQTT commands
- mqtt_configure < -s Scheme > < -i ClientId > [ -u <Username> ] [ -pw <Password> ] [ -c <Certificate> ] [ -k <PrivateKey> ] [ -ca <CACertificate> ] [ -sni ] [ -ka <KeepAlive> ] [ -q <LWT_QoS> ] [ -cs ] [ -r ]
This command configures the client setup for the chosen MQTT broker.
| Option | Description |
|---|---|
| Mandatory | |
| -s Scheme | Set the security level: 0: MQTT over TCP 1: MQTT over TLS with password 2: MQTT over TLS with server certificate (CA) 3: MQTT over TLS with client certificate 4: MQTT over TLS with server/client certificate. |
| -i ClientId | The client ID must be unique on the broker. |
| Optional | |
| -u Username | This option specifies the username. It must be defined in the MQTT broker configuration. |
| -pw Password | This option specifies the password related to the username. |
| -c Certificate | This option specifies the client certificate filename. (*) |
| -k PrivateKey | This option specifies the client key filename. (*) |
| -ca CaCertificate | This option specifies the certificate authority filename of the server. (*) |
| -sni sni | This option configures the server name indication. Can be specified in the certificate content or aligned to the host name. |
| -ka <KeepAlive> | This option specifies the MQTT ping timeout, range [1;2700]. (**) |
| -q <LWT_QoS> | This option specifies the QoS of the published message, which can be set to 0, 1, or 2. The default is 0. (**) |
| -cs | This option specifies whether the session must be clean. (**) |
| -r | This option specifies whether data must be retained by the broker. (**) |
(*) The file must exist in the file system of the host or the ST67W611M1.
(**) For more information about those parameters, refer to the WiFi MQTT wiki page.
- mqtt_connect < -h Host > < -p Port >
This command connects to an MQTT broker or displays the connection status.
| Option | Description |
|---|---|
| Mandatory | |
| -h Host | The address of the MQTT broker to connect. |
| -p Port | The port number of the MQTT broker. |
Example:
w61/>mqtt_configure -s 0 -i ST67W6X_772 MQTT Configure OK w61/>mqtt_connect -h "broker.hivemq.com" -p 1883 MQTT Connect OK w61/>mqtt_connect MQTT Connect State: Connected MQTT Connect Host: broker.hivemq.com MQTT Connect Port: 1883 MQTT Connect ClientId: ST67W6X_772
- mqtt_disconnect
This command disconnects from the MQTT broker.
Example:
w61/>mqtt_disconnect MQTT Disconnect OK
- mqtt_publish < Topic > < Message > [ -q Qos ] [ -r ]
This command publishes the <Message> to the <Topic> to which the MQTT client is connected.
The topic format must be defined as follows (maximum 100 characters):
"/topic_level1/topic_level2"
The message format must be defined as follows (JSON structure recommended):
"{\"timestamp\": \"20201121085253\", \"temperature\": 20.0, \"humidity\": 50.0, \"pressure\": 1000.0}"
Example:
w61/>mqtt_publish "/sensors/mySTM32_772" "\"{\"timestamp\": \"20201121085253\", \"other_field\": \"hello world\" }\""
MQTT Publish OK
The two options -q <Qos> and -r refer respectively to the QoS of the published message, which can be set to 0, 1, or 2, and to the retain flag.
- mqtt_subscribe < Topic >
This command subscribes to a specific <Topic> or prints the list of subscribed topics.
Example:
w61/>mqtt_subscribe "/sensors/mySTM32_772" MQTT Subscribe OK
When a message from a subscribed topic is received,
<INF> 93230 [AtRxParser] MQTT Subscription Received on topic: "/sensors/mySTM32_772" : \"{\"timestamp\":\"20201121085253\",\"other_field\":\"hello world\"}\ (main_app.c:225)
- mqtt_unsubscribe < Topic >
This command unsubscribes from a specific <Topic>.
Example:
w61/>mqtt_unsubscribe "/sensors/mySTM32_772" MQTT Unsubscribe OK
3.4.7. FOTA commands
- fota_http < server IP > < server port > < ST67 resource URI > [ STM32 resource URI ] [ FOTA header resource URI ]
This command downloads a binary file to update the network co-processor (ST67W611M1) firmware. The binary file must be uploaded to an HTTP server.
| Option | Description |
|---|---|
| Mandatory | |
| <server IP> | The IP address of the server to connect to; it can be a domain name in www.something.com format.
|
| <server port> | The port number of the server. |
| <ST67 resource URI> | The URI of the ST67 binary file to download. |
| Optional | |
| [STM32 resource URI] | The URI of the STM32 binary file to download (only applies to NUCLEO-U575ZI-Q project) |
| [FOTA header resource URI] | The URI of the FOTA header file in JSON format to download (only applies to NUCLEO-U575ZI-Q project) |
Example:
w61/>fota_http 192.168.8.104 8000 /download/STM32U575ZI_NUCLEO/st67.bin.ota /download/STM32U575ZI_NUCLEO/fota_ST67W6X_CLI.bin /download/STM32U575ZI_NUCLEO/ST67W611_STM32U575ZI_NUCLEO.json
3.4.8. Applicative commands
- info_app
This command returns the host firmware name and version.
Example:
w61/>info_app --------------- Host info --------------- Host FW Version: 1.2.0 Host FW Name: ST67W6X CLI
- quit
This command is used to exit the console, return to the main application, and terminate the code.
- iperf [ options ]
| Option | Description |
|---|---|
| Mandatory | |
|
-c <server_addr> |
Run in client mode (to test TX) |
| -s | Run in server mode (to test RX) |
| Optional | |
|
-u |
This option specifies if UDP should be used. If not used, TCP is used for the test. |
|
-p <Port> |
This option specifies the port to connect to (if -c is used) or to open (if -s is used). Default is 5001 |
|
-i <Interval> |
This option specifies the interval (in seconds) between bandwidth reports. |
|
-l <Length> |
This option specifies the read/write buffer size. |
|
-t <Time> |
This option specifies the duration of the test. Default is 10 seconds. |
| -b <Bandwidth> | Bandwidth to send in Mbps (for UDP only) |
| -S <TOS> | TOS |
| -n <MB> | Number of Mbyte to send and receive |
| -P <Priority> | Traffic task priority |
| -d <Dual Mode> | Dual mode |
| -a | Abort running iperf |
For detailed information on the throughput evaluation, refer to How to measure Wifi throughput.
- echo [ iteration ]
This command launches an echo sequence to an echo server at IP address 45.79.112.203, repeating the sequence the number of times specified by the [iteration] parameter.
- echostart < port >
This command starts the UDP echo server on the specified port.
- echostop
This command stops the UDP echo server.
- task_perf [ -s ]
This command starts and stops the task cycle counter using the [ -s ] option. The counter results can be displayed with the task_report command.
- task_report
This command displays two arrays.
The first array is enabled by the task_perf command. It displays the number of cycles registered since the last "task_perf" command was submitted, unless it has been stopped.
The second array, which is always present, displays the status of the different tasks, including their state (running, stopped, blocked), priority, available free memory in each task stack, and index.
Example:
w61/>task_report ### Task Performance report CPU Freq 160 Mhz thread id name cycles time (ms) ------------------------------------------------------- thread #0 shell_task 432508 2 thread #1 OutputTask 192507 1 thread #2 IDLE 3463043985 21644 thread #3 defaultTas 12949220 80 thread #4 spi_xfer_e 135437 0 thread #5 Tmr Svc 105065 0 thread #6 Modem_Proc 525646 3 ------------------------------------------------------- Total 3477384368 21733 ### Task Performance report end Task State Prio Free(u32) Index ******************************************** shell_task X 5 184 6 IDLE R 0 107 3 defaultTask B 24 98 2 Tmr Svc B 55 93 4 Modem_Process B 54 300 8 spi_xfer_engine B 53 120 7 OutputTask S 25 22 5 ST67W6XTask B 24 676 1 FOTA task B 24 318 9
3.5. Memory footprint
| Module | Description |
|---|---|
| [Driver] HAL/CMSIS/BSP | STM32 CMSIS Cortex, HAL and LL, Board Specific Package drivers |
| [Project] Core | Native STM32 core components |
| [Project] App | Main part of the application |
| [Project] Target | Configuration files for ST67W6X_Network_Driver component |
| [MW] ST67W6X_Network_Driver | Core and API System, Wi-Fi®, Bluetooth® Low Energy, Network, HTTP and MQTT components Util/Shell: Utility to manage the API through the serial interface Util/Logging: Utility to process shell and trace messages onto the UART interface (can be changed by ITM) Util/Performance: iperf, memory allocation report, task usage utilities |
| [MW] FreeRTOS | FreeRTOS kernel source |
| [MW] LittleFS | LittleFS file system |
| [Utility] lpm | Tiny low-power management |
| [Toolchain] Startup | Int_vect, init routines, init table, CSTACK and HEAP |
| [Toolchain] EWARM Libraries | Native compiler libraries |
These values depend on the chosen toolset, and they can change in future releases.
3.5.1. ROM/flash memory footprint
The picture below shows the total read-only memory (flash) used by ST67W6X_CLI and ST67W6X_CLI_LWIP applications.
The picture below shows the middleware ST67W6X_Network_Driver read-only memory (flash) used by ST67W6X_CLI and ST67W6X_CLI_LWIP applications.
3.5.2. Read-write (RW) memory footprint
The picture below shows only the sum of the static read/write memory (static RAM) of the ST67W6X_CLI and ST67W6X_CLI_LWIP applications.
4. References