WL12xx NLCP Calibration Process

From Texas Instruments Wiki
Jump to: navigation, search

Introduction

This page describes the procedure needed for calibrating the TI WL12xx devices. The following chapters are provided:

  • Calibration Overview
  • Calibration Steps
  • Choosing an INI File
  • Generating an NVS Reference File
  • Performing the First Calibration
  • Example


Calibration Getting Started

Calibration is a process of determining radio parameters for a specific chip. These configuration parameters are suitable to the specific chip with its unique design. Therefore, the calibration parameters are sent back to the driver to be stored in non-volatile memory for later use. Upon initialization, the WL12xx driver loads an NVS file, where it expects to read those calibration parameters and send them to the chip. The NVS file includes two main parts: one stores the calibration parameters and the other stores the initialization information required for the WL12xx driver.

Prerequisites

Before starting the calibration process, it is assumed that the board is connected to the PC and is controlled through the serial port via the serial port application. It is also assumed that the board is already booted and shows the Linux prompt.

Calibration Steps

The SDK package contains the calibrator tool, which provides two major functionalities: creating an NVS file and calibrating your chip. The process is composed of the following steps:

  • Selecting the ini file based on the WiFi module that is used for the initialization data
  • Using the calibrator to generate a reference NVS file (Note: the filename wl1271-nvs.bin will always be generated no matter even if you use wl128x and wl18xx devices)
  • Performing the first calibration
  • Detailed description of the calibration process

Selecting the INI File

The selected INI file will be used in the future, providing the initialization data needed for performing the calibration process properly. Thus, it is important to carefully select the correct INI file; otherwise the performed calibration will not acheive an accurate outcome.
The SDK package includes the relevant files under the directory: /usr/share/ti/wifi-utils/ini_files/127x/.
For reference only, the INI files can be downloaded from TI-OpenLink ini_files. However, this step is optional, as the INI files are already stored in the SDK file system.
Following is the list of available INI files, where the specifically suitable INI file should match the WiFi module. For example: in case of using AM18x platform with 1271 WiFi module by LSR, the matching INI file will be: TQS_S_2.6.ini.

Module Manufacturer Module Part Number FEM PN Chip Connectivity Platform Ref Clock ini file (WLAN RF configuration) Primary BTS file BTS Baud Rate Module type Comment
LS Research TiWi-R2 TQM679002-E2.6 WL1271 WiFi b/g/n
Bluetooth
AM18x 38.4Mhz TCXO TQS_S_2.6.ini TIInit_7.2.31.bts 2000000 Custom Deprecated, please use TiWi-BLE
AM37x 38.4Mhz TCXO TIInit_7.2.31.bts 3000000 Custom (Mistral)
TiWi-BLE TQM679002A WL1271L WiFi b/g/n
Bluetooth + BLE
AM335x 38.4Mhz TCXO TQS_S_2.6.ini TIInit_7.6.15.bts 3000000 COM6 or any platform with support of COM slot and 3M baud rate
TiWi5 WL1273L WiFi a/b/g/n
Bluetooth + BLE
AM335x 26MHz TXCO TQS_D_1.7.ini TIInit_7.6.15.bts 3000000 COM6 or any platform with support of COM slot and 3M baud rate
MURATA LBEH1Z9UWC TQP6M9002-ES1.7 WL1273L WiFi a/b/g/n
Bluetooth
AM18x 26Mhz TCXO TQS_D_1.7.ini TIInit_7.2.31.bts 2000000 Custom (Mistral)
LBEE5ZSTNC-523 TQM679002-E2.6 WL1271L WiFi b/g/n
Bluetooth + BLE
AM335x 38.4Mhz XTAL TQS_S_2.6.ini TIInit_7.6.15.bts 3000000 COM6M or any platform with support of COM slot and 3M baud rate
Jorjin WG7310 TQM679002-E2.6 WL1271 WiFi b/g/n
Bluetooth
AM18x 38.4Mhz XTAL TQS_S_2.6.ini TIInit_7.2.31.bts 2000000 Custom
WG7310 TQM679002-E2.6 AM37x 38.4Mhz XTAL TQS_S_2.6.ini TIInit_7.2.31.bts 3000000 Custom
Jorjin WG7550 WL1283L WiFi b/g/n
Bluetooth + BLE
AM335x TQS_D_1.7.ini TIInit_10.6.15.bts (No BLE support yet) 3000000 COM7
  • Note that all chips on AM18x can only support BTS baud rates at maximum of 200000. Therefore a specific BTS file with 2000000 baud rate must be used.
  • Chip name with L at the end indicates BLE support

The INI file will be used during the next step, to generate the "nvs" file.

Erase the wl1271-nvs.bin from the File System

  • Erase the wl1271-nvs.bin file from the file system; otherwise it may affect the end-result of the Calibration process.
cd /lib/firmware/ti-connectivity/
rm wl1271-nvs.bin


Calibration for R4_SP2 and later (After AM-SDK-05.03.00.01)

The following sequence should be used:

  • Make sure that the wl12xx_sdio module is not loaded:
rmmod wl12xx_sdio

