# Overview

The CC33xx Network Terminal Example provides the calibrator tool to configure the CC33xx device for various transmit and receive operations enabling measurement of RF performance of the device-under-test. The calibrator tool also provides an easy way to select the desired channel and power level. This enables the RF verification both in the lab and at certification test houses to perform the regulatory conformance tests and measure spectrum mask. The Calibrator tool can also be used for production line testing.

# Prerequisites

To run the calibrator tool you must build and flash the Network Terminal Example. Please reference the `Getting Started Guide` and `The Network Terminal Application` to get up and running.

# Commands

## power_mode

Before running any of the commands, the device and the driver needs to be configured in Production Line Test (PLT) mode. Use the following commands to configure the device to PLT mode:

>     calibrator power_mode on

To exit PLT Mode use the below command:

>     calibrator power_mode off

## tune_channel

The purpose of the `tune_channel` command is to configure the CC33xx device to operate in a specific Wi-Fi band and channel. The `tune_channel` command can be called using the following format:

>     calibrator tune_channel <CHAN> <BAND> <BANDWIDTH>

Where each argument is defined as the following:

Parameters for tune_channel Command
Parameter | Option | Description
CHAN | 1 - 14 | 2.4 GHz Wi-Fi Channels
34 - 180 | 5 GHz Wi-Fi Channels
BAND | 0 | 2.4 GHz Wi-Fi Band
1 | 5 GHz Wi-Fi Band
BANDWIDTH | 0 | Bandwidth Allocation

Note

Channel tune must be executed before any other calibrator activities. There is are no default channel tune parameters, thus they must be set before executing anything else.

Example

The following `tune_channel` command configures the chip to operate in the 2.4 GHz band on channel 6:

>     calibrator tune_channel 6 0 0

## start_tx

The `start_tx` command will start Calibrator Transmission

>     calibrator start_tx

## stop_tx

The `stop_tx` command will stop Calibrator Transmission

>     calibrator stop_tx

## start_rx

The `start_rx` command triggers the device to gather RX statistics

>     calibrator start_rx [-source_mac <address>] [-ack_enable <enable>] [-aid <aid>] [-rate <rate>] [-preamble_type <type>]

Parameters for start_rx Command
Parameter | Option
source_mac | FF:FF:FF:FF:FF:FF
ack_enable | 0 (Disabled)
1 (Enabled)
aid | Specify requested AID for PHY configuration
rate | 1 - 1Mb/s
2 - 2Mb/s
3 - 5.5Mb/s
4 - 11Mb/s
5 - 6Mb/s
6 - 9Mb/s
7 - 12Mb/s
8 - 18Mb/s
9 - 24Mb/s
10 - 36Mb/s
11 - 48Mb/s
12 - 54Mb/s
13 - MCS0 (6.5Mb/s)
14 - MCS1 (13Mb/s)
15 - MCS2 (19.5.5Mb/s)
16 - MCS3 (26Mb/s)
17 - MCS4 (39Mb/s)
18 - MCS5 (52Mb/s)
19 - MCS6 (58.5Mb/s)
20 - MCS7 (65Mb/s)
preamble_type | 0 - PREAMBLE_TYPE_SHORT
1 - PREAMBLE_TYPE_LONG
2 - PREAMBLE_TYPE_OFDM
3 - PREAMBLE_TYPE_N_MIXED_MODE
4 - PREAMBLE_TYPE_GREENFIELD
5 - PREAMBLE_TYPE_AX_SU
6 - PREAMBLE_TYPE_AX_MU
7 - PREAMBLE_TYPE_AX_SU_ER
8 - PREAMBLE_TYPE_AX_TB
9 - PREAMBLE_TYPE_AX_TB_NDP_FB
10 - PREAMBLE_TYPE_AC_VHT

## stop_rx

The `stop_trx` command will stop Calibrator Reception

>     calibrator stop_rx

## get_rx_stats

The `get_rx_stats` command will retrieve the RX statistics when rx has been turned on.

>     calibrator get_rx_stats

## set_tx

The `set_tx` command can control the entire TX datapath and front-end on the CC33xx device. This command is able to set preamble types, phy datarates, output power, control the number of data packets to transmit and the data value within the packets, and many other functions.

Default TX settings are described in Table 5 and can be enabled with the command:

>     calibrator set_tx -default 0

The full command format is provided below. Please note that it is not necessary to include every argument in the `set_tx` command.

>     calibrator wlan0 cc33xx_plt set_tx
>         -preamble_type <PREAMBLE_TYPE>
>         -phy_rate <PHY_RATE>
>         -tx_power <TX_POWER>
>         -gi_ltf_type <GI_LTF_TYPE>
>         -dcm <DCM>
>         -length <LENGTH>
>         -delay <DELAY>
>         -pkt_mode <PACKET_MODE>
>         -num_pkts <NUM_PACKETS>
>         -data_mode <DATA_MODE>
>         -data_const_val <DATA_VALUE>
>         -cca <CCA>
>         -bss_color <BSS_COLOR>
>         -src_addr <SRC_ADDR>
>         -dst_addr <DST_ADDR>
>         -nominal_pkt_ext <PKT_EXT>
>         -feed_status <FEED_STATUS>
>         -aid <AID>
>         -group_id <G_ID>

