The Radio Test Example demonstrates how to configure the radio as the constant RX or TX carrier, the modulated TX carrier, or the RX or TX sweep.
The tests are controlled with Command Line Interface (CLI) by the serial port. At any time during the tests, you can set the radio parameters output power, bit rate, and channel. You can also set the time on each channel in the sweep mode, in steps of 1 millisecond to 99 milliseconds, every 1 millisecond. The application also allows you to send a data pattern to another board.
The application starts with enabling the high frequency crystal oscillator and configuring CLI. Calling a console command causes the appropriate action.
The following table lists the available main CLI commands, in alphabetical order.
Command | Argument | Description |
---|---|---|
cancel | Cancel the sweep or the carrier. | |
data_rate | <sub_cmd> | Set the data rate. |
end_channel | <channel> | End the channel for the sweep. |
output_power | <sub_cmd> | Output power set. |
parameters_print | Print current delay, channel, and other parameters. | |
print_rx | Print the received RX payload. | |
start_channel | <channel> | Start the channel for the sweep or the channel for the constant carrier. |
start_duty_cycle_modulated_tx | <duty_cycle> | Duty cycle in percent (two decimal digits, between 01 and 99). |
start_rx | Start RX. | |
start_rx_sweep | Start the RX sweep. | |
start_tx_carrier | Start the TX carrier. | |
start_tx_modulated_carrier | <packet_num> | Start the modulated TX carrier (continuous TX mode is used if no argument is provided). |
start_tx_sweep | Start the TX sweep. | |
time_on_channel | <time> | Time on each channel (between 1 ms and 99 ms). |
toggle_dcdc_state | <state> | Toggle DC/DC converter state. |
transmit_pattern | <sub_cmd> | Set transmission pattern. |
You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\peripheral\radio_test
The Radio Test Example includes the radio_test.h
file, which includes API declarations that were added or modified in the nRF5 SDK v17.0.0.
To create a custom application that directly uses this Radio Test API, make sure that your application:
radio_test_init()
.radio_test_config_t
. radio_test_mode_t
enumerator's type
field is set to the test type of your choice.radio_test_start()
to start the test.radio_test_cancel()
to stop the running test.You can use this approach for running a single radio test or for maintaining custom automated setup for your RF tests that were created before the release of the nRF5 SDK v17.0.0. This does not however replace the need of porting your application to the Radio Test API definitions from the latest version.
You can test this application with one of the following methods:
Test the Radio Test Example application by performing the following steps:
print_rx
to print the RX data received from the other board.If you use the spectrum analyzer, the testing is successful when the spectrum is displayed correctly.
If you use two boards, the testing is successful when the data is displayed correctly.
If the spectrum or the data does not display correctly, verify the configuration.