高通 wlan 调试总结随笔
发布日期:2021-06-29 14:52:11 浏览次数:2 分类:技术文章

本文共 6278 字,大约阅读时间需要 20 分钟。

高通 wlan 调试总结随笔

最近也分析了一个高通wifi,bt 没用的问题,

注意分析过程中,高度和硬件或射频同事保持密切联系,多去骚扰他们。
因为,高通wifi/bt 相关的,只要硬件及高通固件没问题,基本不会出现无功能的问题。

最终我这个问题也是终过射频同事确认,物料贴错了,导致wifi 功率起不来,

解决这个问题后,bt 的问题买一送一,连同wifi问题一并ok 了。

下面总结一些抓取wifi log 及调试的一些方法:

1. 进入ftm模式

射频同事调试wifi 时,需要进入ftm 模式,才能连接上QRCT 工具,进入ftm 模式有如下两种方法:

方法一:

adb root adb remountadb shell ifconfig wlan0 upadb shell "echo 5 > sys/module/wlan/parameters/con_mode"    (详细哪个目录不记得了,find 找下 con_mode_ftm 就好了)adb shell ftmdaemon -n -ddpause

方法二:

adb root && adb wait-for-devicesadb shell rmmod wlanadb shell insmod /vendor/lib/modules/qca_cld3_wlan.ko con_mode_ftm=5adb shell ifconifg wlan0 upadb shell ftmdaemon -n -dd

有关ftm更多知识,也可以参考高通文档

《80-wl521-103_g_qca639x_wcn685x_wlan_software_user_guide.pdf》
《80-ya512-15_p_wlan_ftm_for_wcn39xx_tlv2_commands_user_guide.pdf》
《80-wl521-103_g_qca639x_wcn685x_wlan_software_user_guide.pdf》
《kba-170509183004_7_how_to_collect_wifi_logs_for_debug》

2. 抓取wifi log

2.1 抓取 Android log

2.1.1 How to enable wifi verbose log?

Goto Settings-> About Phone -> BuildNumber (Click this 10 times) to activate development options.

Goto Settings -> Develop Options -> Enable Wifi Verbose logging

adb shell logcat -v threadtime >logcat.txt

2.1.2 How to collect adb log and kernel log in one file?

adb shell logcat-v time -f /dev/kmsg | adbshell cat /proc/kmsg | tee kernel_logcat.txt

2.1.3 How to open wpa_supplicant debug log?

Run the following command before collect adb logs

wpa_cli ifname=wlan0 log_level debug

If failed to run above command on some platform, try command:

wpa_cli -iwlan0 -p /data/misc/wifi/sockets log_level DEBUG

enum {
MSG_EXCESSIVE, MSG_MSGDUMP, MSG_DEBUG, MSG_INFO, MSG_WARNING, MSG_ERROR};

2.2 抓取 Tcpdump

tcpdump -i <interface> -vv -w <dump_file>

Ex: tcpdump -i wlan0 -vv -w tcpdump_000.pcap

2.3 抓取 wifi driver log & FW log - for WCN36xx

Snapdragon platform with WCN36xx chipset attached

Read doc 80-Y0513-2 , section 2.4.6

2.3.1 collect QXDM logs - for MSM8909

open QXDM

Press F1, pop up Log view windows
In Log view window, click right button
In popup menu, choose configure …, pop up configure window
In popup configure window, choose Message packets , in right column, select all WLAN options.

2.3.2 collect text format logs

  1. make sure WCNSS_qcom_cfg.ini and cnss_diag.conf configured properly

    Enable fw logging: gEnableFWLogging=1

    Continuously send firmware logs to the host even if the host is suspended:

    gEnableContFWLogging=1

  1. make sure cnss_diag is running

    cnss_diag -q -f
    Then pull logs from /data/vendor/wifi/wlan_logs/

  2. Log file size and archives. Set In /data/misc/wifi/cnss_diag.conf

  3. Open more logs

    iwpriv wlan0 dump 211 32 1//open more RA debug log
    iwpriv wlan0 dump 13 6 6 1 //open more CxM log

2.4 抓取 wifi driver log & FW log - for WCN39xx

2.4.1 collect text format logs

  1. make sure WCNSS_qcom_cfg.ini and cnss_diag.conf configured properly

    WCNSS_qcom_cfg.ini : gEnablefwlog=1 // by default

  2. make sure cnss_diag is running

    cnss_diag -q -f
    Then pull logs from /data/vendor/wifi/wlan_logs/

  3. Log file size and archives. Set In /data/misc/wifi/cnss_diag.conf, default config is

    MAX_LOG_FILE_SIZE = 30
    MAX_ARCHIVES = 2

  4. Open more logs

    Open more BTC logs:
    adb shell iwpriv wlan0 setUnitTestCmd 4 2 11 1
    adb shell iwpriv wlan0 setUnitTestCmd 4 2 12 1

2.5 抓取 wifi driver log & FW log - for QCA639x

Please refer the “2 WLAN logging” in " 80-wl521-103 qca639x_wlan_software_user_guid"

