zolakk
Posts: 6
Joined: Thu Feb 26, 2015 4:59 pm

Compiling 8812au module on Raspberry Pi 2 and Raspbian

Thu Feb 26, 2015 7:26 pm

I've been trying for over a week to get the 8812au module compiled and installed on my Pi2 running 3.18.7-v7+ and just can't get it to work. It seems to compile ok, but when doing insmod I get "8812au: disagrees about version of symbol module_layout". I'm thinking i'm pulling the wrong version of the source but i'm not sure.. Here's the steps from my last attempt:
  • Getting kernel sources:
    mkdir src && cd src
    git clone --depth 500 https://github.com/raspberrypi/linux.git
    git clone --depth 15 https://github.com/raspberrypi/firmware.git

    Link sources:
    sudo ln -s /home/pi/src/linux /lib/modules/$(uname -r)/build
    sudo ln -s /home/pi/src/linux/arch/arm /home/pi/src/linux/arch/armv6l

    Preparing to compile modules:
    zcat /proc/config.gz > /home/pi/linux/.config
    make mrproper && make modules_prepare
    cp /home/pi/src/firmware/extra/Module.symvers /home/pi/src/linux

    Get drivers and compile:
    git clone https://github.com/gnab/rtl8812au
    cd rtl8812au/
    *edit Makefile for raspberry*
    make clean && make && make install

    Insert fresh module:
    insmod 8812au.ko
Anyone know what i'm doing wrong?

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Thu Feb 26, 2015 11:35 pm

I'm not sure what's wrong on your end, but I just did this so here's a rough summary of what I did.

Code: Select all

cd ~
mkdir software && cd software
mkdir build && cd build
git clone https://github.com/raspberrypi/linux.git
cd linux
make mrproper
zcat /proc/config.gz > .config
make oldconfig
make menuconfig
sudo apt-get install libncurses5 libncurses5-dev
make menuconfig
make -j5
make modules
sudo make modules_install

Code: Select all

cd ~/software/build
git clone https://github.com/raspberrypi/tools.git
cd ~/software/build/linux/arch/arm/boot/
/home/ktb/software/build/tools/mkimage/mkknlimg zImage kernel7_new.img
sudo cp kernel7_new.img /boot/kernel-3.18.7-v7+.img
sudo nano /boot/config.txt

Code: Select all

...
kernel=kernel-3.18.7-v7+.img
...

Code: Select all

sudo reboot

Code: Select all

cd ~/software/build
git clone https://github.com/gnab/rtl8812au.git
cd rtl8812au
nano Makefile

Code: Select all

...
CONFIG_AUTOCFG_CP = n

CONFIG_MULTIDRV = n
CONFIG_RTL8192C = n
CONFIG_RTL8192D = n
CONFIG_RTL8723A = n
CONFIG_RTL8188E = n
CONFIG_RTL8812A = y
CONFIG_RTL8821A = y
CONFIG_RTL8192E = n
CONFIG_RTL8723B = n

CONFIG_USB_HCI = y
CONFIG_PCI_HCI = n
CONFIG_SDIO_HCI = n
CONFIG_GSPI_HCI = n

CONFIG_MP_INCLUDED = n
CONFIG_POWER_SAVING = n
CONFIG_USB_AUTOSUSPEND = n
CONFIG_HW_PWRP_DETECTION = n
CONFIG_WIFI_TEST = n
CONFIG_BT_COEXIST = n
CONFIG_RTL8192CU_REDEFINE_1X1 = n
CONFIG_INTEL_WIDI = n
CONFIG_WAPI_SUPPORT = n
CONFIG_EFUSE_CONFIG_FILE = n
CONFIG_EXT_CLK = n
CONFIG_FTP_PROTECT = n
CONFIG_WOWLAN = n

CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ANDROID_X86 = n
CONFIG_PLATFORM_JB_X86 = n
CONFIG_PLATFORM_ARM_S3C2K4 = n
CONFIG_PLATFORM_ARM_PXA2XX = n
CONFIG_PLATFORM_ARM_S3C6K4 = n
CONFIG_PLATFORM_ARM_RPI = y
CONFIG_PLATFORM_MIPS_RMI = n
CONFIG_PLATFORM_RTD2880B = n
CONFIG_PLATFORM_MIPS_AR9132 = n
CONFIG_PLATFORM_RTK_DMP = n
CONFIG_PLATFORM_MIPS_PLM = n
CONFIG_PLATFORM_MSTAR389 = n
CONFIG_PLATFORM_MT53XX = n
CONFIG_PLATFORM_ARM_MX51_241H = n
CONFIG_PLATFORM_FS_MX61 = n
CONFIG_PLATFORM_ACTIONS_ATJ227X = n
CONFIG_PLATFORM_TEGRA3_CARDHU = n
CONFIG_PLATFORM_TEGRA4_DALMORE = n
CONFIG_PLATFORM_ARM_TCC8900 = n
CONFIG_PLATFORM_ARM_TCC8920 = n
CONFIG_PLATFORM_ARM_TCC8920_JB42 = n
CONFIG_PLATFORM_ARM_RK2818 = n
CONFIG_PLATFORM_ARM_URBETTER = n
CONFIG_PLATFORM_ARM_TI_PANDA = n
CONFIG_PLATFORM_MIPS_JZ4760 = n
CONFIG_PLATFORM_DMP_PHILIPS = n
CONFIG_PLATFORM_TI_DM365 = n
CONFIG_PLATFORM_MSTAR_TITANIA12 = n
CONFIG_PLATFORM_SZEBOOK = n
CONFIG_PLATFORM_ARM_SUNxI = n
CONFIG_PLATFORM_ARM_SUN6I = n
CONFIG_PLATFORM_ACTIONS_ATM702X = n
CONFIG_PLATFORM_ACTIONS_ATV5201 = n

CONFIG_DRVEXT_MODULE = n
...

Code: Select all

make
sudo cp 8812au.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless
sudo depmod
Somewhere in there I also created and/or updated initramfs:

Code: Select all

update-initramfs -c -k `uname -r` -v
update-initramfs -u -k `uname -r` -v

Code: Select all

sudo nano /boot/config.txt

Code: Select all

...
kernel=kernel-3.18.7-v7+.img
initramfs initrd.img-3.18.7-v7+ followkernel
...

zolakk
Posts: 6
Joined: Thu Feb 26, 2015 4:59 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Thu Feb 26, 2015 11:50 pm

if i'm reading your process correctly, if looks like you rebuilt your kernel to get this to work. I was hoping to avoid that, but it may not be a choice I guess

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Fri Feb 27, 2015 12:02 am

zolakk wrote:if i'm reading your process correctly, if looks like you rebuilt your kernel to get this to work. I was hoping to avoid that, but it may not be a choice I guess
Yes. I'm sorry, I usually rebuild the kernel. It should be possible without, but I haven't done that in a while. What I posted is mostly just pulled from my .bash_history and I thought it might help.

zolakk
Posts: 6
Joined: Thu Feb 26, 2015 4:59 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Sat Feb 28, 2015 4:12 am

No, thank you. It may not have been the easy solution I was looking for but it got me going and that's what matters :)

TheiTay
Posts: 16
Joined: Tue Feb 17, 2015 10:39 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Mon Mar 02, 2015 11:06 am

Hello, I'm having the exact same issue. Trying to use Rasbian and Edimax EW-7811UTC, without success.
I'm a newbie in Linux and I didn't really understand your discussion.
I know that my current kernel is 3.18.7v7 and for some reason I didn't succeed to compile the 8812au.ko file.

