Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Cross Compile MT7610U Driver for RPi2/3

Cross Compile MT7610U Driver for RPi2/3

$ mkdir bcm-staging
$ export WORK=`pwd`/bcm-staging

RPi2/3 Kernel

Setup toolchain

$ cd ${WORK}
$ git clone
$ export PATH=${PATH}:`pwd`/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin


$ cd ${WORK}
$ git clone -b rpi-4.4.y
$ cd linux
$ export KERNEL=kernel7
$ export ARCH=arm
$ export CROSS_COMPILE=arm-linux-gnueabihf-
$ make bcm2709_defconfig
$ make -j 4 zImage modules dtbs

MT7610U Driver


$ cd ${WORK}
$ git clone -b rpi
$ cd mt7610u_wifi_sta_v3002_dpo_20130916
$ export PI_SRC=${WORK}/linux
$ make


Copy driver files over rootfs. (Kernel version may vary.)

Note: Ideally, you should use the kernel built above. But the driver may work while the kernel version 4.4 is used.

$ cp ./os/linux/mt7650u_sta.ko ${RPI_ROOTFS}/modules/4.4.21-v7+
$ mkdir -p ${RPI_ROOTFS}/etc/Wireless/RT2870STA
$ cp RT2870STA.dat ${RPI_ROOTFS}/etc/Wireless/RT2870STA

Add the following line on /etc/network/interfaces

allow-hotplug ra0
iface ra0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

On Raspberry PI system, do depmod.

# depmod -a

This comment has been minimized.

Copy link

@danielschmalhofer danielschmalhofer commented Feb 13, 2020

i get this error :(

pi@raspberrypi:~/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916 $ make
make -C tools
make[1]: Entering directory '/home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory '/home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/tools'
chipset = mt7650u
chipset = mt7630u
chipset = mt7610u
cp -f os/linux/Makefile.6 /home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/Makefile
make -C /home/pi/bcm-staging/linux SUBDIRS=/home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux modules
make[1]: Entering directory '/home/pi/bcm-staging/linux'

WARNING: Symbol version dump ./Module.symvers
is missing; modules will have no dependencies and modversions.

CC [M] /home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/../../os/linux/rt_profile.o
In file included from include/linux/mmzone.h:18:0,
from include/linux/gfp.h:5,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/include/os/rt_linux.h:31,
from /home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/include/rtmp_os.h:44,
from /home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/include/rtmp_comm.h:75,
from /home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/include/rt_config.h:33,
from /home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/../../os/linux/rt_profile.c:28:
include/linux/page-flags-layout.h:5:30: fatal error: generated/bounds.h: No such file or directory
#include <generated/bounds.h>
compilation terminated.
scripts/ recipe for target '/home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/../../os/linux/rt_profile.o' failed
make[2]: *** [/home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux/../../os/linux/rt_profile.o] Error 1
Makefile:1402: recipe for target 'module/home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux' failed
make[1]: *** [module/home/pi/bcm-staging/mt7610u_wifi_sta_v3002_dpo_20130916/os/linux] Error 2
make[1]: Leaving directory '/home/pi/bcm-staging/linux'
Makefile:399: recipe for target 'LINUX' failed
make: *** [LINUX] Error 2


This comment has been minimized.

Copy link

@tdwebste tdwebste commented Aug 9, 2020

Did you find a way to generate the bounds.h file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.