1. 程式人生 > >pcDuino 上RT3070 SoftAP:修改在Linux 3.18.0 核心上的編譯錯誤

pcDuino 上RT3070 SoftAP:修改在Linux 3.18.0 核心上的編譯錯誤

                             
<-- RTMPAllocTxRxRingMemory,Status=3                                          
ERROR!!! RTMPAllocDMAMemory failed,Status[=0x00000003]                        
!!! rt28xx Initialized fail!!!                                                
ifconfig: SIOCSIFFLAGS: Operation notpermitted 

修改MODULE NETIFUTIL三個目錄下的include/os/rt_linux.h中BULKAGGRE_SIZE引數,將100改為60,可以成功啟動ra0和 ra1 但是ra2啟動失敗。繼續減小這一引數值,到30後,三快都可以啟動成功。
ifconfig rax up時若提示BIRIdx(0): RXDMALen not multiple of 4.[38539],BulkInBufLen = 172,說明DMA空間不夠下一塊網絡卡載入了,需要繼續減小,但是應該會影響效能。

////////////////////////////////下面內容轉載自一技術帖回覆///////////////////////////////////
該網絡卡驅動需要使用DMA記憶體,而且還挺大(沒記錯的話有200k左右),出錯的原因是驅動申請DMA記憶體失敗。 
解決辦法: 
1. 先確定系統可用於DMA的記憶體有多大,其他驅動是否用得差不多了。 
2. 如果不能修改系統DMA記憶體大小,那麼 
3. 修改rt2870驅動rtmp_usb.h將BULKAGGRE_ZISE巨集改小一些,比如(60)

在網上看到的。
http://www.61ic.com/code/redirect.php?fid=170&tid=18751&goto=nextoldset

http://blog.csdn.net/bbandxq521/archive/2010/11/09/5997419.aspx

如果再次出現一些error的話:
[99] RtmpOSFileOpen(): Error 2 opening/etc/Wireless/RT2870STA/RT2870STA.dat
[99] Open file "/etc/Wireless/RT2870STA/RT2870STA.dat"failed!
[99] 1. Phy Mode = 0
[99] ERROR!!! NICReadRegParameters failed,Status[=0x00000001]
[99] usb 1-1: RtmpTimerTask timed out on ep0in len=4/4
[99] usb 1-1: wpa_supplicant timed out on ep0in len=4/4
[99] ---> RTMPFreeTxRxRingMemory
[99] <--- RTMPFreeTxRxRingMemory
[99] !!! rt28xx Initialized fail !!!
[99] rt28xx_open return fail!
如果是PC機,請參考驅動包裡的sta_ate_iwpriv_usage.txt檔案。裡面有這樣的英文:
=======================================================================
CONFIGURATION:  
====================
RT2870 driver can be configured via followinginterfaces, 
i.e. (i)"iwconfig" command, (ii)"iwpriv" command, (iii)configuration file

i) iwconfig comes with kernel.  
ii) iwpriv usage, please refer to file "iwpriv_usage.txt" fordetails.
iii)modify configuration file "RT2870STA.dat" in/etc/Wireless/RT2870STA/RT2870STA.dat.
   
Configuration File : RT2870STA.dat
---------------------------------------
# Copy this file to /etc/Wireless/RT2870STA/RT2870STA.dat
# This file is a binary file and will be read on loading rt.omodule.
#
# Use "vi RT2870STA.dat" to modify settings according to yourneed.

# 1.) set NetworkType to "Adhoc" for using Adhoc-mode, otherwiseusing Infrastructure
# 2.) set Channel to "0" for auto-select on Infrastructuremode
# 3.) set SSID for connecting to your Accss-point.
# 4.) AuthMode can be "WEPAUTO", "OPEN", "SHARED", "WPAPSK","WPA2PSK", "WPANONE"
# 5.) EncrypType can be "NONE", "WEP", "TKIP", "AES"
# for more information refer to the Readme file.


因為我是做嵌入式的,為了省事,就將RT2870STA.dat直接固話到嵌入式裝置裡。然後修改路徑就OK了。路徑在/include/os/rt_linux.h裡。