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

Source/Connectivity_Test_Platform.h

Committer:
andreikovacs
Date:
2015-07-16
Revision:
0:4eb2240dbd22
Child:
1:1eb1eccc81c2

File content as of revision 0:4eb2240dbd22:

/*!
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* All rights reserved.
*
* \file App_Custom.h
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
*   of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice, this
*   list of conditions and the following disclaimer in the documentation and/or
*   other materials provided with the distribution.
*
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
*   contributors may be used to endorse or promote products derived from this
*   software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


/************************************************************************************
*************************************************************************************
* Include
*************************************************************************************
************************************************************************************/
#include "MemManager.h"
#include "SMAC_Interface.h"         /*@CMA Conn Test*/
#include "AspInterface.h"
#include "ConnectivityMenus.h"

#if 0
#include "SerialManager.h"
#include "LED.h"                    /*Include all LED functionality*/ 
#include "TimersManager.h"
#include "FunctionLib.h"
#include "fsl_os_abstraction.h"
#include "fsl_osa_ext.h"
#include "board.h"
#endif
/************************************************************************************
*************************************************************************************
* Currently supported feature-sets. 
* DO NOT CHANGE as they MIGHT be platform dependent
*************************************************************************************
************************************************************************************/
/*This feature is only for sub-ghz phy's*/
#ifndef CT_Feature_Bitrate_Select
#define CT_Feature_Bitrate_Select  (0)
#endif

/*This feature is only for platforms that have BER Test Connectors
*(currently only KW01)*/
#ifndef CT_Feature_BER_Test
#define CT_Feature_BER_Test        (0)
#endif

#ifndef CT_Feature_Direct_Registers
#define CT_Feature_Direct_Registers (1)
#endif

#ifndef CT_Feature_Indirect_Registers
#define CT_Feature_Indirect_Registers (1)
#endif

/*This feature is currently supported only on KW01 platforms*/
#ifndef CT_Feature_Calibration
#define CT_Feature_Calibration     (0)
#endif

/*This feature is only for sub-ghz platforms*/
#ifndef CT_Feature_Custom_CCA_Dur
#define CT_Feature_Custom_CCA_Dur  (0)
#endif

/*This feature is currently supported on KW01. Disabled by default*/
#ifndef CT_Feature_Afc
#define CT_Feature_Afc             (0)
#endif


#if CT_Feature_Calibration
#include "Flash_Adapter.h"
#endif

/************************************************************************************
*************************************************************************************
* Macros
*************************************************************************************
************************************************************************************/
#define gMaxOutputPower_c          ( 0x1F ) 
#define gMinOutputPower_c              ( 0x03 )
#define gDefaultOutputPower_c          ( 0x1F )

#if CT_Feature_Calibration
#define gMinAdditionalRFOffset_c       ( -1000)
#define gMaxAdditionalRFOffset_c       ( 1000 )
#endif
             
#define gDefaultChannelNumber_c         gChannel15_c                                    
#define gMaxCCAThreshold_c              0x6EU
#define gMinCCAThreshold_c              0x00U
#define gDefaultCCAThreshold_c          0x50U

/*register size in bytes and ASCII characters macros*/

#define gRegisterSize_c      (1)
#define gRegisterSizeASCII_c (2*gRegisterSize_c)

/*register address size in ASCII*/
#define gRegisterAddress_c  (1)
#define gRegisterAddressASCII_c (2*gRegisterAddress_c)

/************************************************************************************
*************************************************************************************
* Memory Type Definitions
*************************************************************************************
************************************************************************************/

/* these type definitions must be changed depending on register size and address range*/
typedef uint8_t registerSize_t;
typedef uint8_t registerAddressSize_t;

/*this structure defines the upper and lower bound for dump registers feature*/
typedef struct registerLimits_tag
{
  registerAddressSize_t regStart;
  registerAddressSize_t regEnd;
  bool_t  bIsRegisterDirect;
}registerLimits_t;

typedef enum operationModes_tag
{
  mTxOperation_c,
  mRxOperation_c
}operationModes_t;

/************************************************************************************
*************************************************************************************
* Public memory declarations
*************************************************************************************
************************************************************************************/
extern const registerLimits_t registerIntervals[];

extern uint8_t crtBitrate;

extern bool_t evTestParameters;
extern bool_t evDataFromUART;
extern bool_t bEdDone;
extern bool_t shortCutsEnabled;

extern uint8_t testPower;
extern uint8_t mAppSer;
extern uint8_t gu8UartData;
extern uint8_t au8ScanResults[];
extern uint8_t ccaThresh;
extern uint8_t testPayloadLen;
extern channels_t testChannel;

extern operationModes_t testOpMode;

/************************************************************************************
*************************************************************************************
* Public functions declarations
*************************************************************************************
************************************************************************************/

extern void PrintMenu(char * const pu8Menu[], uint8_t port);
/*common functions declarations which have platform dependent behavior*/
extern void ShortCutsParser( uint8_t u8UartData );
extern void InitApp_custom();
extern void InitProject_custom();