This is a regulatory test script from Murata to test the three different modes i.e. Continuous Transmit, Carrier Wave, and Receive on the Murata modules (1DX, 1LV, 1MW, 1XA, 2AE and 1YN) for Linux.
N.B. FreeRTOS support has been deprecated. For FreeRTOS legacy support, enable the LEGACY_FREERTOS_SUPPORT flag in script.


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|Entry	|MODULE Name	|Description		|Bands	|Bandwidth	|Supported Channels					|Supported Data Rates										|
|-------|---------------|-----------------------|-------|---------------|-------------------------------------------------------|-----------------------------------------------------------------------------------------------|
|1	|1DX		|802.11 b/g/n		|2.4	|20		|1,6,11							|1,2,5.5,11,6,9,12,18,24,36,48,54,6.5,13,19.5,26,39,52,58.5,65					|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|2	|1LV		|802.11 a/b/g/n		|2.4/5	|20		|1,6,11							|1,2,5.5,11,6,9,12,18,24,36,48,54,6.5,13,19.5,26,39,52,58.5,65					|
|	|		|			|	|		|36,44,48,52,60,64,100,116,120,140,144,149,157,165	|6,9,12,18,24,36,48,54,6.5,13,19.5,26,39,52,58.5,65,78						|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------	
|3	|1MW		|802.11 a/b/g/n/ac	|2.4/5	|20/40/80	|1,6,11							|1,2,5.5,11,6,9,12,18,24,36,48,54,6.5,13,19.5,26,39,52,58.5,65					|	
|	|		|			|	|		|36,44,48,52,60,64,100,116,120,140,144,149,157,165	|6,9,12,18,24,36,48,54,6.5,13,19.5,26,39,52,58.5,65,78,						|
|	|		|			|	|		|							|13.5,27,40.5,54,81,108,121.5,135,162,180,29.3,58.5,87.8,117,175.5,234,263.3,292.5,351,390	|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|4	|1XA		|802.11 a/b/g/n/ac	|2.4/5	|20/40/80	|1,6,11							|1,2,5.5,11,6,9,12,18,24,36,48,54,6.5,13,19.5,26,39,52,58.5,65					|	
|	|		|			|	|		|36,44,48,52,60,64,100,116,120,140,144,149,157,165	|6,9,12,18,24,36,48,54,6.5,13,19.5,26,39,52,58.5,65,78,						|
|	|		|			|	|		|							|13.5,27,40.5,54,81,108,121.5,135,162,180,29.3,58.5,87.8,117,175.5,234,263.3,292.5,351,390	|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|5	|2AE		|802.11 a/b/g/n/ac	|2.4/5	|20/40/80	|1,6,11							|1,2,5.5,11,6,9,12,18,24,36,48,54,6.5,13,19.5,26,39,52,58.5,65					|	
|	|		|			|	|		|36,44,48,52,60,64,100,116,120,140,144,149,157,165	|6,9,12,18,24,36,48,54,6.5,13,19.5,26,39,52,58.5,65,78,						|
|	|		|			|	|		|							|13.5,27,40.5,54,81,108,121.5,135,162,180,29.3,58.5,87.8,117,175.5,234,263.3,292.5,351,390	|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|6	|1YN		|802.11 b/g/n		|2.4	|20		|1,6,11							|1,2,5.5,11,6,9,12,18,24,36,48,54,6.5,13,19.5,26,39,52,58.5,65					|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Requirements Before Running the Script File:
--------------------------------------------

The most important step is to switch over to manufacturing test firmware and reboot the platform. To switch over to manufacturing test firmware, the user needs to contact Murata to obtain the manufacturing test firmware files. Here are the necessary steps:

• Obtain manufacturing test firmware tar ball. If you need assistance, please post on Murata’s Community Support Forum: https://community.murata.com.
• After accessing root file system, “cd” to “lib/firmware/cypress” folder.
• Switch user to “root”.
• Create “mfgtest” and “production” sub-folders in “/lib/firmware/cypress” folder.
• Backup existing “*.bin” and “*.clm_blob” files to “production” sub-folder.
• Copy manufacturing test firmware files (from “mfgtest” sub-folder) into “lib/firmware/cypress” folder.
• Reboot the platform: verify that “WLTEST” is logged when “fmac” driver loads.

NOTE: For “fmac” release “kong” and older, the folder location is “/lib/firmware/brcm”

After accessing root file system, create sub-folders for production and manufacturing test firmware:

$ cd <path to mounted rootfs>/lib/firmware/cypress
$ sudo mkdir mfgtest
$ sudo mkdir production
$ sudo cp *.bin production/
$ sudo cp *.clm_blob production/
$ sudo cp <path to mfgtest binaries>/*.bin mfgtest/
$ sudo cp <path to mfgtest binaries>/*.clm_blob mfgtest/

Now boot i.MX platform and note firmware log message:

brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Sep 21 2018 04:08:34 version 7.45.173 (r707987 CY) FWID 01-d2799ea2

Now copy over “mfgtest” sub-folder contents to “/lib/firmware/cypress”:

$ cd /lib/firmware/cypress
$ cp mfgtest/* .

Reboot platform and note different log message (with “WLTEST” string) for manufacturing test firmware:

brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Sep 21 2018 04:02:19 version 7.45.173 (r707987 CY WLTEST) FWID 01-3c82dde4

NOTE: the WLAN firmware version number for production and manufacturing test should not differ. In this example, both firmware versions are “7.45.173”.

Before running any manufacturing tests with “wl” tool, make sure that WPA supplicant is not running:
$ killall wpa_supplicant


Instructions for Running the Script File:
-----------------------------------------

1. Copy the script file "Murata_IFX_RF_Test_Tool" in a preferred location e.g. /home/root
2. To run the script file, enter the command
	python wlscriptLMH_FCC.py

Ex: root@imx7dea-com:/<path to script file># python wlscriptLMH_FCC.py


Please find below the sample execution of the script file.


========== For 1DX =============================== 

You will get to choose from the following options:

Step 1:
Select Module
----------------

-----------------------------------------------------
| Entry |   Module Name	        | Description       |
|-------|-----------------------|-------------------|
|   1   |   1DX	                | 802.11 b/g/n      |
|   2   |   1LV                 | 802.11 a/b/g/n    |
|   3   |   1MW                 | 802.11 a/b/g/n/ac |
|   4   |   1XA                 | 802.11 a/b/g/n/ac |
|   5   |   2AE                 | 802.11 a/b/g/n/ac |
|   6   |   1YN                 | 802.11 b/g/n      |
-----------------------------------------------------

Step 2:
Select Test Mode
----------------

------------------------------------------
| Entry |   Test Mode                    |
|-------|--------------------------------|
|   1   |   Continuous Transmit          |
|   2   |   Carrier Wave                 |
|   3   |   Receive                      |
------------------------------------------

Step 3:
Select Channel Number
---------------------

-----------------------------------------------------
| Entry |   Channel Number      | Description       |
|-------|-----------------------|-------------------|
|   1   |   LOW                 | Channel 1         |
|   2   |   MID                 | Channel 6         |
|   3   |   HIGH                | Channel 11        |
-----------------------------------------------------

Step 4:
Select Data Rate

Step 5:
Select Transmit Parameter Setting Option
----------------------------------------

----------------------------------------
| Entry |   Band                       |
|-------|------------------------------|
|   1   |   Use default parameters     |
|       |     - Packet interval = 20   |
|       |     - Packet length = 1024   |
|       |     - Number of frames = 0   |
|   2   |   Input custom parameters    |
----------------------------------------


========== For 1LV ============================== 

You will get to choose from the following options:

Step 1:
Select Module
----------------

-----------------------------------------------------
| Entry |   Module Name	        | Description       |
|-------|-----------------------|-------------------|
|   1   |   1DX	                | 802.11 b/g/n      |
|   2   |   1LV                 | 802.11 a/b/g/n    |
|   3   |   1MW                 | 802.11 a/b/g/n/ac |
|   4   |   1XA                 | 802.11 a/b/g/n/ac |
|   5   |   2AE                 | 802.11 a/b/g/n/ac |
|   6   |   1YN                 | 802.11 b/g/n      |
-----------------------------------------------------

Step 2:
Select Test Mode
----------------

------------------------------------------
| Entry |   Test Mode                    |
|-------|--------------------------------|
|   1   |   Continuous Transmit          |
|   2   |   Carrier Wave                 |
|   3   |   Receive                      |
------------------------------------------

Step 3:
Select Band
-----------

----------------------------------
| Entry |   Band                 |
|-------|------------------------|
|   2   |   2.4 GHz              |
|   5   |   5 GHz                |
----------------------------------

Step 4:
Select Channel Number
---------------------

-----------------------------------------------------
| Entry |   Channel Number      | Description       |
|-------|-----------------------|-------------------|
|   1   |   LOW                 | Channel 1         |
|   2   |   MID                 | Channel 6         |
|   3   |   HIGH                | Channel 11        |
-----------------------------------------------------

Step 5:
Select Data Rate

Step 6:
Select Transmit Parameter Setting Option
----------------------------------------

----------------------------------------
| Entry |   Band                       |
|-------|------------------------------|
|   1   |   Use default parameters     |
|       |     - Packet interval = 20   |
|       |     - Packet length = 1024   |
|       |     - Number of frames = 0   |
|   2   |   Input custom parameters    |
----------------------------------------


========== For 1MW =============================== 

You will get to choose from the following options:

Step 1:
Select Module
----------------

-----------------------------------------------------
| Entry |   Module Name	        | Description       |
|-------|-----------------------|-------------------|
|   1   |   1DX	                | 802.11 b/g/n      |
|   2   |   1LV                 | 802.11 a/b/g/n    |
|   3   |   1MW                 | 802.11 a/b/g/n/ac |
|   4   |   1XA                 | 802.11 a/b/g/n/ac |
|   5   |   2AE                 | 802.11 a/b/g/n/ac |
|   6   |   1YN                 | 802.11 b/g/n      |
-----------------------------------------------------

Step 2:
Select Test Mode
----------------

------------------------------------------
| Entry |   Test Mode                    |
|-------|--------------------------------|
|   1   |   Continuous Transmit          |
|   2   |   Carrier Wave                 |
|   3   |   Receive                      |
------------------------------------------

Step 3:
Select Band
-----------

----------------------------------
| Entry |   Band                 |
|-------|------------------------|
|   2   |   2.4 GHz              |
|   5   |   5 GHz                |
----------------------------------

Step 4:
Select Bandwidth
----------------

----------------------------------
| Entry |   Bandwidth            |
|-------|------------------------|
|   1   |   20 MHz               |
|   2   |   40 MHz               |
|   3   |   80 MHz               |
-----------------------------------

Step 5:
Select Channel Number
---------------------

-----------------------------------------------------
| Entry |   Channel Number      | Description       |
|-------|-----------------------|-------------------|
|   1   |   LOW                 | Channel 1         |
|   2   |   MID                 | Channel 6         |
|   3   |   HIGH                | Channel 11        |
-----------------------------------------------------


Step 6:
Select Data Rate


Step 7:
Select Transmit Parameter Setting Option
----------------------------------------

----------------------------------------
| Entry |   Band                       |
|-------|------------------------------|
|   1   |   Use default parameters     |
|       |     - Packet interval = 20   |
|       |     - Packet length = 1024   |
|       |     - Number of frames = 0   |
|   2   |   Input custom parameters    |
----------------------------------------


========== For 1XA =============================== 

You will get to choose from the following options:

Step 1:
Select Module
----------------

-----------------------------------------------------
| Entry |   Module Name	        | Description       |
|-------|-----------------------|-------------------|
|   1   |   1DX	                | 802.11 b/g/n      |
|   2   |   1LV                 | 802.11 a/b/g/n    |
|   3   |   1MW                 | 802.11 a/b/g/n/ac |
|   4   |   1XA                 | 802.11 a/b/g/n/ac |
|   5   |   2AE                 | 802.11 a/b/g/n/ac |
|   6   |   1YN                 | 802.11 b/g/n      |
-----------------------------------------------------

Step 2:
Select Test Mode
----------------

------------------------------------------
| Entry |   Test Mode                    |
|-------|--------------------------------|
|   1   |   Continuous Transmit          |
|   2   |   Carrier Wave                 |
|   3   |   Receive                      |
------------------------------------------

Step 3:
Select Antenna Configuration
----------------------------

------------------------------------------
| Entry |   Antenna Configuration        |
|-------|--------------------------------|
|   1   |   SISO		         |
|   2   |   MIMO	                 |
------------------------------------------

Step 4:
Select Antenna
--------------

------------------------------------------
| Entry |   Antenna Selection	         |
|-------|--------------------------------|
|   1   |   Main antenna	         |
|   2   |   Auxiliary antenna            |
------------------------------------------

Step 5:
Select Band
-----------

----------------------------------
| Entry |   Band                 |
|-------|------------------------|
|   2   |   2.4 GHz              |
|   5   |   5 GHz                |
----------------------------------

Step 6:
Select Bandwidth
----------------

----------------------------------
| Entry |   Bandwidth            |
|-------|------------------------|
|   1   |   20 MHz               |
|   2   |   40 MHz               |
|   3   |   80 MHz               |
-----------------------------------

Step 7:
Select Channel Number
---------------------

-----------------------------------------------------
| Entry |   Channel Number      | Description       |
|-------|-----------------------|-------------------|
|   1   |   LOW                 | Channel 1         |
|   2   |   MID                 | Channel 6         |
|   3   |   HIGH                | Channel 11        |
-----------------------------------------------------


Step 8:
Select Data Rate


Step 9:
Select Transmit Parameter Setting Option
----------------------------------------

----------------------------------------
| Entry |   Band                       |
|-------|------------------------------|
|   1   |   Use default parameters     |
|       |     - Packet interval = 20   |
|       |     - Packet length = 1024   |
|       |     - Number of frames = 0   |
|   2   |   Input custom parameters    |
----------------------------------------



========== For 2AE =============================== 

You will get to choose from the following options:

Step 1:
Select Module
----------------

-----------------------------------------------------
| Entry |   Module Name	        | Description       |
|-------|-----------------------|-------------------|
|   1   |   1DX	                | 802.11 b/g/n      |
|   2   |   1LV                 | 802.11 a/b/g/n    |
|   3   |   1MW                 | 802.11 a/b/g/n/ac |
|   4   |   1XA                 | 802.11 a/b/g/n/ac |
|   5   |   2AE                 | 802.11 a/b/g/n/ac |
|   6   |   1YN                 | 802.11 b/g/n      |
-----------------------------------------------------

Step 2:
Select Test Mode
----------------

------------------------------------------
| Entry |   Test Mode                    |
|-------|--------------------------------|
|   1   |   Continuous Transmit          |
|   2   |   Carrier Wave                 |
|   3   |   Receive                      |
------------------------------------------

Step 3:
Select Band
-----------

----------------------------------
| Entry |   Band                 |
|-------|------------------------|
|   2   |   2.4 GHz              |
|   5   |   5 GHz                |
----------------------------------

Step 4:
Select Bandwidth
----------------

----------------------------------
| Entry |   Bandwidth            |
|-------|------------------------|
|   1   |   20 MHz               |
|   2   |   40 MHz               |
|   3   |   80 MHz               |
-----------------------------------

Step 5:
Select Channel Number
---------------------

-----------------------------------------------------
| Entry |   Channel Number      | Description       |
|-------|-----------------------|-------------------|
|   1   |   LOW                 | Channel 1         |
|   2   |   MID                 | Channel 6         |
|   3   |   HIGH                | Channel 11        |
-----------------------------------------------------


Step 6:
Select Data Rate


Step 7:
Select Transmit Parameter Setting Option
----------------------------------------

----------------------------------------
| Entry |   Band                       |
|-------|------------------------------|
|   1   |   Use default parameters     |
|       |     - Packet interval = 20   |
|       |     - Packet length = 1024   |
|       |     - Number of frames = 0   |
|   2   |   Input custom parameters    |
----------------------------------------


========== For 1YN =============================== 

You will get to choose from the following options:

Step 1:
Select Module
----------------

-----------------------------------------------------
| Entry |   Module Name	        | Description       |
|-------|-----------------------|-------------------|
|   1   |   1DX	                | 802.11 b/g/n      |
|   2   |   1LV                 | 802.11 a/b/g/n    |
|   3   |   1MW                 | 802.11 a/b/g/n/ac |
|   4   |   1XA                 | 802.11 a/b/g/n/ac |
|   5   |   2AE                 | 802.11 a/b/g/n/ac |
|   6   |   1YN                 | 802.11 b/g/n      |
-----------------------------------------------------

Step 2:
Select Test Mode
----------------

------------------------------------------
| Entry |   Test Mode                    |
|-------|--------------------------------|
|   1   |   Continuous Transmit          |
|   2   |   Carrier Wave                 |
|   3   |   Receive                      |
------------------------------------------

Step 3:
Select Channel Number
---------------------

-----------------------------------------------------
| Entry |   Channel Number      | Description       |
|-------|-----------------------|-------------------|
|   1   |   LOW                 | Channel 1         |
|   2   |   MID                 | Channel 6         |
|   3   |   HIGH                | Channel 11        |
-----------------------------------------------------

Step 4:
Select Data Rate

Step 5:
Select Transmit Parameter Setting Option
----------------------------------------

----------------------------------------
| Entry |   Band                       |
|-------|------------------------------|
|   1   |   Use default parameters     |
|       |     - Packet interval = 20   |
|       |     - Packet length = 1024   |
|       |     - Number of frames = 0   |
|   2   |   Input custom parameters    |
----------------------------------------
