The MCR20A Connectivity Test application is an SMAC based demo application which provides the user with means to test basic transmission-reception functionalities along with several advanced testing features based on the ASP and SMAC APIs.

Dependencies:   fsl_phy_mcr20a fsl_smac mbed-rtos mbed

Fork of mcr20_connectivity_test by Freescale

Modes of Operation

The MCR20A Connectivity Test application has five main features:

Continuous Tests

This menu option displays several test suites

  • IDLE: This option sets the transceiver and all the state machines to idle.
  • Burst PRBS Transmission using packet mode: This option continuously sends packets which contain a pseudo-random payload of fixed length.
  • Continuous Modulated Transmission: This option allows the user to select between modulating 1’s, 0’s, or a pseudo-random sequence (PN) and sending them OTA continuously (in continuous mode).
  • Continuous Unmodulated Transmission: This option allows the user to send an unmodulated signal OTA having the frequency equal to the central frequency of the currently selected channel.
  • Continuous Reception: This test places the transceiver in reception and dumps the payload bytes of the received packets to the TERM in ASCII-converted hexadecimal characters.
  • Continuous Energy Detect: This option launches consecutive energy detect requests at fixed hard-coded intervals for the current channel, and prints their values to the TERM.
  • Continuous Scan: This option is similar to the previous one, except that at each iteration it obtains the energy values on all channels.
  • Continuous CCA: This option launches consecutive CCA requests for the currently selected channel at a fixed. hard-coded interval, and prints “Idle” or “Busy” depending on the CCA result.

Packet Error Rate

This menu option displays a configuration menu for testing the packet error rate. The menu displayed also depends on the ‘r’ or ‘t’ shortcut key. If ‘r’ is pressed, the following menu is for PER RX, otherwise it is for PER TX. For example, if two MCR20A platforms have Connectivity Test loaded, one of the boards can be set in RX and the other in TX as in the following figures.

Range Test

This test displays a configuration menu that performs a ‘ping-pong’ test to aid the user in determining the range (as distance between two platforms) in which the MCR20A platform can function properly. The sub-menu also depends on the ‘r’ and ‘t’ shortcuts so that one of the platforms can be the initializer (first to start a TX) and the other can respond to requests. The test is started and stopped only by user intervention and during its execution it will display the signal strength for each received packet. At the end of the test, the platform configured as the initializer (TX) displays a summary of how many packets were lost and what was the average RSSI.

Radio Registers Edit

This menu allows the user to read-write transceiver registers and to dump all address-value pairs from the transceiver registers to the TERM. The described features are accessible through the entries of this menu. For each access request (read or write) to a certain register, the register address is validated partially, and it is the responsibility of the user to access an existing register. For example, if the last accessible register is at 0xFD, the application only validates that the address is in the unsigned char range, but the user has the possibility to request register 0xFF. To ensure that a proper range is used, the user should first use the dump register feature to see the valid address ranges.

Carrier Sense and Transmission Control

This menu allows the user to choose between two tests. The former is the Carrier Sense test, which performs ED continuously until the ED value is above the CCA threshold (configured using ‘k’ and ‘l’ shortcuts) and then transmits a packet which contains pseudo-random data with the payload size configured using ‘n’ and ‘m’ shortcuts. The latter is the Transmission Control test, which displays a selection menu for number of packets identical with the one in PER TX test, then prompts the user to enter a decimal value resembling the inter-packet delay in milliseconds. After that, the application starts sending the selected number of packets with the selected inter-packet delay, using pseudo-random data for the payload with the size configured with ‘n’ and ‘m’ shortcuts.

Keys Usage

