Atlas200l DK A2 uses AX210 wireless network card to connect to WIFI

1. Environmental information

If the kernel version is the same, you can directly use the driver module we compiled. If you use another version of the kernel, you can also refer to 4. Development process and manually compile the driver module yourself.

Mirror: Ubuntu 22.04

CANN version: 6.2.RC2.alpha001

Kernel version (uname -r to view): 5.10.0

2. Installation ideas

  1. The development board can recognize the AX210 network card normally.

# Any terminal call
lspci
# Display the following information
04:00.0 Network controller: Intel Corporation Wi-Fi 6 AX210/AX211/AX411 160MHz (rev 1a)
  1. You only need to install the appropriate driver for AX210: iwlwifi, and you can use wifi.

  2. Driver: The iwlwif driver module (.ko file) is inserted into the kernel. You need to use iwlwifi.ko and iwldvm.ko andiwlmvm.ko. In addition, you need to load the Ax210wireless network card firmware (iwlwifi-ty-a0-gf-a0-59.ucode, etc.) corresponding to the kernel version so that the kernel can recognize the wireless network card driver.

  3. Please note: cfg80211.ko and mac80211.ko will not be compatible with the current iwlwifi driver module. Reinstall. Attached is an introduction to the two modules:

    ? cfg80211.ko : Used for configuration management of wireless devices.

    ? mac80211.ko: It is a framework for driver developers to write drivers for wireless devices.

3. Install driver

If the kernel version (5.10.0) is consistent, you can directly use our compiled kernel module .ko file.

a. Uninstall the old module and USB network card driver

Enter the kernel module root directory, mine is /lib/modules/5.10.0 +

cd /lib/modules/$(uname -r) 

Uninstall the modules mac80211.ko, cfg80211.ko and USB network card driver (it is best to run as root)

sudo rmmod rtl8192cu
sudo rmmod rtl8192c_common
sudo rmmod rtl_usb
sudo rmmod rtlwifi
sudo rmmod mac80211
sudo rmmod cfg80211

If you encounter an error similar to: ERROR: Module mac80211 is in use by: rtl_usb rtl8192cu rtlwifi

This means that this kernel module is used by subsequent modules, so the subsequent modules must be uninstalled first. The command is the same sudo rmmod kernel module name

Delete the RTL8192CU (USB network card driver) module files (to prevent automatic import during startup and affect the startup of the Ax210 driver module). In addition, you can also move them to the Recycle Bin.

sudo rm rtl8192cu.ko
sudo rm rtl8192c_common.ko
sudo rm rtl_usb.ko
sudo rm rtlwifi.ko
sudo rm mac80211.ko
sudo rm cfg80211.ko

b. Upload driver files to the development board

Baidu Cloud download requires cfg80211.ko, mac80211.ko, and iwlwifi .ko, iwldvm.ko and iwlmvm.ko module files and related .ucode file

Link: Baidu Cloud Disk Please enter the extraction code Baidu Cloud Disk provides you with network backup, synchronization and sharing services for files. Large space, fast speed, safe and stable, supports education network acceleration, and supports mobile phones. Register to use Baidu Netdisk to enjoy free storage spaceicon-default.png?t=N7T8https://pan.baidu.com/s/1M7UYh7Prq5EWDG-QRf4FvQ?pwd =416j

Upload all .ko files in the folder: “ko files” to /lib/modules/5.10.0 +

Upload all .ucode files in the folder: “UCODE files” to /lib/firmware

c. Install kernel module

(Under the directory /lib/modules/5.10.0 +)

The installation order is cfg80211.ko, mac80211.ko, iwlwifi.ko code>, iwldvm.ko, iwlmvm.ko

sudo insmod cfg80211.ko
sudo insmod mac80211.ko
sudo insmod iwlwifi.ko
sudo insmod iwldvm.ko
sudo insmod iwlmvm.ko 

