This article introduces the Wi-Fi automatic recovery feature as well as how to enable and verify it on RW61x SDK.
Wi-Fi automatic recovery is a NXP proprietary feature that monitors Wi-Fi running status and recovers Wi-Fi out of exception state when running into one of the following cases:
Once Wi-Fi automatic recovery is triggered, Wi-Fi middleware and driver will clean up the running states, reset Wi-Fi MCU power, reload Wi-Fi firmware and restart Wi-Fi initialization. It will not impact the ongoing Bluetooth LE/802.15.4 activities.
Figure 1 is the Wi-Fi software architecture.
Figure 1: Wi-Fi Software Architecture
Figure 2 shows the work flow of Wi-Fi automatic recovery:
Figure 2: Wi-Fi Automatic Recovery Work Flow
The Wi-Fi automatic recovery feature is not enabled by default in RW61x SDK. It needs to be enabled explicitly:
Besides, please also make sure the "CONFIG_WIFI_RESET" macro is defined as "1" in the SDK.
This section introduces how to verify the Wi-Fi automatic recovery feature on RW61x SDK.
wifi_cli application is used as example here together with the RW612 RD board. Refer to UM11799: NXP Wi-Fi and Bluetooth Demo Applications for RW61x for steps to flash and run Wi-Fi applications.
Below are the steps to verify the Wi-Fi automatic recovery feature:
Step 1: Define CONFIG_WIFI_RECOVERY in wifi_cli/source/wifi_config.h
#define CONFIG_WIFI_RECOVERY 1
Step 2: Build and flash the wifi_cli application onto RW612 RD board
Step 3: Connect RW612 RD board to a serial terminal
Step 4: Reset the power of RW612 RD board
Step 5: Trigger Wi-Fi MCU into hung-up state with the following command to mimic a command timeout
# wlan-recovery-test
Step 6: Wi-Fi recovery background task detects Wi-Fi FW hang and starts recovery process
[wifi] Warn: Command response timed out. command 0x8b, len 12, seqno 0x1c
timeout happends.
# app_cb: WLAN: FW hang Event: 14
--- Disable WiFi ---
[wifi] Warn: Recovery in progress. command 0x10 skipped
[wifi] Warn: Recovery in progress. command 0x10 skipped
[wifi] Warn: Recovery in progress. command 0xaa skipped
[dhcp] Warn: server not dhcpd_running.
--- Enable WiFi ---
Initialize WLAN Driver
[wifi] Warn: WiFi recovery mode done!
Wi-Fi cau temperature : 31
STA MAC Address: C0:95:DA:01:1D:A6
board_type: 2, board_type mapping:
0----QFN
1----CSP
2----BGA
app_cb: WLAN initialized
========================================
WLAN CLIs are initialized
========================================
ENHANCED WLAN CLIs are initialized
========================================
HOST SLEEP CLIs are initialized
========================================
CLIs Available:
========================================
help
clear
wlan-version
wlan-mac
wlan-thread-info
wlan-net-stats
wlan-set-mac <MAC_Address>
wlan-scan
wlan-scan-opt ssid <ssid> bssid ...
wlan-add <profile_name> ssid <ssid> bssid...
wlan-remove <profile_name>
wlan-list
wlan-connect <profile_name>
wlan-connect-opt <profile_name> ...
wlan-reassociate
wlan-start-network <profile_name>
wlan-stop-network
wlan-disconnect
wlan-stat
wlan-info
wlan-address
wlan-uap-disconnect-sta <mac address>
wlan-get-uap-channel
wlan-get-uap-sta-list
wlan-ieee-ps <0/1>
wlan-set-ps-cfg <null_pkt_interval>
wlan-deep-sleep-ps <0/1>
wlan-get-beacon-interval
wlan-get-ps-cfg
wlan-set-max-clients-count <max clients count>
wlan-get-max-clients-count
wlan-rts <sta/uap> <rts threshold>
wlan-frag <sta/uap> <fragment threshold>
wlan-host-11k-enable <0/1>
wlan-host-11k-neighbor-req [ssid <ssid>]
wlan-host-11v-bss-trans-query <0..16>
wlan-mbo-enable <0/1>
wlan-mbo-nonprefer-ch <ch0> <Preference0: 0/1/255> <ch1> <Preference1: 0/1/255>
wlan-get-log <sta/uap> <ext>
wlan-roaming <0/1> <rssi_threshold>
wlan-multi-mef <ping/arp/multicast/del> [<action>]
wlan-wakeup-condition <mef/wowlan wake_up_conds>
wlan-auto-host-sleep <enable> <mode> <rtc_timer> <periodic>
wlan-send-hostcmd
wlan-ext-coex-uwb
wlan-set-uap-hidden-ssid <0/1/2>
wlan-eu-crypto-rc4 <EncDec>
wlan-eu-crypto-aes-wrap <EncDec>
wlan-eu-crypto-aes-ecb <EncDec>
wlan-eu-crypto-ccmp-128 <EncDec>
wlan-eu-crypto-ccmp-256 <EncDec>
wlan-eu-crypto-gcmp-128 <EncDec>
wlan-eu-crypto-gcmp-256 <EncDec>
wlan-set-antcfg <ant_mode> <evaluate_time> <evaluate_mode>
wlan-get-antcfg
wlan-scan-channel-gap <channel_gap_value>
wlan-wmm-stat <bss_type>
wlan-reset
wlan-set-regioncode <region-code>
wlan-get-regioncode
wlan-11d-enable <sta/uap> <0/1>
wlan-uap-set-ecsa-cfg <block_tx> <oper_class> <new_channel> <switch_count> <bandwidth>
wlan-csi-cfg
wlan-set-csi-param-header <sta/uap> <csi_enable> <head_id> <tail_id> <chip_id> <band_config> <channel> <csi_monitor_enable> <ra4us>
wlan-set-csi-filter <opt> <macaddr> <pkt_type> <type> <flag>
wlan-txrx-histogram <action> <enable>
wlan-subscribe-event <action> <type> <value> <freq>
wlan-reg-access <type> <offset> [value]
wlan-uapsd-enable <uapsd_enable>
wlan-uapsd-qosinfo <qos_info>
wlan-uapsd-sleep-period <sleep_period>
wlan-tx-ampdu-prot-mode <mode>
wlan-rssi-low-threshold <threshold_value>
wlan-rx-abort-cfg
wlan-set-rx-abort-cfg-ext enable <enable> margin <margin> ceil <ceil_thresh> floor <floor_thresh>
wlan-get-rx-abort-cfg-ext
wlan-cck-desense-cfg
wlan-net-monitor-cfg
wlan-set-monitor-filter <opt> <macaddr>
wlan-set-monitor-param <action> <monitor_activity> <filter_flags> <radio_type> <chan_number>
wlan-set-tsp-cfg <enable> <backoff> <highThreshold> <lowThreshold> <dutycycstep> <dutycycmin> <highthrtemp> <lowthrtemp>
wlan-get-tsp-cfg
wlan-get-signal
wlan-set-bandcfg
wlan-get-bandcfg
wlan-set-ips <option>
wlan-enable-disable-htc <option>
wlan-set-su <0/1>
wlan-set-forceRTS <0/1>
wlan-set-mmsf <enable> <Density> <MMSF>
wlan-get-mmsf
wlan-set-multiple-dtim <value>
wlan-set-country <country_code_str>
wlan-set-country-ie-ignore <0/1>
wlan-single-ant-duty-cycle <enable/disable> [<Ieee154Duration> <TotalDuration>]
wlan-dual-ant-duty-cycle <enable/disable> [<Ieee154Duration> <TotalDuration> <Ieee154FarRangeDuration>]
wlan-external-coex-pta enable <PTA/WCI-2/WCI-2 GPIO> ExtWifiBtArb <enable/disable> PolGrantPin <high/low> PriPtaInt <enable/disable> StateFromPta <state pin/ priority pin/ state input disable> SampTiming <Sample timing> InfoSampTiming <Sample timing> TrafficPrio <enable/disable> CoexHwIntWic <enable/disable>
wlan-sta-inactivityto <n> <m> <l> [k] [j]
wlan-get-temperature
wlan-auto-null-tx <sta/uap> <start/stop>
wlan-detect-ant <detect_mode> <ant_port_count> channel <channel> ...
wlan-recovery-test
wlan-get-channel-load <set/get> <duration>
wlan-get-txpwrlimit <subband>
wlan-set-chanlist
wlan-get-chanlist
wlan-set-txratecfg <sta/uap> <format> <index> <nss> <rate_setting> <autoTx_set>
wlan-get-txratecfg <sta/uap>
wlan-get-data-rate <sta/uap>
wlan-get-pmfcfg
wlan-uap-get-pmfcfg
wlan-set-ed-mac-mode <interface> <ed_ctrl_2g> <ed_offset_2g> <ed_ctrl_5g> <ed_offset_5g>
wlan-get-ed-mac-mode <interface>
wlan-set-tx-omi <interface> <tx-omi> <tx-option> <num_data_pkts>
wlan-set-toltime <value>
wlan-set-rutxpwrlimit
wlan-11ax-cfg <11ax_cfg>
wlan-11ax-bcast-twt <dump/set/done> [<param_id> <param_data>]
wlan-11ax-twt-setup <dump/set/done> [<param_id> <param_data>]
wlan-11ax-twt-teardown <dump/set/done> [<param_id> <param_data>]
wlan-11ax-twt-report
wlan-get-tsfinfo <format-type>
wlan-set-clocksync <mode> <role> <gpio_pin> <gpio_level> <pulse width>
wlan-suspend <power mode>
ping [-s <packet_size>] [-c <packet_count>] [-W <timeout in sec>] <ipv4/ipv6 address>
iperf [-s|-c <host>|-a|-h] [options]
dhcp-stat
========================================
--- Done ---
Step 7: Run other Wi-Fi shell commands to confirm Wi-Fi resumes to normal state