Is this thread is intended for me too? Did you find any solution instead of rebuilding the kernel (which I don't really know how it would affect me).

Thanks

zolakk
Posts: 6
Joined: Thu Feb 26, 2015 4:59 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Tue Mar 03, 2015 12:14 am

I gave up on finding a solution that didn't involve recompiling the kernel, there doesn't seem to be much support for compiling driver modules with the stock kernel for some reason. It wasn't that hard, I just followed ktb's post line by line with the exception of doing the 'sudo apt-get install libncurses5 libncurses5-dev' first and needing to run 'sudo make -j5'. I didn't do the initramfs part either and everything seems to run just fine for me. If you're worried you can always pick up a spare SD card to test it out on.

TheiTay
Posts: 16
Joined: Tue Feb 17, 2015 10:39 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Tue Mar 03, 2015 8:41 am

For the past couple hours my raspberry pi is working by the order that ktb suggested. hope to get a good result!
is there any commands that I won't be able to use anymore (I heard that if I use update or something like that it'll return to the bad driver).

User avatar
rpdom
Posts: 15587
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Tue Mar 03, 2015 9:29 am

Well, you shouldn't do an rpi-update as that will replace your custom kernel and modules/drivers with the latest "bleeding-edge" version.

If you do apt-get [dist-]upgrade, it may want to install a later raspberrypi-bootloader package, which will replace your custom drivers with the current standard ones. You can get around that by holding the raspberrypi-bootloader package

Code: Select all

sudo apt-mark hold raspberrypi-bootloader
That should prevent the package from being updated, but keep a watch out when you do any apt-get upgrades, just to check that neither that package or any other kernel-related packages are to be updated, and don't use the "-y" option to automatically accept the upgrades.

TheiTay
Posts: 16
Joined: Tue Feb 17, 2015 10:39 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Tue Mar 03, 2015 1:45 pm

When I use this command:

Code: Select all

pi@raspberrypi ~/software/build/linux/arch/arm/boot $ /home/pi/software/build/tools/mkimage/mkknlimg zImage kernel7_new.img
This is the result that I have:

Code: Select all

* File 'zImage' not found
Usage: mkknlimg [--dtok] <vmlinux|zImage|bzImage> <outfile>

zolakk
Posts: 6
Joined: Thu Feb 26, 2015 4:59 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Tue Mar 03, 2015 4:42 pm

When you did the

Code: Select all

make -j5
did you run it as

Code: Select all

sudo make -j5
like I suggested? That fixed it for me when I had that error. If you didn't, no worries, you can do it now and then try again. You may have to run the

Code: Select all

sudo make modules_install
again too, as that may have failed if the main make didn't complete properly

TheiTay
Posts: 16
Joined: Tue Feb 17, 2015 10:39 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Fri Mar 06, 2015 8:17 am

I didn't succeed to do it yet. I've seen that when I used the command:
sudo zcat /proc/config.gz > .config
The result was:
bash: .config: Permission denied

Is there any way to fix this problem?

User avatar
DougieLawson
Posts: 36570
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Fri Mar 06, 2015 9:19 am

sudo sh -c 'zcat /proc/config.gz > .config'
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

TheiTay
Posts: 16
Joined: Tue Feb 17, 2015 10:39 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Fri Mar 06, 2015 12:51 pm

I tried to run all of the commands again, still with the same problem:
command:
sudo /home/pi/software/build/tools/mkimage/mkknlimg zImage kernel7_new.img

result:
* File 'zImage' not found
Usage: mkknlimg [--dtok] <vmlinux|zImage|bzImage> <outfile>

(Used sudo in every stage)

bjornvilla
Posts: 1
Joined: Fri Mar 13, 2015 10:54 am

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Fri Mar 13, 2015 10:59 am

I am having the exact same problem, for kernel 3.18.7 on both RPI 1 and RPI 2. Could someone share the 8812au.ko file ?

I compiled it before on 3.12.28+ without any problems (on RPI 1). If anyone would like to have the compiled binary of this, just let me know.

MatthiasBreuer
Posts: 2
Joined: Sun Mar 15, 2015 2:33 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Sun Mar 15, 2015 3:33 pm

I failed to compile the 8812au.ko driver on raspberry pi2, too.
I have compiled using the latest version 3.18.9-v7+ #767 SMP PREEMPT Sat Mar 7 21:52:35 GMT 2015 armv7l GNU/Linux

Code: Select all

