专栏首页程序猿的那点事高通 wlan 调试抓取日志大全

高通 wlan 调试抓取日志大全

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

最终我这个问题也是终过射频同事确认,物料贴错了,导致wifi 功率起不来, 解决这个问题后,bt 的问题买一送一,连同wifi问题一并ok 了。

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

1. 进入ftm模式

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

方法一:

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

方法二:

adb root && adb wait-for-devices
adb shell rmmod wlan
adb shell insmod /vendor/lib/modules/qca_cld3_wlan.ko con_mode_ftm=5
adb shell ifconifg wlan0 up
adb shell ftmdaemon -n -dd
12345

有关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
  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
  4. 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 testing
iwpriv wlan0 pktlog 1;

// Run after testing
iwpriv wlan0 pktlog 0;

cp /proc/ath_pktlog/cld /data/pktlog.dat

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • remount of the / superblock failed: Permission denied remount failed

    今天adb时遇到了这个问题,之前就遇到过一次,在这里记录一下。 执行adb remount 时遇到的错误:

    用户7557625
  • 通过wifi对手机进行adb连接debug调试 adb connect ip_address:5555

    adb支持两种连接Android系统的方式,USB方式及网络方式。一般android手机及android平板默认会设置为USB方式(直接插数据线的方式)。

    用户7557625
  • Android RTT : 通过 RTT 确定 WLAN 位置信息

    https://source.android.google.cn/devices/tech/connect/wifi-rtt Android 9 中的 WLA...

    用户7557625
  • ADB命令

      adb命令位于Android SDK下的platform-tools自带。能够通过wifi远程下载APK,也能够答应日志信息。Android Studio的...

    饮水思源为名
  • 反爬虫之搭建IP代理池

    听说你又被封 ip 了,你要学会伪装好自己,这次说说伪装你的头部。可惜加了header请求头,加了cookie 还是被限制爬取了。这时就得祭出IP代理池!!! ...

    py3study
  • redis学习笔记

    摘录些nosqlfans上看的资源(http://blog.nosqlfan.com/html/3537.html),用了一年了,只会安装、启动和get set...

    财主刀刀
  • Hacking Team漏洞大范围挂马,上百万电脑中招

    一、概况 近日,腾讯反病毒实验室拦截到一个恶意推广木马大范围传播,总传播量上百万,经分析和排查发现该木马具有以下特征: 1)该木马是通过网页挂马的方式传播的,经...

    FB客服
  • PHP使用redis位图bitMap 实现签到功能

    (1)用户签到,插入一条记录,根据create_time查询昨日是否签到,有签到则max_time在原基础+1,否则,max_time=0

    砸漏
  • 剥去华丽的外衣,这些网络IP剧还剩下什么?

    VRPinea
  • Jedis连接失败 Could not get a resource from the pool] with root cause

    以前都是用iptables,但是centos7.0之后就换成了firewalled了,那么我查看了firewalled的状态为active(running),很...

    traffic

扫码关注云+社区

领取腾讯云代金券