The following keys have the effect described below:

  • ‘t’ : Brings up the configuration menu for the transmitter in both PER and Range tests.
  • ‘r’ : Brings up the configuration menu for the receiver in both PER and Range tests.
  • ‘q’ : Increments channel number. If pressed when the current channel is 26, the channel number changes to 11.
  • ‘w’ : Decrements channel number. If pressed when the current channel is 11, the channel number will change to 26.
  • ‘a’ : Increments output power value. If output power is at maximum and this key is pressed, the output power goes to the minimum (in this case 0x03).
  • ‘s’ : Decrements output power value. If output power is at minimum and this key is pressed, the output power goes to the maximum (in this case 0x1F). These are not directly mapped to dBm values. Instead the output power value is written to the appropriate register. The user should consult the reference manual to determine the relationship between selected value and power in dBm.
  • ‘n’ : Increments the length of the payload. This value is used in both PER TX test to build-up the payload and in Transmission Control test for the same reason.
  • ‘m’ : Decrements the length of the payload. Incrementation and decrementation are performed in the [17, 116] interval. All overflows at one end lead to setting the other end’s value.
  • ‘k’ : Increments the CCA threshold for the Carrier Sense test. In this test the CCA before TX algorithm is implemented at application level, and the channel idle threshold is established using this parameter.
  • ‘l’ : Decrements the CCA threshold for the Carrier Sense test.

Documentation

SMAC Demo Applications User Guide