umask 0
mkdir src
cd src
git clone --depth=1 https://github.com/raspberrypi/linux.git
git clone --depth=1 https://github.com/raspberrypi/firmware.git
git clone --depth=1 https://github.com/gnab/rtl8812au.git
sudo ln -s /home/pi/src/linux /lib/modules/`uname -r`/build
sudo ln -s /home/pi/src/linux /lib/modules/`uname -r`/source
cd linux
make clean
make bcm2709_defconfig
make modules_prepare
zcat /proc/config.gz >.config
cp ../firmware/extra/Module7.symvers Module.symvers
cd ../rtl8812au
vi Makefile
I changed the Makefile to compile on raspberry pi
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_RPI = y

Code: Select all

make clean
make
sudo insmod 8812au.ko
I used Module7.symvers as Module.symvers because of the pi2 (BCM2709) which is an arm 7 architecture.
On insmod I get some syslogd message:

Code: Select all

Message from syslogd@berry1 at Mar 15 14:53:09 ...
 kernel:[ 2521.415542] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
 kernel:[ 2521.514032] Process insmod (pid: 6241, stack limit = 0x95bc2238)
 kernel:[ 2521.521240] Stack: (0x95bc3e88 to 0x95bc4000)
 kernel:[ 2521.526808] 3e80:                   7f1582e4 00007fff 8008d234 95bc2000 95bc3f34 bccc1000
 kernel:[ 2521.537360] 3ea0: 00000000 95bc3f7c 95bc3f50 000015a9 bcdb1310 7f1582e4 95bc2008 7f158320
 kernel:[ 2521.548013] 3ec0: 7f158448 00000000 95bc2000 808986ac 76d50000 ba7b96bc 0000046d 00000000
 kernel:[ 2521.558756] 3ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
 kernel:[ 2521.569519] 3f00: 00000000 00000000 00000000 00000000 00000000 00000000 00000080 0016746d
 kernel:[ 2521.580320] 3f20: 76bf7000 76ec9948 00000080 8000ed44 95bc2000 00000000 95bc3fa4 95bc3f48
 kernel:[ 2521.591231] 3f40: 80090a4c 8008e968 bccc1000 0016746d bcdb0d48 bcdb0bc5 bce18948 000f0e48
 kernel:[ 2521.602240] 3f60: 000fc728 00000000 00000000 00000000 00000025 00000026 0000001a 0000001e
 kernel:[ 2521.613338] 3f80: 0000000e 00000000 00000000 7e81871c 00000000 77fc5030 00000000 95bc3fa8
 kernel:[ 2521.624506] 3fa0: 8000eac0 8009096c 7e81871c 00000000 76bf7000 0016746d 76ec9948 76bf7000
 kernel:[ 2521.635695] 3fc0: 7e81871c 00000000 77fc5030 00000080 77fc4f80 0016746d 76ec9948 00000000
 kernel:[ 2521.646937] 3fe0: 00000000 7e8186c4 76ec0fb4 76e2bab4 60000010 76bf7000 0a4d524f 00000011
 kernel:[ 2521.680410] Code: e51bc084 e15c0005 e2455008 0a000009 (e5953014)
Has anyone an idea, what I have to change in configuration?
There are some differences in the .config file on 'make bcm2709_defconfig' and 'zcat /proc/config.gz >.config', but skipping the 'zcat ..' didn't change anything
Kind Regards

Matthias Breuer, Cologne, Germany

TheiTay
Posts: 16
Joined: Tue Feb 17, 2015 10:39 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Tue Mar 17, 2015 8:52 am

Hello, I still haven't succeeded to solve this issue.

I heard that there is an option to compile this module in a different linux machine (which uses Intel processor), and use the ko file in the RPI.
Any ideas how?

TheiTay
Posts: 16
Joined: Tue Feb 17, 2015 10:39 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Wed Mar 18, 2015 12:55 pm

http://www.raspberrypi.org/forums/viewt ... au#p721331

This worked for me, did the job without any rebuliding the kernel and that type of solutions. :D

MatthiasBreuer
Posts: 2
Joined: Sun Mar 15, 2015 2:33 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Thu Mar 19, 2015 8:04 pm

I solved the problem by crosscompiling.
My linux host is an ubuntu 14.04 server and I installed the cross compile toolchain according to the description on the raspberry pi page http://www.raspberrypi.org/documentatio ... uilding.md

1. installing the sources

Code: Select all

git clone --depth=1 https://github.com/raspberrypi/linux.git
git clone --depth=1 https://github.com/raspberrypi/firmware.git
git clone --depth=1 https://github.com/gnab/rtl8812au.git
change the rtl8812au/Makefile:
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_RPI = y
make destination dirs
mkdir arm
mkdir arm7

2.1 cross compile for raspberry pi2

Code: Select all

cd linux
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_prepare
cp ../firmware/extra/Module7.symvers Module.symvers
cd ../rtl8812au
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- KSRC=../linux
cp 8812au.ko ../arm7
cd ..
8812au.ko for raspberry pi2 has 1441396 Bytes

2.2 crosscompile for raspberry pi1

Code: Select all

cd linux
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcmrpi_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_prepare
cp ../firmware/extra/Module.symvers .
cd ../rtl8812au
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- KSRC=../linux
cp 8812au.ko ../arm
cd ..
8812au.ko for raspberry pi1 has 1468377 bytes
Kind Regards

Matthias Breuer, Cologne, Germany

stefaanbolle
Posts: 10
Joined: Tue Aug 13, 2013 5:24 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Fri Mar 20, 2015 12:07 pm

Would it be possible to share the compiled package?
I just purchased an Alfa AWUS036AC
Thanks!

staticn0de
Posts: 3
Joined: Wed Mar 18, 2015 11:48 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Sat Mar 21, 2015 1:09 am

stefaanbolle wrote:Would it be possible to share the compiled package?
I just purchased an Alfa AWUS036AC
Thanks!
I compiled this based on the 4.3.8 version of the driver, test it with insmod 8812au.ko

Works great with my Pi2:
3.18.9-v7+ #768 SMP PREEMPT Sun Mar 15 19:41:56 GMT 2015

With my Asus USB-AC56

https://www.dropbox.com/s/mkl4gm065ma9p ... au.ko?dl=0

shallyverma
Posts: 4
Joined: Mon Mar 23, 2015 11:32 am

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Tue Mar 24, 2015 7:27 am

MatthiasBreuer wrote:I solved the problem by crosscompiling.
My linux host is an ubuntu 14.04 server and I installed the cross compile toolchain according to the description on the raspberry pi page http://www.raspberrypi.org/documentatio ... uilding.md

1. installing the sources

Code: Select all

git clone --depth=1 https://github.com/raspberrypi/linux.git
git clone --depth=1 https://github.com/raspberrypi/firmware.git
git clone --depth=1 https://github.com/gnab/rtl8812au.git
change the rtl8812au/Makefile:
CONFIG_PLATFORM_I386_PC = n
CONFIG_PLATFORM_ARM_RPI = y
make destination dirs
mkdir arm
mkdir arm7

2.1 cross compile for raspberry pi2

Code: Select all

cd linux
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_prepare
cp ../firmware/extra/Module7.symvers Module.symvers
cd ../rtl8812au
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- KSRC=../linux
cp 8812au.ko ../arm7
cd ..
8812au.ko for raspberry pi2 has 1441396 Bytes

2.2 crosscompile for raspberry pi1

Code: Select all

cd linux
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcmrpi_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_prepare
cp ../firmware/extra/Module.symvers .
cd ../rtl8812au
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- clean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- KSRC=../linux
cp 8812au.ko ../arm
cd ..
8812au.ko for raspberry pi1 has 1468377 bytes
HI Mathew
I have been trying to do same. I followed all of the steps on my build server exactly as you mention above and built 8812au.ko (size 14,68,777). I am also using Ubuntu 14.04.1 LTS distribution package for cross compiling. I have raspberry model B board with raspberry debian wheezy package and created a samba share of home directory. In order to load compiled module on RPI, i did following steps:
1. cd /home/pi/
2. copy 8812au.ko
3.sudo insmod 8812au.ko
insmod returns with "Error: could not insert module 8812au.ko: Invalid module format". Could you also please tell if this module loading was successful on your RPI 1 board? if yes, then whats am missing.
I eventually want to create my own kernel driver and run it on RPI but having a hard time to make any module runnable on Pi. Any working solution will help. I have been struggling with this issues since 3 days and read all of the forums to find out what it needs to have a working development platform of my driver on Pi.
On Pi, i only have distribution package , do i need to download anything else?

