Enable PCI GW-USMicroN on Linux and Android

Driver and firmware
先到Ralink網站下載linux driver and firmware, chip是rt3070USB
http://www.ralinktech.com.tw/support.php?s=2
Compile - Linux (x86)
$ cd driver_folder
$ make
Compile - Android (omap35xx)
$ cd driver_folder
$ vi Makefile
PLATFORM=ARM
ifeq ($(PLATFORM),ARM)
LINUX_SRC = /home/vanix/embinux_android_on_beagle_0708/kernel
CROSS_COMPILE = /home/vanix/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-
endif
$ vi os/linux/config.mk
ifeq ($(PLATFORM), ARM)
EXTRA_CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign -fwrapv -DMODULE $(WFLAGS)
export EXTRA_CFLAGS
endif
$ vi os/linux/usb_device.xxx
把device id加進去,可用lsusb查詢
Copy firmware to special path
$ cp RT2870STA.dat /etc/Wireless/RT2870STA/

Insert module
$ insmod driver_folder/os/linux/rt3070sta.ko

留言

  1. 請問Compile - Android (omap35xx)指的是修改從Ralink所下載的檔案嗎?謝謝

    回覆刪除
  2. 請問Compile - Android (omap35xx)是指直接在CPU上make嗎?謝謝

    回覆刪除
  3. 不好意思,因為是個人筆記所以寫得很概略
    "Compile - Android (omap35xx)" 是指用cross-compiler將driver編成給ARM用的module
    另外是從Ralink下載的原始碼沒錯

    回覆刪除
  4. 感謝你的回應。所以我如果是要在Devkit8000上(TI OMAP3530 CPU) run,我的PLATFORM就要設成ARM,即使我是在PC上compile的,是嗎?謝謝

    回覆刪除
  5. 是。
    你需要cross-compile toolchain, 我是使用codesourcery的toolchain

    回覆刪除
  6. 不好意思,我make完的結果如下,不知是有那裡做錯了呢?謝謝
    root@ubuntu:~/project5/android/RT3070# make
    make -C tools
    make[1]: Entering directory `/root/project5/android/RT3070/tools'
    gcc -g bin2h.c -o bin2h
    make[1]: Leaving directory `/root/project5/android/RT3070/tools'
    /root/project5/android/RT3070/tools/bin2h
    cp -f os/linux/Makefile.6 /root/project5/android/RT3070/os/linux/Makefile
    make -C SUBDIRS=/root/project5/android/RT3070/os/linux modules
    make: *** SUBDIRS=/root/project5/android/RT3070/os/linux: No such file or directory. Stop.
    make: *** [LINUX] Error 2

    回覆刪除
  7. 再附上我的設定如下,謝謝
    ifeq ($(PLATFORM),ARM)
    LINUX_SRC = /root/project5/android/kernel
    CROSS_COMPILE = /root/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc
    #CROSS_COMPILE = /lib/modules/2.6.32-24-generic/build
    endif

    回覆刪除
  8. kernel是來自哪裡?

    回覆刪除
  9. 以下是我取得Linux kernel的方式
    $ git clone git://gitorious.org/0xlab-kernel/kernel.git
    $ cd kernel
    $ git checkout -b kernel_omap3 origin/omap3-2.6.32

    回覆刪除
  10. 請問下列檔案的設定是根據什麼文件或檔案呢?謝謝
    $ vi os/linux/config.mk
    ifeq ($(PLATFORM), ARM)
    EXTRA_CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Os -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign -fwrapv -DMODULE $(WFLAGS)
    export EXTRA_CFLAGS
    endif

    回覆刪除
  11. CROSS_COMPILE = /home/vanix/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-
    去掉gcc試試

    回覆刪除
  12. 感謝回應,去掉gcc後,的確是可以但還是有新的問題如下
    root@ubuntu:~/project5/android/RT3070_# make
    make -C tools
    make[1]: Entering directory `/root/project5/android/RT3070_/tools'
    gcc -g bin2h.c -o bin2h
    make[1]: Leaving directory `/root/project5/android/RT3070_/tools'
    /root/project5/android/RT3070_/tools/bin2h
    cp -f os/linux/Makefile.6 /root/project5/android/RT3070_/os/linux/Makefile
    make -C /root/project5/android/kernel SUBDIRS=/root/project5/android/RT3070_/os/linux modules
    make[1]: Entering directory `/root/project5/android/kernel'
    CC [M] /root/project5/android/RT3070_/os/linux/../../common/crypt_md5.o
    cc1: error: unrecognized command line option "-m64"
    cc1: error: unrecognized command line option "-mno-red-zone"
    cc1: error: unrecognized command line option "-mcmodel=kernel"
    cc1: error: unrecognized command line option "-maccumulate-outgoing-args"
    make[2]: *** [/root/project5/android/RT3070_/os/linux/../../common/crypt_md5.o] Error 1
    make[1]: *** [_module_/root/project5/android/RT3070_/os/linux] Error 2
    make[1]: Leaving directory `/root/project5/android/kernel'
    make: *** [LINUX] Error 2

    回覆刪除
  13. EXTRA_CFLAGS的參數要弄清楚再用
    你的error message有提到錯誤問題了

    回覆刪除
  14. EXTRA_CFLAGS := -D__KERNEL__ $(WFLAGS) -I$(RT28xx_DIR)/include
    先把CFLAGS改掉試試

    回覆刪除
  15. 請問你的platform 是Beagle board 還是 Devkit8000?

    回覆刪除

張貼留言

熱門文章