全志平台ap6476 wifi模组调试(3)调试&异常处理

1. 前言

前面两篇主要是环境搭建和驱动修改之类的; 这篇主要是具体的调试遇到的一些问题

2.网口wlan0能注册上但无法up起来

系统启动时bcmdhd驱动成功被加载,wlan0和p2p0网口均能成功注册上,但把wlan0网口up起来或打开wifi均是失败。

[ 64.296458] Dongle Host Driver, version 1.28.23.3 (r) [ 64.296465] Compiled in drivers/net/wireless/bcmdhd on Jul 3 2013 at 15:07:20 [ 64.311787] wl_android_wifi_on in [ 64.315518] dhd_customer_gpio_wlan_ctrl: callc customer specific GPIO to remove WLAN RESET [ 64.324760] [ap6xxx]: succeed to set gpio ap6xxx_wl_regon to 1 ! [ 64.430680] [ap6xxx]: sdio wifi power state: on [ 64.435739] =========== WLAN going back to live ======== [ 64.441753] sdio_reset_comm(): [ 64.445181] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 64.457550] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS (SDR25) dt B [ 64.468912] [mmc]: sdc1 set ios: clk 150000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 64.534760] [mmc]: sdc1 set ios: clk 150000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 64.546516] [mmc]: sdc1 set ios: clk 150000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 64.558867] [mmc]: sdc1 set ios: clk 150000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 64.569244] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 64.634274] [mmc]: sdc1 set ios: clk 50000000Hz bm PP pm ON vdd 3.3V width 4 timing SD-HS(SDR25) dt B [ 64.646225] dhd_bus_devreset: == WLAN ON == [ 64.654486] dhd_bus_devreset called when dongle is not in reset [ 64.661273] Will call dhd_bus_start instead [ 64.666320] bcmsdh_config_hw_oob_intr: Enter [ 64.671677] dhd_bus_select_firmware_name_by_chip: firmware_path=/system/vendor/modules/fw_bcm40181a2.bin [ 64.682821] Final fw_path=/system/vendor/modules/fw_bcm40181a2.bin [ 64.689987] Final nv_path=/system/vendor/modules/nvram_ap6476.txt [ 65.724009] [mmc]: wait r1 rdy 1000 ms timeout [ 65.728974] sdioh_request_packet[mmc]: wait r1 rdy 1000 ms timeout [ 66.727500] sdioh_request_bytebcmsdh_sdmmc: Failed to Write byte F1:@0x1000a=00, Err: -5 [ 67.734011] [mmc]: wait r1 rdy 1000 ms timeout [ 67.738971] sdioh_request_bytebcmsdh_sdmmc: Failed to Write byte F1:@0x1000a=00, Err: -5 [ 68.744002] [mmc]: wait r1 rdy 1000 ms timeout [ 68.748969] sdioh_request_bytebcmsdh_sdmmc: Failed to Write byte F1:@0x1000a=00, Err: -5
<
问题分析:

1、驱动代码的问题? 出错log是sdio数据的读写超时,wifi得不到数据,像是sdio I/O电压不对或wifi模组的sdio数据线与主控相连走线不记引起。

2、模组电源和wifi的使能脚的问题? 用万用表量了模组是已经有1.8V的电压,在wifi打开时wifi的使能脚也被拉高至1.8V,应该就不是电源问题。

3、SDIO I/O电压问题? 由于ap6476仅支持1.8V的I/O电压,现在是把VCC-PG的电压调成1.8V,以便达到mmc1和uart2的I/O电压是1.8V,实测SDIO I/O为1.8V。

结论如下:

做了以上排查后仍找不出原因,初步的定位是硬件问题,但不知具体问题出在哪,之前调试遇到过网口能up起来,但是没扫到任何的ap,这是由于实现使用的晶振频率和配置的晶振频率不一致,用万用表量模组的30脚TCXO_IN电压,是有0.6V电压,代表晶振已经在工作。

后来用示波器确认晶振的clk是否为26MHz,却发现clk的波特不’干净’,像似两个晶振源叠在一起。

再量主控的24MHz晶振源的clk波形,很稳定,就开始检测电路是否有问题,最终发现是有两个晶振源在给模组提供26MHz的时钟,一个有源的26MHz晶振源和一个振荡电路源,clk导致sdio通讯异常了。

解决办法:

ap6476需要有源的晶振源,把振荡电路源去掉,wifi就可以正常跑起来

3. 休眠唤醒后wifi无法工作

问题:打开wifi连接上ap,系统进入休眠,唤醒后wifi扫描列表只显示原已连接过的ap

