How to connect to a Wi-Fi network on i.MX8MP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to connect to a Wi-Fi network on i.MX8MP

How to connect to a Wi-Fi network on i.MX8MP

Materials:

  • i.MX8M Plus EVK Rev. A
  • USB cable type-C
  • USB cable type-B
  • AC Adapter EA1045CR
  • Micro SD (Optional)
  • 88W8997-based wireless modules

Software:

  • Yocto Project
  • Mobaxterm Personal Edition v20.2 Build 4296
  • This test was done on an i.MX8M Plus EVK with Linux 5.10. Hardknott.

 

To achieve this, you need to identify your WI-FI module and look for the necessary drivers for that module, in my case I am using the 88W8997 module that comes with the i.MX8M Plus, but you can select any other WI-FI module you want.

 

  1. In my case I build a basic image on Yocto, following the Yocto users guide, I bitbake just the core boot image that allows me to boot the i.MX8M plus.
  2. Deploy your image on an SD or eMMC.

These instructions apply to SD and MMC cards although for brevity, and usually, only the SD card is listed.

For a Linux image to be able to run, four separate pieces are needed:

  • Linux OS kernel image (zImage/Image)
  • Device tree file (*.dtb)
  • Bootloader image
  • Root file system (i.e., EXT4)

 

The Yocto Project build creates an SD card image that can be flashed directly. This is the simplest way to load everything needed onto the card with one command.

A .wic image contains all four images properly configured for an SD card. The release contains a pre-built .wic image that is built specifically for the one board configuration. It runs the Wayland graphical backend. It does not run on other boards unless U-Boot, the device tree, and rootfs are changed. When more flexibility is desired, the individual components can be loaded separately, and those instructions are included here as well. An SD card can be loaded with the individual components one-by-one or the .wic image can be loaded and the individual

parts can be overwritten with specific components.

The rootfs on the default .wic image is limited to a bit less than 4 GB, but re-partitioning and re-loading the rootfs can increase that to the size of the card. The rootfs can also be changed to specify the graphical backend that is used.

Carry out the following command to copy the SD card image to the SD/MMC card. Change sdx below to match the one used by

the SD card.

$ sudo dd if=<image name>.wic of=/dev/sdx bs=1M && sync

The entire contents of the SD card are replaced. If the SD card is larger than 4 GB, the additional space is not accessible.

As this build does not contain the driver integrated we need to add it manually on Linux user space.

  1. Follow these instructions to load the driver modules and bring up the 88W8987-based wireless module, more info can be found on the next link: https://www.nxp.com/products/wireless/wi-fi-plus-bluetooth/2-4-5-ghz-dual-band-2x2-wi-fi-5-802-11ac-...

 

Use the nano editor included in the pre-built image to edit and verify the module parameters in the wifi_mod_para.conf configuration file.

nxf63675_0-1637803047960.png

 

Add the following lines to the configuration file:

PCIE8997 = {

cfg80211_wext=0xf

wfd_name=p2p

max_vir_bss=1

cal_data_cfg=none

drv_mode=7

ps_mode=2

auto_ds=2

fw_name=nxp/pcieuart8997_combo_v4.bin

}

Load the modules in the kernel:

nxf63675_1-1637803047961.png

 

Verify the kernel debug messages in the command output

nxf63675_2-1637803047979.png

 

Verify that the module is now visible to the system:

nxf63675_3-1637803047979.png

 

nxf63675_4-1637803048004.png

 

  1. Now that the module is ready to work, we need to enable it, in my case the Wi-Fi is named mlan0, it could vary on other Linux systems.
nxf63675_5-1637803048026.png

 

  1. In the case you need to see which networks are available you can scan it and select the one you need.
nxf63675_6-1637803048028.png

 

  1. Identify your network and add it to the  WPA supplicant file:
nxf63675_7-1637803048029.png

 

nxf63675_8-1637803048031.png

 

  1. Associate the Wi-Fi with config:
nxf63675_9-1637803048041.png

 

  1. Check if you have right SSID associated:
nxf63675_10-1637803048049.png

 

  1. Use DHPC to get the IP
nxf63675_11-1637803048057.png

 

  1. Ping any public site you know to check the network.nxf63675_12-1637803048071.png

     

  2. In the case you have a Temporary failure in name resolution you will need to change the default DNS that was assigned by DHCP:
nxf63675_13-1637803048072.png

 

 

Modify /etc/resolv.conf file and add the DNS of your preference, for my case I add the one that uses Google, as they have access to the most common web pages.

nxf63675_14-1637803048072.png

 

And with that should work.

nxf63675_15-1637803048085.png

 

 

Labels (2)
No ratings
Version history
Last update:
‎11-24-2021 06:21 PM
Updated by: