Installing the wireless USB adapter Edimax EW-7811Un in an embedded device

By | July 20, 2014

Recently, I needed to install and configure a Wireless 802.11/b/g/n USB Adapter in an ARM-based device that runs a 2.6.35 Linux. The adapter was an Edimax EW-7811Un.

There are several wireless USB adapters that run under Linux, you can have a look at the official site here for supported devices and their chipsets. However, this list is far from complete and out-dated.
Of course, the chipsets listed in this site are the ones inside the mainline kernel, but several vendors provide drivers that for one reason or another are not part of the mainline kernel and we have to compile them out-of-tree.

This was my case because I’m using an old 2.6.35 kernel and the 8192cu.ko driver was not part of the mainline kernel. It was included in the 2.6.39 under the name rtl8192cu.ko.

The Makefile provided is for compiling for an i386 based processor, so I created this small patch for compiling for an AT91 ARM processor. You could do the same by just changing the CONFIG_PLATFORM_ARM_AT91 by the one that defines your processor.

As you can see from the above patch, I’m using the kernel provided by buildroot as the sources for building the driver, but you can change the KSRC variable as you need.

Now you can build the driver with the ARCH and CROSS_COMPILE environment variables according to your platform and toolchain. In my case, I have an ARM processor (an AT91SAM9 from STMicroelectronics).

For testing quickly the driver in your embedded device you can copy it to the rootfs and insmod’it:

I’ve been using this driver for several months and it is quite stable using different WPA encryption methods with b/g wireless networks.

That’s it!

Leave a Reply

Your email address will not be published. Required fields are marked *