NXPi.MX6ULL porting RTL8188 WiFi module

Project scenario:

stay Overlooking Electronics Porting Python 3.9.5 to TW-AC6G-EVM development board:

Compilation environment and development package:
Host: Ubuntu 18.04
Cross compiler: arm linux gnueabihf GCC
QT5.12.8: qt-everywhere-opensource-src-5.12.8
Development board: TW-AC6G-EVM
Linux: Linux-4.1.15
Serial port tool: Xshell

Note: all commands in this article refer to the path of overlooking the official electronic environment, which needs to be changed according to its own actual environment. The platform demonstrated in this paper comes from the overlooking electronic iMX6ULL ARM embedded platform, which is a core board based on NXP iMX6ULL ARM processor with a main frequency of 800MH in Cortex-A7.


1. Add WIFI driver to Linux kernel

The RTL8188CUS/RTL8192CU chip driver source code is stored in the realtek directory. RTL8188CUS and RTL8192CU drivers are stored under RTL8192CU. The Kconfig file is a WIFI driven configuration interface document.

1.1 remove the RTL8192CU driver from the Linux kernel

Open drivers / net / wireless / rtlwwifi / kconfig in the Linux kernel source directory, find the contents contained in the red block diagram shown in Figure 1.1 and delete it.

Open drivers/net/wireless/rtlwifi/Makefile in the Linux kernel source directory, find the following contents and mask them (shield the RTL8192CU/RTL8188CU driver provided by the kernel).

obj-$(CONFIG_RTL8192CU) += rtl8192cu/

1.2 add RTL8192CU(RTL8188CU) driver to Linux kernel

Copy the entire directory of realtek to the drivers/net/wireless directory in the Linux kernel source code under Ubuntu.
Open drivers/net/wireless/Kconfig and add the following line at the end:

source "drivers/net/wireless/realtek/Kconfig"

Add the above content, and the WIFI driver configuration interface will appear on the Linux kernel configuration interface.

Open drivers/net/wireless/Makefile and add the following line at the end:

obj-y += realtek/

1.3 WIFI configuration in Linux kernel

1. Configure USB support devices
The configuration path is as follows:

-> Device Drivers
-> <*> USB support
-> <*> Support for Host-side USB
-> <*> EHCI HCD (USB 2.0) support
-> <*> OHCI HCD (USB 1.1) support
-> <*> ChipIdea Highspeed Dual Role Controller
-> [*] ChipIdea device controller
-> [*] ChipIdea host controller

2. Configure WIFI enabled devices
The configuration path is as follows:

-> Device Drivers
-> [*] Network device support
-> [*] Wireless LAN
-> <*> IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)
-> [*] Support downloading firmware images with Host AP driver
-> [*] Support for non-volatile firmware download

3. The configuration supports IEEE 802.11
The configuration path is as follows:

-> Networking support
-> -*- Wireless
-> [*] cfg80211 wireless extensions compatibility
-> <*> Generic IEEE 802.11 Networking Stack (mac80211)

1.4 compile RTL8192CU(RTL8188CU) driver

Execute the "make menuconfig" command in the Linux kernel source directory, open the Linux kernel configuration interface, and then select the following path to compile the RTL8192CU driver into a module:

-> Device Drivers
-> Network device support (NETDEVICES [=y])
-> Wireless LAN (WLAN [=y])
-> Realtek wifi (REALTEK_WIFI [=m])
-> rtl8189ftv sdio wifi
-> rtl8188eus usb wifi
-> Realtek 8192C USB WiFi

The configuration results are shown in Figure 1.2:

Execute the following command to compile the driver module:

make  modules  -j12 

After compilation, the. Ko file 8192cu.ko will be in the rtl8192CU folder, and 8192cu.ko will be copied to the development board / lib/modules/4.1.15 directory.
The Linux kernel has been reconfigured, so you also need to start with a new zImage.

1.5 wiif drive loading test

Insert the RTL8188CU module into the USB HOST interface of the development board, enter the directory lib/modules/4.1.15, and enter the following command to load the 8192cu.ko driver module:

modprobe 8192cu.ko  //Or modprobe 8192cu

After the driver is loaded, enter the "ifconfig -a" command to check whether the network card exists (generally wlan0). If wlan0 exists, the driver is loaded successfully.

2.RTL8188CU networking test

2.1 configure WIFI network

First, create a configuration file named "wpa_supplicant.conf" in the / etc directory of the root file system of the development board. This file is used to configure the WIFI hotspot to be connected and the WIFI password.
Example: WiFi Name: TWDZ WiFi password: tw12345678

wpa_ The contents of the supplicant.conf file are as follows:


2.2 connecting WIFI

When you are ready, you can use WPA_ Use the supplicant tool to connect the RTL8188 USB WIFI to the hotspot, and enter the following command:

cd  /etc
wpa_supplicant -D wext -B -i wlan0 -c wpa_supplicant.conf

Get IP address command:

udhcpc -i wlan0

As shown in Figure 2.2, the IP address of WLAN 0 is

Use wlan0 to ping Baidu website on the development board, and enter the following command:

ping -I www.baidu.com

Keywords: Linux Operation & Maintenance wifi

Added by kharbat on Wed, 27 Oct 2021 08:23:03 +0300