The arguments are defined in the table below:

Parameters for set_tx Command
Parameter | Options | Description
--- | --- | ---
preamble_type | 0 | 11b short preamble
1 | 11b long preamble
2 | 11a/g legacy OFDM
3 | 11n mixed mode
4 | 11n GF (not supported)
5 | 11ax SU
6 | 11ax MU (not supported)
7 | 11ax SU ER
8 | 11ax TB
9 | 11ax TB NDP FB
10 | 11ac VHT (5 GHz Only)
phy_rate | 1 | 1 Mbps
2 | 2 Mbps
3 | 5.5 Mbps
4 | 11 Mbps
5 | 6 Mbps
6 | 9 Mbps
7 | 12 Mbps
8 | 18 Mbps
9 | 24 Mbps
10 | 36 Mbps
11 | 48 Mbps
12 | 54 Mbps
13 | MCS0
14 | MCS1
15 | MCS2
16 | MCS3
17 | MCS4
18 | MCS5
19 | MCS6
20 | MCS7
tx_power | 0-30 | Integer value with a range of -10 dBm to 20 dBm with 1 dB steps
gi_ltf_type | 0 | 1xLTF + 1.6 µs GI
1 | 2xLTF + 1.6 µs GI
2 | 4xLTF + 3.2 µs GI
3 | 2xLTF + 0.8 µs GI
4 | 1xLTF + 0.8 µs GI
5 | 4xLTF + 0.8µs GI
dcm | 0 | Disable DCM
1 | Enable DCM
length range <start_length> <end_length> | 100-3500 | Number of data bytes excluding MAC 802.11 header. “Range” string in LENGTH requires arguments of <start_length> and <end_length>. This is only supported in Continuous Mode or PACKET_MODE <0>. -length range 0 100
length const packet <length> | Non MCS rate: 0 - 3500 MCS rate: 0 - 16000 | Number of data bytes excluding MAC 802.11 header. The “const packet” string in LENGTH requires argument of <length> -length const packet 2000
delay | 50 - 1000000 | Delay between packets (µs)
pkt_mode | 0 | Continuous mode - transmits packets continuously until TX_STOP command is sent
1 | Transmits a single packet
2 | <NUM_PKTS> is required if using this packet mode Transmits <NUM_PKTS> packets
num_pkts | 1 - 10000 | Used when <PKT_MODE> = 2 Specifies number of packets to send
data_mode | 0 | <DATA_VAL> is required if using this data mode Constant value
1 | Increment value
2 | Random value
data_const_val | 0 - 255 | Required if <DATA_MODE> is 0 Data value used in all packets
cca | 0 | Disable CCA
1 | Enable CCA
bss_color | 0 - 63 | This field is relevant for HE_SU and HE_SU_ER
src_addr | xx:xx:xx:xx:xx:xx | Source MAC Address
dest_addr | xx:xx:xx:xx:xx:xx | Destination MAC Address
nominal_pkt_ext | 0 | 0 µs
1 | 8 µs
2 | 16 µs
feed_status | 0 / 1 | Indicates the value of the one bit used to modulate the tones in each tone set. This field is relevant for HE TB NDP FB transmissions only.
aid | 0 - 16383 | AID of station can be up to 16383 (14 bits)

### Set_TX Default Parameters

Default Settings for set_tx Command
Parameter | Value | Description
--- | --- | ---
PREAMBLE_TYPE | 2 | 11a/g legacy OFDM
PHY_RATE | 5 | 6 Mbps
TX_POWER | 0 | -10 dBm
GI_LTF_TYPE | 2 | 4xLTF + 3.2 µs GI
DCM | 0 | Disable DCM
LENGTH | 100 | 100 data bytes
DELAY | 3000 | 3000 µs delay between packets
PACKET_MODE | 0 | Continuous mode
NUM_PACKETS | 300 | N/A when PACKET_MODE = 0 (Continuous Mode)
DATA_MODE | 2 | Random Value
DATA_VALUE | 0x55 | N/A when DATA_MODE = 2 (Random Value)
CCA | 1 | Enable CCA
BSS_COLOR | 13 |
SRC_ADDR | 0x665544332222 |
DEST_ADDR | 0x060504030202 |
PACKET_EXT | 1 | 8 µs
FEED_STATUS | 0 |
AID | 11 |

## get_tx_params

The `get_tx_params` command will retrieve the TX params for PLT.

>     calibrator get_tx_params

## set_tb_tx

The `set_tb_tx` command is used to set the trigger based transmission parameters in the CC33xx device. The `set_tb_tx` command is formatted as such:

>     calibrator set_tb_tx
>     -he_ltf_num <NUM_HE_LTF>
>     -pre_fec_padding_factor <PRE_FACTOR>
>     -ru_alloc <RU_ALLOC>
>     -ul_bw <UL_BW>
>     -tb_auto <TB_AUTO>

The arguments are defined below:

Parameters for set_tb_tx Command
Parameter | Option | Description
--- | --- | ---
NUM_HE_LTF | 0 | 1 HE LTF
1 | 2 HE LTF
2 | 4 HE LTF
3 | 6 HE LTF
4 | 8 HE LTF
RU_ALLOC | 0 - 60 | Resource Unit Allocation
UL_BW | 0 | 20 MHz
1 | 40 MHz
2 | 80 MHz
TB_AUTO | 0 | Disabled
1 | Enabled

## beacon_rssi

The `beacon_rssi` command displays the RSSI of the last beacon received. The command will be formatted as such:

>     calibrator beacon_rssi

## gi_ltf

The `gi_ltf` command sets the gi_ltf (gaurd interval and long training field) value

>     calibrator gi_ltf <Value>

Parameters for gi_ltf Command
Option | Description
--- | ---
0 | 1xLTF + 1.6 µs GI
1 | 2xLTF + 1.6 µs GI
2 | 4xLTF + 3.2 µs GI
3 | 2xLTF + 0.8 µs GI
4 | 1xLTF + 0.8 µs GI
5 | 4xLTF + 0.8µs GI

## psm

The `psm` command is used to configure the powersave mode. The format and parameters are provided below:

>     calibrator psm <INDEX> <VALUE>

Parameters for psm Command
Parameter | Option | Description | Parameter | Option | Description
INDEX | 0 | ACTIVE_MODE_RX_TH | VALUE | 0 - 255 | RX Threshold value
1 | ACTIVE_MODE_TX_TH | 0 - 255 | TX Threshold value
2 | ACTIVE_MODE_RX_TO |  | RX Timeout Value (microseconds)
3 | ACTIVE_MODE_TX_TO |  | TX Timeout Value (microseconds)
4 | FORCE_POWER_MODE | 0, 1, 2 | 0 - No Force 1 - Force Active 2 - Force Power Save

Note that the index and value on the same row should be used in conjuction. For example if using ACTIVE_MODE_RX_TH then a RX Threshold value must be selected. An example of how this command would be formatted is below:

>     calibrator psm 0 200

## tx_start_tone

The purpose of the `tx_start_tone` command is to create and transmit a carrier wave that can be modulated with a fixed tone.

The `tx_start_tone` command is formatted as such:

>     calibrator tx_start_tone <MODE> <OFFSET>

Parameters for tx_start_tone Command
Parameter | Option | Description
MODE | 2 | Single tone: TX chain is on and a sinusoidal signal is outputted
OFFSET | -40 - 40 | Integer value with range of -10 MHz to +10 MHz with steps of 0.25 MHz

## set_manual_calib

The `set_manual_calib` command triggers the calibration process to optimize PHY performance and should be run after the `tune_channel` command. This should be rerun any time the `tune_channel` command is rerun and prior to running the commands that set parameters.

>     calibrator set_manual_calib -tx <TX> -rx <RX>

Parameters for set_manual_calib Command
Parameter | Option | Description
TX | 0 | Don’t Trigger TX Calibration
1 | Trigger TX Calibration
RX | 0 | Don’t Trigger RX Calibration
1 | Trigger RX Calibration

## set_io_conf

The `set_io_conf` command allows for configuration of the I/O pins on the cc33xx device. There are 18 pins, listed below, that can be configured as either input or output. If a pin is to be configured as output, then the pin state can also be configured as high or low.

>     calibrator set_io_conf <IO_ID> <DIR> <STATE>

Parameters for set_io_conf Command
Parameter | Option | Description
IO_ID | 0 | SLW_CLK_IN
1 | SDIO_CLK
2 | SDIO_CMD
3 | SDIO_D0
4 | SDIO_D1
5 | SDIO_D2
6 | SDIO_D3
7 | HOST_IRQ_WL
8 | UART1_TX
9 | UART1_RX
10 | UART1_CTS
11 | UART1_RTS
12 | COEX_PRIO
13 | COEX_REQ
14 | COEX_GRANT
15 | HOST_IRQ_BLE
16 | FAST_CLK_REQ
17 | ANT_SEL
DIR | 0 | Input
1 | Output
STATE | 0 | High
1 | Low

## get_io_conf

The `get_io_conf` command allows for printing the configuration of the I/O pins on the cc33xx device.

>     calibrator get_io_conf <IO_ID>

Parameters for get_io_conf Command
Parameter | Option | Description
IO_ID | 0 | SLW_CLK_IN
1 | SDIO_CLK
2 | SDIO_CMD
3 | SDIO_D0
4 | SDIO_D1
5 | SDIO_D2
6 | SDIO_D3
7 | HOST_IRQ_WL
8 | UART1_TX
9 | UART1_RX
10 | UART1_CTS
11 | UART1_RTS
12 | COEX_PRIO
13 | COEX_REQ
14 | COEX_GRANT
15 | HOST_IRQ_BLE
16 | FAST_CLK_REQ
17 | ANT_SEL

## ble_plt

The `ble_plt` command turns off timed calibration and enables the device to run required ble rf testing commands

>     calibrator ble_plt