xphoto
Posts: 4
Joined: Thu Apr 16, 2015 7:16 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Thu Apr 16, 2015 7:49 pm

Hi !
first thanks for all this information ! :D ;)
I've spent about all evenings this week trying to figure out how to make work my DWA-171 USB adapter. By how to make work I mean compile it the first place.
I finally managed to compile it and make it run. I've uploaded a copy, feel free to download it from here: http://www.xphoto.ch/8812au.ko.gz

This is compiled and works on the following kernel version:

Code: Select all

 $ uname -avr
Linux raspberrypi 3.18.11-v7+ #776 SMP PREEMPT Mon Apr 6 13:19:43 BST 2015 armv7l GNU/Linux
What I did it simply follow above instructions for CROSS-COMPILE from MatthiasBreuer and did it on a Debian Linux PC.
Compiling the whole thing on the PI2 never made it. Everytime I got a Kernel Panic when tried to do

Code: Select all

sudo insmod 8812au.ko
Now it loads fine and shows in 'lsmod'

Code: Select all

pi@raspberrypi ~/src/rtl8812au $ sudo insmod 8812au.ko
pi@raspberrypi ~/src/rtl8812au $ sudo lsmod
Module                  Size  Used by
8812au               1077557  0
snd_bcm2835            18665  0
snd_pcm                73475  1 snd_bcm2835
snd_seq                53078  0
snd_seq_device          5628  1 snd_seq
snd_timer              17784  2 snd_pcm,snd_seq
snd                    51038  5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
uio_pdrv_genirq         2958  0
uio                     8119  1 uio_pdrv_genirq
enjoy !

edit: This driver is compiled only for Pi2 module !

MrEngman
Posts: 3871
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Thu Apr 16, 2015 11:32 pm

Hi xphoto,

Just downloaded your driver and I am amazed that I can now use my EW-7811UTC on my Pi 2B. Absolutely brilliant, thanks very much.

I am really surprised though that the driver when cross compiled on a PC works but when compiled on the Pi it causes the kernel to crash. I have been compiling several different drivers on the Pi, 8188eu, 8192eu, 8812au and mt7601 and generally they all work if compiled for the Pi 1 or Pi 2, but when using the 8812au driver with the EW-7811UTC it crashes when used on the Pi 2B. Compiling the driver for the Pi 1 and the EW-7811UTC works OK.

I am really interested to try and find out why the driver does not work on the Pi 2B when compiled on a Pi but is OK when cross compiled on a Linux PC because I do not have a PC with Linux and have to rely on my Pi to compile modules on.

Can you tell me the version of gcc is used on your Debian Linux PC? Did you need to apply any patches to the driver to get it to compile or did you get any errors when compiling?

Well done, guys, for finding a solution to the driver crashing the pi 2B. If anyone has any clue as to why it doesn't work when compiled on the PI I would be really interested to hear any suggestions.


MrEngman

PS. Just one issue. The driver is continually outputting a hugh amount of data to dmesg.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

xphoto
Posts: 4
Joined: Thu Apr 16, 2015 7:16 pm

Re: Compiling 8812au module on Raspberry Pi 2 and Raspbian

Wed Apr 22, 2015 8:39 pm

Hi MrEngman,

I've found this options to make good use to avoid all the log in the dmesg abou enter/quit power save mode. I've added this file to modprobe.d folder:

Code: Select all

more /etc/modprobe.d/8812au.conf
options 8812au rtw_power_mgnt=0
gcc version 4.7.2 (Debian 4.7.2-5)
I didn't apply any patch (I think...) and i got a lot of warnings at some point but it went thru.

Return to “Advanced users”