Building Driver for ASUS USB-AC-53 Nano Wi-Fi Adapter

I have this great tiny USB Wi-Fi dongle which I’d like to use to avoid requiring an Ethernet cable.

I found driver source code for this exact adapter here: https://github.com/jeremyb31/rtl8822bu
But after modifying CONFIG_PLATFORM_* in the Makefile as instructed, ‘make’ gives me a few errors:

make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.9.108-tegra/build M=/home/ubuntu/Development/rtl8822bu modules
make[1]: Entering directory '/usr/src/linux-headers-4.9.108-tegra'
  CC [M]  /home/ubuntu/Development/rtl8822bu/core/rtw_cmd.o
gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
gcc: error: unrecognized command line option ‘-mapcs’; did you mean ‘--specs’?
gcc: error: unrecognized command line option ‘-mno-sched-prolog’; did you mean ‘-Wno-sign-promo’?
gcc: error: unrecognized command line option ‘-msoft-float’
scripts/Makefile.build:297: recipe for target '/home/ubuntu/Development/rtl8822bu/core/rtw_cmd.o' failed
make[2]: *** [/home/ubuntu/Development/rtl8822bu/core/rtw_cmd.o] Error 1
Makefile:1527: recipe for target '_module_/home/ubuntu/Development/rtl8822bu' failed
make[1]: *** [_module_/home/ubuntu/Development/rtl8822bu] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.108-tegra'
Makefile:1318: recipe for target 'modules' failed
make: *** [modules] Error 2

Apparently it’s only been tested on ARMv7 before. Running ‘ARCH=arm64 make’ instead gives me:

make ARCH=arm64 CROSS_COMPILE= -C /lib/modules/4.9.108-tegra/build M=/home/ubuntu/Development/rtl8822bu modules
make[1]: Entering directory '/usr/src/linux-headers-4.9.108-tegra'
  CC [M]  /home/ubuntu/Development/rtl8822bu/core/rtw_cmd.o
/bin/sh: 1: scripts/basic/fixdep: Exec format error
scripts/Makefile.build:297: recipe for target '/home/ubuntu/Development/rtl8822bu/core/rtw_cmd.o' failed
make[2]: *** [/home/ubuntu/Development/rtl8822bu/core/rtw_cmd.o] Error 2
Makefile:1527: recipe for target '_module_/home/ubuntu/Development/rtl8822bu' failed
make[1]: *** [_module_/home/ubuntu/Development/rtl8822bu] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.108-tegra'
Makefile:1318: recipe for target 'modules' failed
make: *** [modules] Error 2

Checking ‘file /usr/src/linux-headers-4.9.108-tegra/scripts/basic/fixdep’ output:

/usr/src/linux-headers-4.9.108-tegra/scripts/basic/fixdep: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=abc0f3338adbac158818634095c5377e12ed23a2, not stripped

So these are x86-64 binaries, not ARM64. I’m not sure if it came pre-installed like that, or if I did something wrong earlier. Looks like kernel related code/tools, and I have no prior experience with that.

Anyone got any advice on how to build a driver on Xavier, or know a different way to get this Wi-Fi dongle working? Thanks!

This confirms you are not using cross-compile tools (or at least part of it is not set up correctly):

/bin/sh: 1: scripts/basic/fixdep: Exec format error

I have not yet tried compiling this kernel, I am still working on other things. However, have you tried building this natively on the Xavier itself? There should be no problem in doing so, and then you don’t even need to specify ARCH or any tools since it is native. You may want to install this since menuconfig and nconfig (and anything command line) might use this:

sudo apt-get install libncurses5-dev

Building it natively on Xavier is what I was doing (sorry, should have mentioned that). Which is why I was surprised that scripts/basic/fixdep was an x86 executable. It’s quite possible this is due to me installing the wrong package at some point. That said, the path is /usr/src/linux-headers-4.9.108-tegra/ so I’m not sure where I would have gotten a tegra-specific package with x86 binaries.

Could anyone tell me if they have the same linux-headers directory, and if the fixdep executable is ARM or not?

If you are building natively, then don’t specify any ARCH. I see this kernel has the driver without needing external source (I am guessing you downloaded something from github):

CONFIG_RTL8822BE

I don’t know if it will help, but here are some notes on native compile (you’d use the source code downloaded from NVIDIA’s R31.0.1 web page rather than source_sync.sh, but mostly the procedure is identical without regard to TK1/TX1/TX2/Xavier):
https://devtalk.nvidia.com/default/topic/1038175/jetson-tx2/tx2i-wifi-support/post/5274619/#5274619

Many of the WiFi devices also require adding the “linux-firmware” package:

sudo apt-get install linux-firmware

I had this same issue (also on Xavier but for an RTL8812au dongle) and resolved it by following the instructions here:
https://www.jetsonhacks.com/2017/03/25/build-kernel-and-modules-nvidia-jetson-tx2/ but modified the scripts for L4T R31.0.1: https://github.com/davidjun/buildJetsonTX2Kernel

If you use the -tegra local version identifier, note that the scripts will overwrite the existing fixdep executable with a native binary.

After your system is set up to compile the kernel and modules natively, compile your wifi driver using ARCH=arm64.

Success! I’m sending this from the device with no Ethernet cable connected. Getting impressive 80 Mbps out of this tiny dongle. Thanks folks!

Hey @capn8cg27 , could you please share your steps. I am facing exact problem, you described in original post. It’s on jetson nano, but issue is the same. But am less familiar with linux kernels, so I’d need some tips… :D

Uhh my third GitHub driver install attempt seems to be working at last!
I followed https://github.com/cilynx/rtl88x2BU_WiFi_linux_v5.3.1_27678.20180430_COEX20180427-5959
which seems to be working out of the box with arm64/tegra

As stated before. Please show your process. Some of us are having the same problem.

I have wifi dongle: tp-link C 1300; Archer T4U version 3; USB id 2357:0115 . I tried to use it with my Jetson Nano.
It was pain. I will not go to details there… I hope my post will help to reduce future pain of someone…

Finally I got working with https://github.com/jeremyb31/rtl8822bu
Steps:

  • Unplug wifi dongle - not sure if I need this but stay on safe side
  • Clone: (git clone https://github.com/jeremyb31/rtl8822bu; cd rtl8822bu)
  • Compile: ARCH=arm64 make -j4
  • Install: sudo make install
  • Reboot - not sure if I need this but stay on safe side
  • Check if working: nmcli d wifi list
  • Connect to wifi: sudo nmcli device wifi connect <MY_WIFI> password <MY_PASSWORD>
  • Enjoy it
2 Likes