[ 299.752967] [DISP]>>disp_resume call<< [ 299.763071] sun6i-rtc sun6i-rtc: sun6i_rtc_gettime [ 299.763087] sun6i-rtc sun6i-rtc: read time 2013-7-13 10:8:7 [ 299.763268] [mmc]: *** sw_mci_update_clk(L234): update clock timeout, fatal error!!! [ 299.763301] [mmc]: smc 1 resume [ 299.763446] :resume start [ 299.763465] :resume end [ 299.763692] [rfkill]: rfkill set power 0 [ 299.763712] [ap6xxx]: succeed to set gpio ap6xxx_bt_regon to 1 ! [ 299.783329] gpu:open gpu power! [ 299.803167] PM: resume of devices complete after 60.901 msecs [ 299.803375] PM: resume devices took 0.070 seconds [ 300.267266] [pm]aw_pm_end! [ 300.270277] PM: Finishing wakeup. [ 300.273984] Restarting tasks … done. [ 300.286721] sunxi cpufreq resume ok [ 300.290672] suspend: exit suspend, ret = 0 (2013-07-13 10:08:07.527585625 UTC) [ 300.293376] request_suspend_state: wakeup (3->0) at 300280427822 (2013-07-13 10:08:07.530289083 UTC) [ 300.309042] [HDMI]Hdmi_late_resume [ 300.309379] [DISP WRN] file:drivers/video/sun6i/disp/de_bsp/de/disp_layer.c,line:363: all layer resource used! [ 300.310713] bcmsdh_sdmmc: Failed to Write byte F1:@0x1000e=10, Err: -123 [ 300.311737] bcmsdh_sdmmc: Failed to Write byte F1:@0x1000e=10, Err: -123 [ 300.312753] bcmsdh_sdmmc: Failed to Write byte F1:@0x1000e=10, Err: -123 [ 300.312768] dhdsdio_htclk: HT Avail request error: -35 [ 300.312810] sdioh_request_packet: TX FAILED e9ae83c0[0], addr=0x08000, pkt_len=128, ERR=-123 [ 300.312868] bcmsdh_sdmmc: Failed to Write byte F0:@0x00006=02, Err: -123 [ 300.312891] bcmsdh_sdmmc: Failed to Write byte F1:@0x1000d=02, Err: -123 [ 300.313909] bcmsdh_sdmmc: Failed to Write byte F1:@0x1000d=02, Err: -123 [ 300.314933] bcmsdh_sdmmc: Failed to Write byte F1:@0x1000d=02, Err: -123
<
问题分析:

这是个极难复现的问题,有时测试上一两天均没发现,由出错的log看,是数据通讯失败,mmc向wifi端发送cmd无响应,错误代码123是no media的意思,wifi设备不存了?

估计是wifi的firmware跑挂了,从而无法响应mmc的cmd,这与wifi驱动无多大关系,主要是firmware的影响。

问题解决:

更新broadcom firmware解决

4.wifi高级选项中的”永不”和”仅限充电”不生效 问题:

wifi高级选项中选择”永不”,系统进入待机30分钟后,通过RTC把系统唤醒然后把wifi关闭系统再进入休眠;wifi高级选项中选择”仅限充电”,在系统待机时没充电的话,也会在系统待机30分钟后,通过RTC把系统唤醒后把wifi关闭系统再进入休眠,这两个选项是为了让系统更省电。

但现在问题选择上”永不”或”仅限充电”均是没能wifi关闭的。

问题分析:

1、android代码实现的是通过RTC把系统唤醒,现在发现是系统没被唤醒进而导致wifi没被关闭。

2、RTC唤醒是通过RTC_WAKEUP向系统注册一个唤醒定时器,在指定的时间后把系统唤醒,但AW的平台为避免被一些应用程序通过RTC不定时唤醒系统导致功耗增大,不支持RTC_WAKEUP命令,因而系统无法被唤醒。

问题解决:

把WifiService.java mReceiver广播接收变量和WifiStateMachine.java DriverStartedState类中RTC_WAKEUP改成AW平台新增加的RTC唤醒休眠系统的RTC_SHUTDOWN_WAKEUP即可。

5.休眠唤醒后wifi报扫描异常 问题:

在wifi打开连接上ap并在高级选项中选择wifi的休眠策略是”永不”,蓝牙打开连接上蓝牙耳机的情况下,系统进入休眠1小时左右,通过蓝牙耳机听歌把系统唤醒,然后手动把屏幕点亮,发现wifi驱动会报扫描异常。

[28571.137136] CFG80211-ERROR) wl_scan_timeout : timer expired [28571.143838] CFG80211-ERROR) wl_escan_handler : WLC_E_STATUS_TIMEOUT : scan_request[eea62000] [28571.154033] CFG80211-ERROR) wl_escan_handler : escan_on[1], reason[0xffffffff] [28571.173293] CFG80211-ERROR) wl_escan_handler : escan is not ready ndev ee83d800 wl->escan_on 1 drv_status 0x0 [28581.137165] CFG80211-ERROR) wl_scan_timeout : timer expired [28581.143847] CFG80211-ERROR) wl_escan_handler : WLC_E_STATUS_TIMEOUT : scan_request[ee9cf600] [28581.154309] CFG80211-ERROR) wl_escan_handler : escan_on[1], reason[0xffffffff] 问题分析:

wifi的扫描更新请求得不到回应或回应超时,估计是wifi的状态,跟了一把驱动代码,觉得还是跟wifi firmware相关。

问题解决:

更新broadcom firmware解决

免责声明:文章内容来自互联网,本站不对其真实性负责,也不承担任何法律责任,如有侵权等情况,请与本站联系删除。
转载请注明出处:全志平台ap6476 wifi模组调试(3)调试&异常处理 https://www.yhzz.com.cn/a/13182.html

上一篇 2023-05-11 19:29:40
下一篇 2023-05-11 19:31:52

相关推荐

联系云恒

在线留言: 我要留言
客服热线:400-600-0310
工作时间:周一至周六,08:30-17:30,节假日休息。