2.5.1 collect QXDM logs

  1. Turn on the Wi-Fi once

    MHI cannot be created unless an initial Wi-Fi is on

  2. Connect the device with a local machine

  3. Create folders in /sdcard/

    adb shell
    cd sdcard
    mkdir /diag_logs
    cd diag_logs
    mkdir /mdm2

  4. Push the golden cfg to two folders

  5. adb push Diag.cfg /sdcard/diag_logs/mdm2/Diag.cfg (for WLAN FW)

  6. adb push Diag.cfg /sdcard/diag_logs/Diag.cfg (for WLAN Host)

  7. To start logs:

    adb shell "nohup diag_mdlog -j 5 -s 30 -n 3 &"
    WLAN host file is created under mdm2/
    WLAN FW file is created under /sdcard/diag_logs/[result location]/mdm2

    "nohup" will prevent to kill the diag_mdlog process without USB connection

    -s means the size of a file (MB).
    -n means the total number of log files for each module

  8. Duplicate a Wi-Fi issue (with or without USB conection)

  9. To stop logs: adb shell diag_mdlog -k -j 5

    -k means “kill”

  10. Pull logs from /sdcard/diag_logs/[result location]/mdm2

2.5 Collect pktlog

2.5.1 Snapdragon platform with WCN39xx chipset attached

  1. Force enable mode

    Stop capturing the pktlog: iwpriv wlan0 pktlog 0 (to discard older logs)
    Enable the pktlog:iwpriv wlan0 pktlog 1

    Sleep <arbitrary time of preference>

    Stop capturing the pktlog:iwpriv wlan0 pktlog 0
    Take the snapshot of current pktlog in the buffer: cat /proc/ath_pktlog/cld > /data/<filename1>.dat
    Pull the capture: adb pull /data/<filename1>.dat <filename2>.dat
    Restore the pktlog to its original state: iwpriv wlan0 pktlog 2

  2. Auto enable mode

    INI parameter: gEnablePacketLog=1

    Flush pktlog

    Developer options -> Take bug report > Interactive report. Once reporting the bugreport is done and
    the device makes beep sound, the pktlog will be flushed and logged in /sdcard/wlan_logs
    Or run "adb bugreport >bugreport.txt". Once reporting the bugreport is done and the device makes
    beep sound, the pktlog will be flushed and logged in /sdcard/wlan_logs

    Pktog file size and archives. In In /data/misc/wifi/cnss_diag.conf, default config is

    MAX_PKTLOG_ARCHIVES = 4
    MAX_PKTLOG_BUFFER = 10

2.5.1 Snapdragon platform with QCA639x chipset attached

Please refer the “2 WLAN logging” in " 80-wl521-103 qca639x_wlan_software_user_guid"

The pktlog disabled by default and need be collected manually

The pktlog is the primary source of debug for data path, system issues, and occasional control path issues
The pktlog instructions:

iwpriv wlan0 pktlog 3 10;sleep 2;// Run before testingiwpriv wlan0 pktlog 1;// Run after testingiwpriv wlan0 pktlog 0;cp /proc/ath_pktlog/cld /data/pktlog.dat

在 WCNSS_qcom_cfg.ini 中添加:

vosTraceEnableBAP=255vosTraceEnableTL=255vosTraceEnableWDI=255vosTraceEnableHDD=255vosTraceEnableSME=255vosTraceEnablePE=255vosTraceEnablePMC=255vosTraceEnableWDA=255vosTraceEnableSYS=255vosTraceEnableVOSS=255vosTraceEnableSAP=255vosTraceEnableHDDSAP=255wdiTraceEnableDAL=255wdiTraceEnableCTL=255wdiTraceEnableDAT=255wdiTraceEnablePAL=255wlanLoggingEnable=1gEnableDebugLog=6gEnableDhcpDebug=1gEnableFWLogging=1gEnableContFWLogging=1

转载地址:https://ciellee.blog.csdn.net/article/details/106647259 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:【Android Linux内存及性能优化】(九) 进程启动速度优化篇
下一篇:高通USB 调试总结随笔

发表评论

最新留言

不错!
[***.144.177.141]2024年04月09日 15时27分50秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

JAVA 反射的性能测试 2021-07-02
HTML 初探 2021-07-02
成功关键在于此:如何创造一个有即时价值的最小化可行产品? 2021-07-02
终端大改造:只需五步,构建你的梦中情“端” 2021-07-02
你的代码“balance”怎么样?找到简洁性和可读性的平衡点 2021-07-02
中科院刘康:低资源环境下的事件知识抽取 2021-07-02
提高软件工程技能的关键技术,这些资源赶紧收藏起来 2021-07-02
走进数据科学:最好是通过比网课更好的方法 2021-07-02
机器学习背后的数学支柱,这5本书帮你搞定! 2021-07-02
AI革命第一步:最容易被忽略但必不可少的物联网 2021-07-02
2020年开发运维工具清单:选择开发运维工具堆栈吧 2021-07-02
效率提升法则:高效人士不会去做的4件事 2021-07-02
8.PostgreSQL约束 2021-07-02
【技术分享】使用AES加密技术保障数据安全 2021-07-02
【应用实例】布线多?成本高?不可靠?泽耀方案没烦恼! 2021-07-02
数据可视化工具:Matplotlib绘图 2021-07-02
用Python写个超级小恐龙跑酷游戏,上班摸鱼我能玩一天 2021-07-02
闺蜜看我用Python画了一幅樱花图,吵着要我给他介绍程序员小哥哥 2021-07-02
【Python爬虫实战】知乎热榜数据采集,上班工作摸鱼两不误,知乎热门信息一网打尽 2021-07-02
自从我学会了数据挖掘Matplotlib、Numpy、Pandas、Ta-Lib等一系列库,我把领导开除了 2021-07-02