WiFi usb-stick problems(Need to manualy Compile the Driver)


lukey

Rare Species
Joined
Jun 17, 2015
Messages
504
Location
Germany
Please can someone with a proper Kernel driver building environment build the Driver for me? Or give me a working Kernel source, so I can Build the Driver with the right kernel Sources(with patches & Co. applied)?

Hello,

I just buyed an WiFi-Stick. It's not working on my Pandora, but on my Debian8 PC it works fine.

Here is the dmesg:

[ 1342.937896] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[ 1342.937896] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 1342.937927] usb usb2: Product: OMAP-EHCI Host Controller
[ 1342.937927] usb usb2: Manufacturer: Linux 3.2.69 ehci_hcd
[ 1342.937957] usb usb2: SerialNumber: ehci-omap.0
[ 1342.940887] hub 2-0:1.0: USB hub found
[ 1342.940948] hub 2-0:1.0: 3 ports detected
[ 1344.984741] usb 2-2: new high-speed USB device number 2 using ehci-omap
[ 1345.162811] usb 2-2: New USB device found, idVendor=148f, idProduct=5372
[ 1345.162841] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1345.162841] usb 2-2: Product: 802.11 n WLAN
[ 1345.162872] usb 2-2: Manufacturer: Ralink
[ 1345.703521] usb 2-2: reset high-speed USB device number 2 using ehci-omap
[ 1345.900146] phy1 -> rt2800_init_eeprom: Error - Invalid RT chipset detected.
[ 1345.900390] phy1 -> rt2x00lib_probe_dev: Error - Failed to allocate device.
[ 1345.902465] usbcore: registered new interface driver rt2800usb
I also installed the ralink PND, but it's the same result.

PS: I tried it with  www.mediatek.com/AmazonS3/Downloads/linux/DPO_RT5572_LinuxSTA_2.6.1.3_20121022.tar.bz2 but it gives me a compile error:

root@lukas-openpandora:/luk/DPO_RT5572_LinuxSTA_2.6.1.3_20121022# make
make -C tools
make[1]: Entering directory `/luk/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/luk/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/tools'
/luk/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/tools/bin2h
cp -f os/linux/Makefile.6 /luk/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux/Makefile
make -C /lib/modules/3.2.69/build SUBDIRS=/luk/DPO_RT5572_LinuxSTA_2.6.1.3_20121022/os/linux modules
make: *** /lib/modules/3.2.69/build: No such file or directory. Stop.
make: *** [LINUX] Error 2

PPS:

Now i downloaded the 3.2.69 kernel sources, and built it using the config from /proc/config.gz and pointed the "LINUX_SRC" variable inside the driver Makefile at the kernel source directory. Now the Driver builds sucesffully, but when I try to load the module with insmod, i get:

insmod: error inserting 'os/linux/rt5572sta.ko' : -1 Invalid module format

PPPS:

when I try to load the module, i get

rt5572sta: disagrees about version of symbol module_layout
with dmesg. What did i do wrong?

PPPPS: I'm Cloning the Pandora kernel git over internal WiFi..... ZZZZzzzzzzz.......

Please can someone with a proper Kernel driver building environment build the Driver for me? Or give me a working Kernel source, so I can Build the Driver with the right kernel Sources(with patches & Co. applied)?
 
Last edited by a moderator:
http://notaz.gp2x.de/misc/pnd/ko/3.2.69/

Now i downloaded the 3.2.69 kernel sources, and built it using the config from /proc/config.gz and pointed the "LINUX_SRC" variable inside the driver Makefile at the kernel source directory. Now the Driver builds sucesffully, but when I try to load the module with insmod, i get:

insmod: error inserting 'os/linux/rt5572sta.ko' : -1 Invalid module format

Hmm I wonder why so many people are having problems compiling pandora compatible modules. Here is how I did it on x86 PC (from scratch, just to test if something special is needed):

Code:
git clone git://git.openpandora.org/pandora-kernel.git
cd pandora-kernel/
PATH=$PATH:/path/to/toolchain/bin make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- omap3_pandora_defconfig
PATH=$PATH:/path/to/toolchain/bin make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- -j5
cd ../DPO_RT5572_LinuxSTA_2.6.1.3_20121022
PATH=$PATH:/path/to/toolchain/bin make make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- LINUX_SRC=../pandora-kernel/
and it built a module that loads fine. Maybe it's toolchain differences, but I've tried to build the module with GCC 4.5.2 (while the kernel is built with GCC 4.9.3) and it still loaded fine, so I dunno...

In either case, my current toolchain is here: http://notaz.gp2x.de/misc/pnd/toolchains/arm-gcc-4.9.3.tar.xz
 
Last edited by a moderator:
If anyone wants to try a crosscompile, here is a script to build a cross compile env in linux with binutils 2.25.1, gcc/g++ 4.9.3 and glibc 2.9: http://ptitseb.openpandora.org/crosscompilemaker.sh

The script download everything and patch and compile everything, so it will take some time... 

(Maybe I should make a dedicated post in the dev section if there is enough interest)
 
Hmm I wonder why so many people are having problems compiling pandora compatible modules. Here is how I did it on x86 PC (from scratch, just to test if something special is needed):

Code:
git clone git://git.openpandora.org/pandora-kernel.git
cd pandora-kernel/
PATH=$PATH:/path/to/toolchain/bin make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- omap3_pandora_defconfig
PATH=$PATH:/path/to/toolchain/bin make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- -j5
cd ../DPO_RT5572_LinuxSTA_2.6.1.3_20121022
PATH=$PATH:/path/to/toolchain/bin make make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- LINUX_SRC=../pandora-kernel/
and it built a module that loads fine. Maybe it's toolchain differences, but I've tried to build the module with GCC 4.5.2 (while the kernel is built with GCC 4.9.3) and it still loaded fine, so I dunno...

In either case, my current toolchain is here: http://notaz.gp2x.de/misc/pnd/toolchains/arm-gcc-4.9.3.tar.xz
Uhmm what i do wrong ??

in my home (i have Lubuntu 14 on VirtualBox) i cloned the kernel like you write above.

i downloaded your toolchain and placed in a dir under home (/home/farox/arm-gcc-4.9.3)

now when i type (i have changed  CROSS_COMPILE=arm-none-linux-gnueabi-  to  CROSS_COMPILE=arm-unknown-linux-gnueabi- ) :

PATH=$PATH:/home/farox/arm-gcc-4.9.3/bin make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi- omap3_pandora_defconfig

i have:

HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
when i type:

PATH=$PATH:/home/farox/arm-gcc-4.9.3/bin make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnueabi- -j2

i have

/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 1: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: ELF: not found
/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 2: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: @@@@@@00pp@p@@@d
                                                                           d
                                                                             : not found
/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 3: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: Syntax error: word unexpected (expecting ")")
scripts/kconfig/conf --silentoldconfig Kconfig
/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 1: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: ELF: not found
/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 2: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: @@@@@@00pp@p@@@d
                                                                           d
                                                                             : not found
/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 3: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: Syntax error: word unexpected (expecting ")")
  WRAP    arch/arm/include/generated/asm/auxvec.h

WRAP    arch/arm/include/generated/asm/bitsperlong.h
  WRAP    arch/arm/include/generated/asm/cputime.h
  WRAP    arch/arm/include/generated/asm/emergency-restart.h
  WRAP    arch/arm/include/generated/asm/errno.h
  WRAP    arch/arm/include/generated/asm/ioctl.h
  WRAP    arch/arm/include/generated/asm/irq_regs.h
  WRAP    arch/arm/include/generated/asm/kdebug.h
  WRAP    arch/arm/include/generated/asm/local.h
  WRAP    arch/arm/include/generated/asm/local64.h
  WRAP    arch/arm/include/generated/asm/percpu.h
  WRAP    arch/arm/include/generated/asm/poll.h
  WRAP    arch/arm/include/generated/asm/resource.h
  WRAP    arch/arm/include/generated/asm/sections.h
  WRAP    arch/arm/include/generated/asm/siginfo.h
  WRAP    arch/arm/include/generated/asm/sizes.h
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTCC  scripts/genksyms/genksyms.o

HOSTCC  scripts/dtc/dtc.o
scripts/dtc/dtc.c: In function ‘main’:
scripts/dtc/dtc.c:102:17: warning: variable ‘check’ set but not used [-Wunused-but-set-variable]
  int force = 0, check = 0, sort = 0;
                 ^
  HOSTCC  scripts/dtc/flattree.o
scripts/dtc/flattree.c: In function ‘flat_read_mem_reserve’:
scripts/dtc/flattree.c:700:14: warning: variable ‘p’ set but not used [-Wunused-but-set-variable]
  const char *p;
              ^
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTLD  scripts/genksyms/genksyms
  CC      scripts/mod/empty.o
/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 1: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: ELF: not found

/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 2: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: @@@@@@00pp@p@@@d
                                                                           d
                                                                             : not found
/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 3: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: Syntax error: word unexpected (expecting ")")
make[2]: *** [scripts/mod/empty.o] Errore 2
make[1]: *** [scripts/mod] Errore 2
make[1]: *** Attesa per i processi non terminati....
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  HOSTCC  scripts/dtc/treesource.o
  Generating include/generated/mach-types.h
  CC      kernel/bounds.s
/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 1: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: ELF: not found

/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 2: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: @@@@@@00pp@p@@@d
                                                                           d
                                                                             : not found
/home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: 3: /home/farox/arm-gcc-4.9.3/bin/arm-unknown-linux-gnueabi-gcc: Syntax error: word unexpected (expecting ")")
make[1]: *** [kernel/bounds.s] Errore 2
make: *** [prepare0] Errore 2
make: *** Attesa per i processi non terminati....
  HOSTCC  scripts/dtc/util.o
  HOSTLD  scripts/dtc/dtc
make: *** [scripts] Errore 2
farox@farox-VirtualBox:~/pandora-kernel$
 Thanks for the help.
 
Thanks Seb...i need to do another VM because the previous is near full...and building a toolchain need space.

I hope on the weekend... :)
 
Thanks Seb...i need to do another VM because the previous is near full...and building a toolchain need space.

I hope on the weekend... :)

Yeah, I know that issue! Had to resize my VM from a 40Go to 100Go, (LibreOffice + PaleMoon...)
 
If anyone wants to try a crosscompile, here is a script to build a cross compile env in linux with binutils 2.25.1, gcc/g++ 4.9.3 and glibc 2.9: http://ptitseb.openpandora.org/crosscompilemaker.sh

The script download everything and patch and compile everything, so it will take some time... 

(Maybe I should make a dedicated post in the dev section if there is enough interest)

I' sorry to report that the script does not work for me

View attachment 12489
I need the logs of the script.

*EDIT* maybe not: it seems your "make" is too old (line 658 of the config.log)... Try to update it ? (or compile it from sources) 
 
Last edited by a moderator:
If anyone wants to try a crosscompile, here is a script to build a cross compile env in linux with binutils 2.25.1, gcc/g++ 4.9.3 and glibc 2.9: http://ptitseb.openpandora.org/crosscompilemaker.sh

The script download everything and patch and compile everything, so it will take some time... 

(Maybe I should make a dedicated post in the dev section if there is enough interest)

I' sorry to report that the script does not work for me

View attachment config.log
I need the logs of the script.

*EDIT* maybe not: it seems your "make" is too old (line 658 of the config.log)... Try to update it ? (or compile it from sources) 
What version of make is expected? Debian has nothing newer, even not in SID.

sle@sle3:/usr/src/openpandora-toolchain$ make -v
GNU Make 4.0
...
 
Mmmm, not sure. May be it's too new? On my Mint, I have 3.81. I suspect the configure checks for make 3.XX and doesn't understand 4.0

I'll try to patch the configure to remove this limitation....
 
@pitSeb: Please wait with the release of version 1.1, I have another error "Make error of mixed implicit and normal rules" in step 7
 
@pitSeb: Please wait with the release of version 1.1, I have another error "Make error of mixed implicit and normal rules" in step 7

Oh, never got that one?! So make 4.0 not really compatible for glibc? You will probably have to go back to step 5 if you want to patch configure again I guess (edit pandora_cross/.current to change recovery step).
 
@pitSeb: Please wait with the release of version 1.1, I have another error "Make error of mixed implicit and normal rules" in step 7

Oh, never got that one?! So make 4.0 not really compatible for glibc? You will probably have to go back to step 5 if you want to patch configure again I guess (edit pandora_cross/.current to change recovery step).
@pitSeb: Please wait with the release of version 1.1, I have another error "Make error of mixed implicit and normal rules" in step 7
Oh, never got that one?! So make 4.0 not really compatible for glibc? You will probably have to go back to step 5 if you want to patch configure again I guess (edit pandora_cross/.current to change recovery step).
make 4.0 is not compatible with glibc-2.9 (current is 2.22). The attachment is another patch on top of the first for step 5 to fix the above error.

EDIT: Did I say the the build finished with the patch applied?

View attachment diff

View attachment diff
 
Last edited by a moderator:
Back
Top