Use the modprobe command to manually load all modules into the kernel to achieve self-starting (run as root)

sudo depmod -a # Update kernel module dependencies
modprobe cfg80211
modprobe iwlwifi
modprobe iwldvm
modprobe iwlmvm

Restart the development board

sudo reboot

Now click on the wifi icon in the upper left corner of the screen on the development board to enable wifi.

4. Development process

Here we will introduce in detail how to obtain the .ko file used by the iwlwifi driver above. It can be compared to the installation of other driver modules, such as the USB wireless network card driver rtl8192cu.

a. Problem background

Since the kernel of the image is officially compiled manually through cross-compilation, it is missing the kernel header file, so the driver cannot be installed online, nor can the driver source code be downloaded and compiled and installed using make . At the same time, the kernel header files cannot be installed over the Internet. Therefore, we can only download the official kernel source package and compile the entire kernel once. Since the official kernel source package contains many drivers (iwlwifi drivers are also included), we only need to set the corresponding configuration. After compilation, we can find the .ko we need in the generated kernel module. document.

b. Reference tutorial

The following tutorial is a tutorial for compiling the USB wireless network card of rtl8192cu . On this basis, I adjusted the configuration to compile the iwlwifi Ax210 driver.

https://www.hiascend.com/forum/thread-0260121075301055016-1-1.html

Notice:

  1. To distinguish the development environment, we use cross-compilation for the development version of the kernel, that is, the process of compiling the kernel and obtaining the module .ko file is all implemented on the computer ( Ubuntu dual system or virtual machine based on AMD architecture. At the same time, the version of the Ubuntu system on the computer is not very demanding, 18.04 and 22.04 are both acceptable). Installation of .ko module file is implemented in the development version (Reference: 3. Installing the driver)

  2. Compiling the kernel requires installing relevant support libraries (in the computer). (When running bash build.sh kernel, according to the error message, what package is missing)

    apt-get install bison
    apt-get install flex
    sudo apt-get install libssl-dev
  3. In the graphical configuration interface of the compiled kernel, you must not change the name when Save, keep the name as .config. Kernel compilation only uses the configuration in .config . If the name is changed to another name, the kernel will still follow the initial .config code> compile, the problem appears as: Why is the driver set, but the corresponding .ko file does not appear after compilation?

Configuration adjustments:

1. Generate mac80211.ko and cfg80211.ko (this is the same as the tutorial)

Networking support --> Wireless -> Select the corresponding module (press M or space on the keyboard, and use the up, down, left, and right keys to control options)

2. Generate iwlwifi.ko, iwldvm.ko and iwlmvm.ko code>’s configuration

Device Drivers --> Network device support --> Wireless LAN --> Select to generate the corresponding module

3. Press Esc continuously to exit the configuration interface and wait patiently for the compilation to complete.

4. The generated .ko file is located in Ascend310B-source/output/kernel_modules/

c. Extended use

In the directory of the official source package, we call bash build.sh kernel to compile the kernel. This build.sh Many commands are integrated into the file and can be taken out and used separately.

Note: The kernel file development directory is located at: Ascend310B-source/kernel/kernel/kernel/out/linux-4.19 (Although the directory is written as 4.19, The actual version is still 5.10.0)

Optimization: You only need to compile the kernel once. If you add a driver later, only the .config newly added driver will be compiled. document. (The following is the second compilation process, which needs to be located in the kernel file development directory)

Support user-defined kernel configuration options, interactive pop-up menu options

make ARCH=arm64 CROSS_COMPILE=aarch64-target-linux-gnu- menuconfig

Compile kernel module

make ARCH=arm64 CROSS_COMPILE=aarch64-target-linux-gnu-modules-j16

The compiled .ko file may appear in Ascend310B-source/kernel/kernel/kernel/out/linux-4.19/drivers and can be used locateLocate

syntaxbug.com © 2021 All Rights Reserved.