Committer:
andreikovacs
Date:
Tue Aug 18 12:52:15 2015 +0000
Revision:
7:34047de4992b
Parent:
0:4eb2240dbd22
Included fsl_phy_mcr20a and fsl_smac libraries

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andreikovacs 0:4eb2240dbd22 1 /*!
andreikovacs 0:4eb2240dbd22 2 * Copyright (c) 2015, Freescale Semiconductor, Inc.
andreikovacs 0:4eb2240dbd22 3 * All rights reserved.
andreikovacs 0:4eb2240dbd22 4 *
andreikovacs 0:4eb2240dbd22 5 * \file App_Custom.c
andreikovacs 0:4eb2240dbd22 6 *
andreikovacs 0:4eb2240dbd22 7 * Redistribution and use in source and binary forms, with or without modification,
andreikovacs 0:4eb2240dbd22 8 * are permitted provided that the following conditions are met:
andreikovacs 0:4eb2240dbd22 9 *
andreikovacs 0:4eb2240dbd22 10 * o Redistributions of source code must retain the above copyright notice, this list
andreikovacs 0:4eb2240dbd22 11 * of conditions and the following disclaimer.
andreikovacs 0:4eb2240dbd22 12 *
andreikovacs 0:4eb2240dbd22 13 * o Redistributions in binary form must reproduce the above copyright notice, this
andreikovacs 0:4eb2240dbd22 14 * list of conditions and the following disclaimer in the documentation and/or
andreikovacs 0:4eb2240dbd22 15 * other materials provided with the distribution.
andreikovacs 0:4eb2240dbd22 16 *
andreikovacs 0:4eb2240dbd22 17 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
andreikovacs 0:4eb2240dbd22 18 * contributors may be used to endorse or promote products derived from this
andreikovacs 0:4eb2240dbd22 19 * software without specific prior written permission.
andreikovacs 0:4eb2240dbd22 20 *
andreikovacs 0:4eb2240dbd22 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
andreikovacs 0:4eb2240dbd22 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
andreikovacs 0:4eb2240dbd22 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
andreikovacs 0:4eb2240dbd22 24 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
andreikovacs 0:4eb2240dbd22 25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
andreikovacs 0:4eb2240dbd22 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
andreikovacs 0:4eb2240dbd22 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
andreikovacs 0:4eb2240dbd22 28 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
andreikovacs 0:4eb2240dbd22 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
andreikovacs 0:4eb2240dbd22 30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
andreikovacs 0:4eb2240dbd22 31 */
andreikovacs 0:4eb2240dbd22 32
andreikovacs 0:4eb2240dbd22 33 /************************************************************************************
andreikovacs 0:4eb2240dbd22 34 *************************************************************************************
andreikovacs 0:4eb2240dbd22 35 * Include
andreikovacs 0:4eb2240dbd22 36 *************************************************************************************
andreikovacs 0:4eb2240dbd22 37 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 38 #include "Connectivity_Test_Platform.h"
andreikovacs 0:4eb2240dbd22 39
andreikovacs 0:4eb2240dbd22 40 /************************************************************************************
andreikovacs 0:4eb2240dbd22 41 *************************************************************************************
andreikovacs 0:4eb2240dbd22 42 * Macros
andreikovacs 0:4eb2240dbd22 43 *************************************************************************************
andreikovacs 0:4eb2240dbd22 44 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 45 #define gCTSelf_EVENT_c (1<<7)
andreikovacs 0:4eb2240dbd22 46 #define SelfNotificationEvent() (OSA_EventSet(&gTaskEvent, gCTSelf_EVENT_c));
andreikovacs 0:4eb2240dbd22 47
andreikovacs 0:4eb2240dbd22 48 /************************************************************************************
andreikovacs 0:4eb2240dbd22 49 *************************************************************************************
andreikovacs 0:4eb2240dbd22 50 * Public memory declarations
andreikovacs 0:4eb2240dbd22 51 *************************************************************************************
andreikovacs 0:4eb2240dbd22 52 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 53
andreikovacs 0:4eb2240dbd22 54 /************************************************************************************
andreikovacs 0:4eb2240dbd22 55 *************************************************************************************
andreikovacs 0:4eb2240dbd22 56 * Public memory declarations
andreikovacs 0:4eb2240dbd22 57 *************************************************************************************
andreikovacs 0:4eb2240dbd22 58 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 59 const registerLimits_t registerIntervals[] =
andreikovacs 0:4eb2240dbd22 60 {
andreikovacs 0:4eb2240dbd22 61 {.regStart=0x00 , .regEnd=0x26, TRUE},
andreikovacs 0:4eb2240dbd22 62 {.regStart=0x28 , .regEnd=0x3F, TRUE},
andreikovacs 0:4eb2240dbd22 63 {.regStart=0x00 , .regEnd=0x28, FALSE},
andreikovacs 0:4eb2240dbd22 64 {.regStart=0x2A , .regEnd=0x2E, FALSE},
andreikovacs 0:4eb2240dbd22 65 {.regStart=0x30 , .regEnd=0x32, FALSE},
andreikovacs 0:4eb2240dbd22 66 {.regStart=0x34 , .regEnd=0x45, FALSE},
andreikovacs 0:4eb2240dbd22 67 {.regStart=0x47 , .regEnd=0x56, FALSE},
andreikovacs 0:4eb2240dbd22 68 {.regStart=0x58 , .regEnd=0x5B, FALSE},
andreikovacs 0:4eb2240dbd22 69 {.regStart=0x5D , .regEnd=0x6B, FALSE},
andreikovacs 0:4eb2240dbd22 70 {.regStart=0x6E , .regEnd=0x71, FALSE},
andreikovacs 0:4eb2240dbd22 71 {.regStart=0x74 , .regEnd=0x75, FALSE},
andreikovacs 0:4eb2240dbd22 72 {.regStart=0x78 , .regEnd=0x83, FALSE},
andreikovacs 0:4eb2240dbd22 73 {.regStart=0x86 , .regEnd=0x86, FALSE},
andreikovacs 0:4eb2240dbd22 74 {.regStart=0x89 , .regEnd=0x8A, FALSE},
andreikovacs 0:4eb2240dbd22 75 {.regStart=0x8D , .regEnd=0x8E, FALSE},
andreikovacs 0:4eb2240dbd22 76 {.regStart=0x91 , .regEnd=0x97, FALSE},
andreikovacs 0:4eb2240dbd22 77 {.regStart=0x9A , .regEnd=0xA1, FALSE},
andreikovacs 0:4eb2240dbd22 78 {.regStart=0xA3 , .regEnd=0xA8, FALSE},
andreikovacs 0:4eb2240dbd22 79 {.regStart=0xAA , .regEnd=0xAF, FALSE},
andreikovacs 0:4eb2240dbd22 80 {.regStart=0xB2 , .regEnd=0xB6, FALSE},
andreikovacs 0:4eb2240dbd22 81 {.regStart=0xFE , .regEnd=0xFF, FALSE},
andreikovacs 0:4eb2240dbd22 82 {.regStart=0x00 , .regEnd=0x00, FALSE}
andreikovacs 0:4eb2240dbd22 83 };
andreikovacs 0:4eb2240dbd22 84
andreikovacs 0:4eb2240dbd22 85 uint8_t u8Prbs9Buffer[] =
andreikovacs 0:4eb2240dbd22 86 {
andreikovacs 0:4eb2240dbd22 87 0x42,
andreikovacs 0:4eb2240dbd22 88 0xff,0xc1,0xfb,0xe8,0x4c,0x90,0x72,0x8b,0xe7,0xb3,0x51,0x89,0x63,0xab,0x23,0x23,
andreikovacs 0:4eb2240dbd22 89 0x02,0x84,0x18,0x72,0xaa,0x61,0x2f,0x3b,0x51,0xa8,0xe5,0x37,0x49,0xfb,0xc9,0xca,
andreikovacs 0:4eb2240dbd22 90 0x0c,0x18,0x53,0x2c,0xfd,0x45,0xe3,0x9a,0xe6,0xf1,0x5d,0xb0,0xb6,0x1b,0xb4,0xbe,
andreikovacs 0:4eb2240dbd22 91 0x2a,0x50,0xea,0xe9,0x0e,0x9c,0x4b,0x5e,0x57,0x24,0xcc,0xa1,0xb7,0x59,0xb8,0x87
andreikovacs 0:4eb2240dbd22 92 };
andreikovacs 0:4eb2240dbd22 93 /************************************************************************************
andreikovacs 0:4eb2240dbd22 94 *************************************************************************************
andreikovacs 0:4eb2240dbd22 95 * Private function prototypes
andreikovacs 0:4eb2240dbd22 96 *************************************************************************************
andreikovacs 0:4eb2240dbd22 97 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 98
andreikovacs 0:4eb2240dbd22 99 /************************************************************************************
andreikovacs 0:4eb2240dbd22 100 *
andreikovacs 0:4eb2240dbd22 101 * InitApp_custom
andreikovacs 0:4eb2240dbd22 102 *
andreikovacs 0:4eb2240dbd22 103 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 104 void InitApp_custom()
andreikovacs 0:4eb2240dbd22 105 {
andreikovacs 0:4eb2240dbd22 106 }
andreikovacs 0:4eb2240dbd22 107
andreikovacs 0:4eb2240dbd22 108 /************************************************************************************
andreikovacs 0:4eb2240dbd22 109 *
andreikovacs 0:4eb2240dbd22 110 * InitProject_custom
andreikovacs 0:4eb2240dbd22 111 *
andreikovacs 0:4eb2240dbd22 112 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 113 void InitProject_custom()
andreikovacs 0:4eb2240dbd22 114 {
andreikovacs 0:4eb2240dbd22 115 }
andreikovacs 0:4eb2240dbd22 116
andreikovacs 0:4eb2240dbd22 117 /************************************************************************************
andreikovacs 0:4eb2240dbd22 118 *
andreikovacs 0:4eb2240dbd22 119 * ShortCutsParser
andreikovacs 0:4eb2240dbd22 120 *
andreikovacs 0:4eb2240dbd22 121 * Performs changes in different menus whenever shortcuts are allowed
andreikovacs 0:4eb2240dbd22 122 *
andreikovacs 0:4eb2240dbd22 123 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 124 void ShortCutsParser(uint8_t u8UartData)
andreikovacs 0:4eb2240dbd22 125 {
andreikovacs 0:4eb2240dbd22 126 evTestParameters = TRUE;
andreikovacs 0:4eb2240dbd22 127 evDataFromUART = FALSE;
andreikovacs 0:4eb2240dbd22 128 switch(u8UartData){
andreikovacs 0:4eb2240dbd22 129 case 't':
andreikovacs 0:4eb2240dbd22 130 testOpMode = mTxOperation_c;
andreikovacs 0:4eb2240dbd22 131 break;
andreikovacs 0:4eb2240dbd22 132 case 'r':
andreikovacs 0:4eb2240dbd22 133 testOpMode = mRxOperation_c;
andreikovacs 0:4eb2240dbd22 134 break;
andreikovacs 0:4eb2240dbd22 135 case 'q':
andreikovacs 0:4eb2240dbd22 136 if(testChannel == (channels_t)gTotalChannels)
andreikovacs 0:4eb2240dbd22 137 {
andreikovacs 0:4eb2240dbd22 138 testChannel = gChannel11_c;
andreikovacs 0:4eb2240dbd22 139 }
andreikovacs 0:4eb2240dbd22 140 else
andreikovacs 0:4eb2240dbd22 141 {
andreikovacs 0:4eb2240dbd22 142 testChannel++;
andreikovacs 0:4eb2240dbd22 143 }
andreikovacs 0:4eb2240dbd22 144 break;
andreikovacs 0:4eb2240dbd22 145 case 'w':
andreikovacs 0:4eb2240dbd22 146 if(testChannel == gChannel11_c)
andreikovacs 0:4eb2240dbd22 147 {
andreikovacs 0:4eb2240dbd22 148 testChannel = (channels_t)gTotalChannels;
andreikovacs 0:4eb2240dbd22 149 }
andreikovacs 0:4eb2240dbd22 150 else
andreikovacs 0:4eb2240dbd22 151 {
andreikovacs 0:4eb2240dbd22 152 testChannel--;
andreikovacs 0:4eb2240dbd22 153 }
andreikovacs 0:4eb2240dbd22 154 break;
andreikovacs 0:4eb2240dbd22 155 case 'a':
andreikovacs 0:4eb2240dbd22 156 testPower++;
andreikovacs 0:4eb2240dbd22 157 if(gMaxOutputPower_c < testPower)
andreikovacs 0:4eb2240dbd22 158 {
andreikovacs 0:4eb2240dbd22 159 testPower = gMinOutputPower_c;
andreikovacs 0:4eb2240dbd22 160 }
andreikovacs 0:4eb2240dbd22 161 break;
andreikovacs 0:4eb2240dbd22 162 case 's':
andreikovacs 0:4eb2240dbd22 163 if(testPower == gMinOutputPower_c)
andreikovacs 0:4eb2240dbd22 164 {
andreikovacs 0:4eb2240dbd22 165 testPower = gMaxOutputPower_c;
andreikovacs 0:4eb2240dbd22 166 }
andreikovacs 0:4eb2240dbd22 167 else
andreikovacs 0:4eb2240dbd22 168 {
andreikovacs 0:4eb2240dbd22 169 testPower--;
andreikovacs 0:4eb2240dbd22 170 }
andreikovacs 0:4eb2240dbd22 171 break;
andreikovacs 0:4eb2240dbd22 172 case 'n':
andreikovacs 0:4eb2240dbd22 173 testPayloadLen++;
andreikovacs 0:4eb2240dbd22 174 if(gMaxSmacSDULength_c < testPayloadLen)
andreikovacs 0:4eb2240dbd22 175 {
andreikovacs 0:4eb2240dbd22 176 testPayloadLen = 17;
andreikovacs 0:4eb2240dbd22 177 }
andreikovacs 0:4eb2240dbd22 178 break;
andreikovacs 0:4eb2240dbd22 179 case 'm':
andreikovacs 0:4eb2240dbd22 180 testPayloadLen--;
andreikovacs 0:4eb2240dbd22 181 if(17 > testPayloadLen)
andreikovacs 0:4eb2240dbd22 182 {
andreikovacs 0:4eb2240dbd22 183 testPayloadLen = gMaxSmacSDULength_c;
andreikovacs 0:4eb2240dbd22 184 }
andreikovacs 0:4eb2240dbd22 185 break;
andreikovacs 0:4eb2240dbd22 186 case 'k':
andreikovacs 0:4eb2240dbd22 187 ccaThresh++;
andreikovacs 0:4eb2240dbd22 188 if(ccaThresh > gMaxCCAThreshold_c)
andreikovacs 0:4eb2240dbd22 189 {
andreikovacs 0:4eb2240dbd22 190 ccaThresh = gMinCCAThreshold_c;
andreikovacs 0:4eb2240dbd22 191 }
andreikovacs 0:4eb2240dbd22 192 break;
andreikovacs 0:4eb2240dbd22 193 case 'l':
andreikovacs 0:4eb2240dbd22 194 ccaThresh--;
andreikovacs 0:4eb2240dbd22 195 if(ccaThresh > gMaxCCAThreshold_c)
andreikovacs 0:4eb2240dbd22 196 {
andreikovacs 0:4eb2240dbd22 197 ccaThresh = gMaxCCAThreshold_c;
andreikovacs 0:4eb2240dbd22 198 }
andreikovacs 0:4eb2240dbd22 199 break;
andreikovacs 0:4eb2240dbd22 200 default:
andreikovacs 0:4eb2240dbd22 201 evDataFromUART = TRUE;
andreikovacs 0:4eb2240dbd22 202 evTestParameters = FALSE;
andreikovacs 0:4eb2240dbd22 203 break;
andreikovacs 0:4eb2240dbd22 204 }
andreikovacs 0:4eb2240dbd22 205 }