WI-FI bring up ON SDIO Interface

 Share your knowledge. It’s a way to achieve immortality. –Dalai Lama

 

1. To know about the module ðŸ”‘

      DataSheet of wifi module will be helpful to know what pins should be configured and the block diagram will help to know regarding power  and clock source .

                                                         

WIFI bringup on SDIO Interface

                                            

WIFI bringup on SDIO Interface

Also please make sure we have host semantics regarding connection of wifi module on board

2.  SDIO Card detection 

if you are not getting below log in dmesg  then it means SDIO is not able to detect the wifi module. 

 

mmc2: new ultra high speed SDR104 SDIO card at address 0001

 

Then , please use below command to know  possible address of mmc

cat /proc/device-tree , you can see the physical address of the mmc .

 

WIFI bringup SDIO

here it shows that sdio is connected to rockchip processor in 0xffc70000 address. 

 

WIFI bringup SDIO

in dmesg you can see below kind of log 

 

kernel-log-wifi

use below command to confirm if mmc is detected successfully

cat /sys/kernel/debug/mmc1/ios

clock:          200000000 Hz

actual clock:   198000000 Hz

vdd:            21 (3.3 ~ 3.4 V)

bus mode:       2 (push-pull)

chip select:    0 (don't care)

power mode:     2 (on)

bus width:      2 (4 bits)

timing spec:    6 (sd uhs SDR104)

signal voltage: 0 (3.30 V)

driver type:    0 (driver type B) 

If Not , Mostly you need to check the HW connection , soldering , SDIO clock frequency and so on .  we can try to lower the sdio clock to 50 Mhz  from 200Mhz to debug. 

3. WIFI ON ❓❓❓

We should get below kind of diagram in oscilloscope .
Please check WIFI Module data sheet.

WIFI Power Sequence

from power sequence its clear that wl_reg_on should be transition low to high, make sure its happening .below kind of device tree will be available to configure SDIO interface and wl_reg_on , Mother board schematics review should be done to confirm each pin working.

 

WL_REG_ON

this will show  the below kind of log for wl_reg_on

 

WL REG ON KERNEL LOG



check the device tree and power sequence entry to make sure connections are fine , also hw validation is required for the clock and power to confirm if connection works fine

 

4.  Driver and Firmware

After this steps you can check if driver is compiled for the module is loaded on target or not. check the driver compilation and .ko file generation . use insmod command to load the driver .

 

firmware is required for wlan module . example broadcom module need nvram.bin and config files for configure wlan . below kind of log can be observed in dmesg (Example of Broadcom WIFI driver)


WIFI DRIVER LOG

after successfully completion of loading driver and firmware you can  see ifconfig command to  check if wlan interface is created or not. . wifi works in AP (STA) and network mode . iwconfig command output can be checked to verify the AP and NW mode details. check hostapd.conf for STA mode and wpa_supplicant.conf for NW mode .

iw dev wlan0 scan | grep SSID 

if  we get the scan result with this it means wifi is working :) , If Not please check the latest stable driver for the module then port .

ifconfig -a 

command to check if driver is loaded and wlanx interface is created or not 

ifconfig output wlan0


iwconfig command will give information regarding bit rate , STA or Network mode also frequency , channel of wifi .

iwconfig  wlan0 output


5.  Testing 

Throughput of wifi can be checked with iperf command . to check the Rx throughput make module as iperf server and for Tx make device iperf client . iperf3 having so many feature for debugging tcp ip protocol side as well .

 

Iperf Test setup


Device as Server 

iperf Device as server


Device  as client 

 

Iperf device as client

Output 


 

iperf output analysis


iperf graph analysis

It is suggested to check Tx power and rssi value if fluctuation seen on throughput . Antenna shorting and quality also play big role .

6. Issues 

1. "WIFI does not show in AP list OR show in one laptop not others"

        check the clock and frequency tx power and rssi .it may also module issue 

2. AP- STA mode issues

For all the issue related to hostapd you can check by running hostapd command with -d option and dmesg log.
hostapd -d -B path_for_hostapd.conf  and confirm if hostapd process is running by ps _aef | grep hostapd

hosapd  checking


 

Lets Say that we can not see hostapd running on the device then we need to check our compiled kernel ko has been compiled with every dependency .. sometimes external compilation and linking may also trigger this kind of issue .

 

Hope This post will help reader to give idea to bringup wifi . In this blog i tried to update issues which I encounter also tried every information related to wifi sdio in single place .

 

                                                           Thank You :)

 

 


Comments