[Beijing Xunwei] i.MX6ULL Terminator Linux WIFI driver experiment wifi driver addition and compilation

The RTL8723 wifi module with usb interface is used on the i.MX6UL Terminator development board. The schematic diagram is shown in Figure 1:
Insert picture description here

figure 1

It can be seen that the interface of the RTL8723 module is very simple, only DP1 and DM1 are connected to the usb HUB chip to complete the communication circuit. RTL8723 is the wifi chip of realtek company. The wifi driver source code has been provided, so we don't need to write it by ourselves. Just add the provided wifi driver source code to the Linux kernel for compilation.

1.1 Add wifi driver in Linux kernel

First obtain the wifi driver source code and put it under the Linux kernel drivers/net/wireless directory, as shown in Figure 1.1.1:
Insert picture description here

Figure 1.1.1

The contents of the rtl8723BU directory are shown in Figure 1.1.2:
Insert picture description here

Figure 1.1.2

The Kconfig file is the configuration file of the rtl8723 driver, so you can choose whether to compile the WIFI driver through the Linux kernel graphical configuration interface. The content of the Kconfig file is as follows:

config RTL8723BU
        tristate "Realtek 8723B USB WiFi"
        depends on USB
        ---help---
          Help message of RTL8723BU

After adding the rtl8723 wifi driver, you need to modify the previous Kconfig and Makefile.
Modify drivers/net/wireless/Kconfig and add the following content:
source "drivers/net/wireless/rtl8723BU/Kconfig" is
added as shown in Figure 1.1.3:
Insert picture description here

Figure 1.1.3

After the addition is complete, the configuration options of rtl8723 will appear on the driver configuration interface of the Linux kernel.
Modify the drivers/net/wireless/Makefile and add the following content:
obj-$(CONFIG_RTL8723BU) += rtl8723BU/
After modification, as shown in Figure 1.1.4:
Insert picture description here

Figure 1.1.4

1.2 Configure the Linux kernel

After adding the rtl8723 wifi driver and modifying the configuration file, you need to configure it in the Linux kernel.
1. Configure the
Linux kernel configuration path for supporting USB devices as follows:

Device Drivers  --->
[*] USB support  --->
<*>     EHCI HCD (USB 2.0) support
<*>   ChipIdea Highspeed Dual Role Controller
[*]     ChipIdea device controller
[*]     ChipIdea host controller

The configuration is completed as shown in Figure 1.2.1 below:
Insert picture description here

Figure 1.2.1

2. Configure the
Linux kernel configuration path for supporting wifi devices 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

The configuration is completed as shown in Figure 1.2.2:
Insert picture description here

Figure 1.2.2

3. Configuration support IEEE 802.11
Linux kernel configuration path is as follows:

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

The configuration is completed as shown in Figure 1.2.3:
Insert picture description here

Figure 1.2.3

4. Configure the rtl8723 wifi driver
Linux kernel configuration path as follows:

Device Drivers  --->
[*] Network device support  --->
[*]   Wireless LAN  --->
<*>   Realtek 8723B USB WiFi

The configuration result is shown in Figure 1.2.4:
Insert picture description here

Figure 1.2.4

Directly compile the driver of the rtl8723 wifi module into the kernel.

After the above Linux kernel configuration is completed, recompile the kernel to generate zImage, and use the new zImage to start the development board.

1.3 Rtl8723 wifi module driver test

Use the new zImage image to start the development board, and the information shown in Figure 1.3.1 will be printed during system startup:
Insert picture description here

Figure 1.3.1

The figure above shows that the driver of the rtl8723 wifi module is used during the boot process of the Linux system. When the driver is started, use the "ifconfig -a" command to check whether the wlan network card exists, and the result is shown in Figure 1.3.2:
Insert picture description here

Figure 1.3.2

You can see that there is a wlan0 device, which is the network card device corresponding to the rtl8723 wifi module. It means that the driver test is normal, but if you want to connect to the Internet, you need third-party components. Let's take a look at how to use third-party components for networking testing.
Insert picture description here

Guess you like

Origin blog.csdn.net/BeiJingXunWei/article/details/112858002