DO NOT do "modprobe -r wl12xx_sdio" since it will remove all WLAN dependencies.

  • Run the calibrator plt autocalibrate commnad with the following parameters:
 calibrator plt autocalibrate <dev> <kernel mod> <ini> <nvs> <mac>


  1. dev: Device name. Probably wlan0
  2. kernel mod: Full path to wl12xx_sdio.ko kernel module
  3. ini: Full path to Radio param ini file
  4. nvs: Full path of nvs file. Must be the real path as wl12xx will load it
  5. mac: MAC address to program into the NVS file

Comment: in case the MAC address is 00:00:00:00:00:00, than the MAC address will be defined by the BT BD address that is burned in the WL127x chip

  • Load the wl12xx_sdio module
modprobe wl12xx_sdio


  • DONE. See the full sequence capture below with example commands and logs:
root@am335x-evm:~# rm /lib/firmware/ti-connectivity/wl1271-nvs.bin
root@am335x-evm:~# rmmod wl12xx_sdio.ko
root@am335x-evm:~# calibrator plt autocalibrate wlan0 /lib/modules/$(uname -r)/updates/drivers/net/wireless/wl12xx/wl12xx_sdio.ko /usr/share/ti/wifi-utils/ini_files/127x/TQS_S_2.6.ini /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:00:00:00:00:00
WARNING: 1 FEMS for 1 bands looks like a strange configuration
[  286.841169] wl1271: loaded
[  286.865707] wl1271: power up
[  287.385653] wl1271: firmware booted in PLT mode (PLT 6.3.3.0.79)
Using nvs version 2.1
Calibrate /lib/firmware/ti-connectivity/wl1271-nvs.bin
Writing calibration data to /lib/firmware/ti-connectivity/wl1271-nvs.bin
[  287.472908] wl1271: power down
Writing mac address 00:01:02:03:65:29 to file /lib/firmware/ti-connectivity/wl1271-nvs.bin
Calibration done. FEM1 has 1 bands. AutoFEM is off. Resulting nvs is /lib/firmware/ti-connectivity/wl1271-nvs.bin

root@am335x-evm:~# modprobe wl12xx_sdio
[  301.762033] wl1271: loaded
[  303.558692] wl1271: firmware booted (Rev 6.3.5.0.79_1)
[  303.564092] wl1271: Driver version: R4_SP2_01_00

Calibration for R4_SP1 and earlier (AM-SDK-05.03.00.01)

As the autocalibrate command was added after this release, the following procedure should be used instead:

Generating an NVS Reference File

  • Create an NVS reference file as follows:
calibrator set ref_nvs ./<ini file>

This command creates the "new_nvs.bin" file according to the radio parameters that are present in the ini_file, where the "ini file" name is according to the file that was chosen based on the WiFi module in the previous section (for example: TQS_S_2.6.ini, TQS_D_1.7.ini, TQS_S_2.6.ini). The file will be created in the current directory.

  • Copy the newly created NVS file to the proper location:
cp new-nvs.bin /lib/firmware/ti-connectivity/wl1271-nvs.bin

Performing the First Calibration

  • Make sure the network interface is down and that the driver is unloaded and reloaded again so that the reference NVS file is loaded.
ifconfig wlan0 down
rmmod wl12xx_sdio
modprobe wl12xx_sdio # loads the nvs from filesystem
ifconfig wlan0 down # makes sure interface is down
  • Run calibration:
calibrator plt calibrate

This command creates the new_nvs.bin file according to the radio parameters taken from the ini_file. The file is generated in the current directory.

  • Copy the newly created NVS file to the proper location:
cp new-nvs.bin /lib/firmware/ti-connectivity/wl1271-nvs.bin
  • Your newly created NVS will be used the next time the WL12xx driver loads. This can be triggered using the following sequence:
rmmod wl12xx_sdio
modprobe wl12xx_sdio

Example

The following example is for AM-18 with 1271 LSR FE module; For these characteristics, run the following commands: Calibration Process:

  • Step 1: cd into the firmware directory in the file system
cd /lib/firmware/ti-connectivity/
  • Step 2: Make sure that the interface is down
ifconfig wlan0 down
  • Step 3: Continue with the Calibration process as follows:
 
calibrator set ref_nvs /usr/share/ti/wifi-utils/ini_files/127x/TQS_S_2.6.ini 
cp new-nvs.bin /lib/firmware/ti-connectivity/wl1271-nvs.bin
ifconfig wlan0 down
rmmod wl12xx_sdio
modprobe wl12xx_sdio
ifconfig wlan0 down
calibrator plt calibrate
cp new-nvs.bin /lib/firmware/ti-connectivity/wl1271-nvs.bin
  • Step 4: Set the WLAN MAC address (in this example it is 00:12:34:56:78:90):
calibrator set nvs_mac /lib/firmware/ti-connectivity/wl1271-nvs.bin 00:12:34:56:78:90
rmmod wl12xx_sdio
modprobe wl12xx_sdio
  • Step 5: To verify that the MAC address was properly changed, use the ifconfig function as follows:
root@am37x-evm:~# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:12:34:56:78:90
          inet addr:192.168.3.10  Bcast:0.0.0.0  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14048740 errors:0 dropped:0 overruns:0 frame:0
          TX packets:20805996 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3296646156 (3.0 GiB)  TX bytes:1748711212 (1.6 GiB)

For more information...

For detailed information you can visit the following link: <Wl12xx Calibration>