Dear Toradex community,
I have a strange behavior with Wi-Fi on a Colibri iMX6ULL 512MB WB IT.
I am getting the following timeout error:
Selected interface 'mlan0'[ 6924.670946] ieee80211 phy0: sched scan stop!
'SCAN' command timed out.
root@Checkbox20-00001:~# [ 6934.890375] mwifiex_sdio mmc1:0001:1: mwifiex_cmd_timeout_func: Timeout cmd id = 0x6b, act = 0x1
[ 6934.899317] mwifiex_sdio mmc1:0001:1: num_data_h2c_failure = 0
[ 6934.905210] mwifiex_sdio mmc1:0001:1: num_cmd_h2c_failure = 0
[ 6934.911010] mwifiex_sdio mmc1:0001:1: is_cmd_timedout = 1
[ 6934.916458] mwifiex_sdio mmc1:0001:1: num_tx_timeout = 0
[ 6934.921820] mwifiex_sdio mmc1:0001:1: last_cmd_index = 1
[ 6934.927186] mwifiex_sdio mmc1:0001:1: last_cmd_id: 0c 01 6b 00 af 00 10 00 28 00
[ 6934.934640] mwifiex_sdio mmc1:0001:1: last_cmd_act: 01 00 01 00 00 00 01 00 13 00
[ 6934.942173] mwifiex_sdio mmc1:0001:1: last_cmd_resp_index = 0
[ 6934.947973] mwifiex_sdio mmc1:0001:1: last_cmd_resp_id: 0c 81 b2 80 af 80 10 80 28 80
[ 6934.955853] mwifiex_sdio mmc1:0001:1: last_event_index = 4
[ 6934.961389] mwifiex_sdio mmc1:0001:1: last_event: 58 00 76 00 0b 00 0a 00 65 00
[ 6934.968753] mwifiex_sdio mmc1:0001:1: data_sent=0 cmd_sent=0
[ 6934.974465] mwifiex_sdio mmc1:0001:1: ps_mode=1 ps_state=0
[ 6934.992590] mwifiex_sdio mmc1:0001:1: PREP_CMD: FW is in bad state
[ 6934.998865] mwifiex_sdio mmc1:0001:1: Ignore scan. Card removed or firmware in bad state
[ 6935.007244] mwifiex_sdio mmc1:0001:1: scan failed: -14
[ 6935.016291] mwifiex_sdio mmc1:0001:1: ===mwifiex driverinfo dump start===
[ 6935.023303] mwifiex_sdio mmc1:0001:1: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p197)
[ 6935.031536] mwifiex_sdio mmc1:0001:1: SDIO register dump start
[ 6935.052365] mwifiex_sdio mmc1:0001:1: SDIO Func0 (0x0-0x9): 43 03 06 06 07 02 00 02 03 00
[ 6935.075065] mwifiex_sdio mmc1:0001:1: SDIO Func1 (0x10-0x17): 00 00 00 00 ff ff ff ff
[ 6935.091621] mwifiex_sdio mmc1:0001:1: SDIO Func1: (0x8) c3 (0x58) 00 (0x5c) 48 (0x5d) 00 (0x60) 07 (0x61) 0c (0x62) 00 (0x64) 10 (0x65) 00 (0x66) 00 (0x68) 00 (0x69) 00 (0x6a) 00
[ 6935.131047] mwifiex_sdio mmc1:0001:1: SDIO Func1 (0xe8-0xf2): dc fe 59 00 0e 00 00 a7 a7 01 70
[ 6935.248727] mwifiex_sdio mmc1:0001:1: SDIO Func1 (0xe8-0xf2): dc fe 66 00 19 00 00 a7 a7 01 70
[ 6935.257546] mwifiex_sdio mmc1:0001:1: SDIO register dump end
[ 6935.268555] mwifiex_sdio mmc1:0001:1: ===mwifiex driverinfo dump end===
[ 6935.278268] mwifiex_sdio mmc1:0001:1: == mwifiex firmware dump start ==
[ 6935.313857] mwifiex_sdio mmc1:0001:1: Fail to pull ctrl_data
[ 6935.319552] mwifiex_sdio mmc1:0001:1: firmware dump failed
[ 6935.330795] mwifiex_sdio mmc1:0001:1: == mwifiex dump information to /sys/class/devcoredump start
[ 6935.353814] mwifiex_sdio mmc1:0001:1: == mwifiex dump information to /sys/class/devcoredump end
[ 6935.362808] mwifiex_sdio mmc1:0001:1: PREP_CMD: FW is in bad state
[ 6935.369783] mwifiex_sdio mmc1:0001:1: info: shutdown mwifiex...
[ 6935.393153] mwifiex_sdio mmc1:0001:1: PREP_CMD: card is removed
[ 6935.399116] mwifiex_sdio mmc1:0001:1: PREP_CMD: card is removed
[ 6935.451598] mwifiex_sdio mmc1:0001:1: PREP_CMD: card is removed
[ 6935.552642] mmc1: card 0001 removed
[ 6935.712069] mmc1: new high speed SDIO card at address 0001
[ 6935.756962] Bluetooth: vendor=0x2df, device=0x9142, class=255, fn=2
[ 6936.785905] mwifiex_sdio mmc1:0001:1: info: FW download over, size 623240 bytes
[ 6937.630673] mwifiex_sdio mmc1:0001:1: WLAN FW is active
[ 6937.638402] btmrvl_sdio mmc1:0001:2: fail to parse irq_bt from device tree
[ 6937.691130] mwifiex_sdio mmc1:0001:1: Unknown api_id: 3
[ 6937.696380] mwifiex_sdio mmc1:0001:1: Unknown api_id: 4
[ 6937.701741] mwifiex_sdio mmc1:0001:1: Unknown GET_HW_SPEC TLV type: 0x217
[ 6937.821807] mwifiex_sdio mmc1:0001:1: info: MWIFIEX VERSION: mwifiex 1.0 (16.68.1.p197)
[ 6937.829920] mwifiex_sdio mmc1:0001:1: driver_version = mwifiex 1.0 (16.68.1.p197)
This error happens if the configured wifi-network is unavailable, the access point mode is disabled, and another command (like a wpa_cli scan or suspend command) is issued.
To reproduce this behavior:
- be sure that the access mode is not active , or even the hostapd-service is not running
hostapd_cli disable
Selected interface 'uap0'
OK
- create a hotspot on your smartphone
- connect to this hotspot
wpa_cli add_network
wpa_cli set_network 0 ssid '"Your-hotspot-ssid"'
wpa_cli set_network 0 psk '"Your-hotspot-passphrase"'
wpa_cli enable_network 0
wpa_cli save_config
- disable the hotspot on your smartphone
- after few seconds, if the wpa_state is SCANNING, perform another wpa_cli scan
- → the timeout occurrs
It seems that mwifiex blocks during the SCANNING stage so that the “sched scan stop!” times out. It doesn’t matter which command is used; every command that terminates the actual sched scan results in this timeout-error. Strangely enough, this error does not occur when the access point mode (hostapd) is active
My environment:
- Viola Plus carrier board
- Yocto-build as follows
Build Configuration:
BB_VERSION = "1.46.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "arm-tdx-linux-gnueabi"
MACHINE = "colibri-imx6ull"
DISTRO = "tdx-none"
DISTRO_VERSION = "5.7.0-devel-20220809070425+build.0"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard"
TARGET_FPU = "hard"
meta-toradex-nxp = "HEAD:ee63c90fde9fde0229bff9ac1c5cffe356fc4f41"
meta-freescale = "HEAD:c4347b507c2ba0d7eb3917303f83631244bf5048"
meta-freescale-3rdparty = "HEAD:88773cbb6367496b1a2ddca683afcd352be3cd58"
meta-toradex-tegra = "HEAD:f5753af4a5b9d33f0f474b320a74c2e29a66ec39"
meta-toradex-bsp-common = "HEAD:029a663150449a5e71b84dd4000476754d525c8c"
meta-oe
meta-filesystems
meta-initramfs
meta-networking
meta-multimedia
meta-python
meta-webserver = "HEAD:52cee67833d1975a5bd52e4556c4cd312425a017"
meta-freescale-distro = "HEAD:5d882cdf079b3bde0bd9869ce3ca3db411acbf3b"
meta-checkbox = "HEAD:770ccb49ac3d2a335a9e60da841f732c4885d566"
meta-qt5 = "HEAD:5ef3a0ffd3324937252790266e2b2e64d33ef34f"
meta-checkbox-distro = "HEAD:dddaf186eaa33ff6824018b00824f3e7724cb70c"
meta-poky = "HEAD:57d6803aaf475552a827d322d90d1f07ba73a97d"
meta = "HEAD:3f40d5f095ceb099b604750db96058df00fcd49e"
meta-rauc = "HEAD:2fe17af894b82cd2b0d0203478d4924fa916b440"
- wpa_supplicant.conf
cat /etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
config_methods=push_button
bgscan=""
network={
ssid="EMPhone"
psk="da4473sf339dr3"
}
- wpa_supplicant.service
cat /lib/systemd/system/wpa_supplicant.service
[Unit]
Description=WPA supplicant
Requires=sys-subsystem-net-devices-mlan0.device
After=sys-subsystem-net-devices-mlan0.device
Before=network.target
Wants=network.target
[Service]
Type=dbus
BusName=fi.w1.wpa_supplicant1
ExecStart=/usr/sbin/wpa_supplicant -c /etc/wpa_supplicant.conf -i mlan0 -u
[Install]
WantedBy=multi-user.target
Alias=dbus-fi.w1.wpa_supplicant1.service
Does anyone have an idea how to solve this problem?