Diagnostic

APIs for diagnostic and test chip modes.

Modules

EFR32
Types specific to the EFR32 for the diagnostic routines.

Data Structures

struct RAIL_VerifyConfig_t
The configuration array provided to RAIL for use by the radio state verification feature.

Macros

#define RAIL_VERIFY_DURATION_MAX 0xFFFFFFFFUL
This radio state verification duration indicates to RAIL that all memory contents should be verified by RAIL before returning to the application.

Typedefs

typedef bool(* RAIL_VerifyCallbackPtr_t ) (uint32_t address, uint32_t expectedValue, uint32_t actualValue)
A pointer to a verification callback function.

Enumerations

enum RAIL_StreamMode_t {
RAIL_STREAM_CARRIER_WAVE = 0,
RAIL_STREAM_PN9_STREAM = 1,
RAIL_STREAM_10_STREAM = 2,
RAIL_STREAM_CARRIER_WAVE_PHASENOISE = 3,
RAIL_STREAM_RAMP_STREAM = 4,
RAIL_STREAM_CARRIER_WAVE_SHIFTED = 5,
RAIL_STREAM_MODES_COUNT
}
Possible stream output modes.

Functions

RAIL_Status_t RAIL_ConfigDirectMode ( RAIL_Handle_t railHandle, const RAIL_DirectModeConfig_t *directModeConfig)
Configure direct mode for RAIL.
RAIL_Status_t RAIL_EnableDirectMode ( RAIL_Handle_t railHandle, bool enable)
Enable or disable direct mode for RAIL.
RAIL_Status_t RAIL_EnableDirectModeAlt ( RAIL_Handle_t railHandle, bool enableDirectTx, bool enableDirectRx)
Enable or disable direct mode for RAIL.
uint32_t RAIL_GetRadioClockFreqHz ( RAIL_Handle_t railHandle)
Get the radio subsystem clock frequency in Hz.
RAIL_Status_t RAIL_SetTune ( RAIL_Handle_t railHandle, uint32_t tune)
Set the crystal tuning.
uint32_t RAIL_GetTune ( RAIL_Handle_t railHandle)
Get the crystal tuning.
RAIL_Status_t RAIL_SetTuneDelta ( RAIL_Handle_t railHandle, int32_t delta)
Set the crystal tuning delta.
int32_t RAIL_GetTuneDelta ( RAIL_Handle_t railHandle)
Get the crystal tuning delta on EFR32xG2 series devices.
RAIL_FrequencyOffset_t RAIL_GetRxFreqOffset ( RAIL_Handle_t railHandle)
Get the frequency offset.
RAIL_Status_t RAIL_SetFreqOffset ( RAIL_Handle_t railHandle, RAIL_FrequencyOffset_t freqOffset)
Set the nominal radio frequency offset.
RAIL_Status_t RAIL_StartTxStream ( RAIL_Handle_t railHandle, uint16_t channel, RAIL_StreamMode_t mode)
Start transmitting a stream on a certain channel.
RAIL_Status_t RAIL_StartTxStreamAlt ( RAIL_Handle_t railHandle, uint16_t channel, RAIL_StreamMode_t mode, RAIL_TxOptions_t options)
Start transmitting a stream on a certain channel with the ability to select an antenna.
RAIL_Status_t RAIL_StopTxStream ( RAIL_Handle_t railHandle)
Stop stream transmission.
RAIL_Status_t RAIL_StopInfinitePreambleTx ( RAIL_Handle_t railHandle)
Stop infinite preamble transmission started and start transmitting the rest of the packet.
RAIL_Status_t RAIL_ConfigVerification ( RAIL_Handle_t railHandle, RAIL_VerifyConfig_t *configVerify, const uint32_t *radioConfig, RAIL_VerifyCallbackPtr_t cb)
Configure the verification of radio memory contents.
RAIL_Status_t RAIL_Verify ( RAIL_VerifyConfig_t *configVerify, uint32_t durationUs, bool restart)
Verify radio memory contents.

Detailed Description

APIs for diagnostic and test chip modes.

Typedef Documentation

RAIL_VerifyCallbackPtr_t

typedef bool(* RAIL_VerifyCallbackPtr_t) (uint32_t address, uint32_t expectedValue, uint32_t actualValue)

A pointer to a verification callback function.

This will be called by the radio state verification feature built into RAIL when a verified memory value is different from its reference value.

Parameters
[in] address The address of the data in question.
[in] expectedValue The expected value of the data in question.
[in] actualValue The actual value of the data in question.
Returns
bool True indicates a data value difference is acceptable. False indicates a data value difference in unacceptable.
Note
This callback will be issued when an address' value is different from its reference value and either of the following conditions are met: 1) The default radio configuration provided by the radio configurator is used for verification purposes (i.e., a custom radio configuration is not supplied as an input to RAIL_ConfigVerification() ), and the radio configurator has flagged the address under question as being verifiable. 2) A custom radio configuration is provided to the verification API (i.e., a custom radio configuration is supplied as an input to RAIL_ConfigVerification() ). When providing a custom radio configuration for verification purposes, all addresses in that configuration will be verified, regardless of whether or not the addresses are flagged as verifiable.

Definition at line 4164 of file rail_types.h .

Enumeration Type Documentation

RAIL_StreamMode_t

Possible stream output modes.

Enumerator
RAIL_STREAM_CARRIER_WAVE

An unmodulated carrier wave.

RAIL_STREAM_PN9_STREAM

PN9 byte sequence.

RAIL_STREAM_10_STREAM

101010 sequence.

RAIL_STREAM_CARRIER_WAVE_PHASENOISE

An unmodulated carrier wave with no change to PLL BW.

For series-2, same as RAIL_STREAM_CARRIER_WAVE

RAIL_STREAM_RAMP_STREAM

ramp sequence starting at a different offset for consecutive packets.

Only available for some modulations. Fall back to RAIL_STREAM_PN9_STREAM if not available.

RAIL_STREAM_CARRIER_WAVE_SHIFTED

An unmodulated carrier wave not centered on DC but shifted roughly by channel_bandwidth/6 allowing an easy check of the residual DC.

Only available for OFDM PA. Fall back to RAIL_STREAM_CARRIER_WAVE_PHASENOISE if not available.

RAIL_STREAM_MODES_COUNT

A count of the choices in this enumeration.

Must be last.

Definition at line 4111 of file rail_types.h .

Function Documentation

RAIL_ConfigDirectMode()

RAIL_Status_t RAIL_ConfigDirectMode ( RAIL_Handle_t railHandle,
const RAIL_DirectModeConfig_t * directModeConfig
)

Configure direct mode for RAIL.

Parameters
[in] railHandle A RAIL instance handle.
[in] directModeConfig Configuration structure to specify direct mode parameters. Default configuration will be used if NULL is passed.
Returns
RAIL_STATUS_NO_ERROR on success and an error code on failure.

This API configures direct mode and should be called before calling RAIL_EnableDirectMode() . If this function is not called, the following default configuration will be used:
EFR32xG1x
Sync Rx : false
Sync Tx : false
TX data in (DIN) : EFR32_PC10
RX data out (DOUT) : EFR32_PC11
TX/RX clk out (DCLK) : EFR32_PC9
EFR32xG2x:
Sync Rx : false
Sync Tx : false
TX data in (DIN) : EFR32_PA7
RX data out (DOUT) : EFR32_PA5
TX/RX clk out (DCLK) : EFR32_PA6

Warning
This API is not safe to use in a multiprotocol app.

RAIL_ConfigVerification()

RAIL_Status_t RAIL_ConfigVerification ( RAIL_Handle_t railHandle,
RAIL_VerifyConfig_t * configVerify,
const uint32_t * radioConfig,
RAIL_VerifyCallbackPtr_t cb
)

Configure the verification of radio memory contents.

Parameters
[in] railHandle A RAIL instance handle.
[in,out] configVerify A configuration structure made available to RAIL to perform radio state verification. This structure must be allocated in application global read-write memory. RAIL may modify fields within or referenced by this structure during its operation.
[in] radioConfig A pointer to a radioConfig that is to be used as a white list for verifying memory contents.
[in] cb A callback that notifies the application of a mismatch in expected vs actual memory contents. A NULL parameter may be passed in if a callback is not provided by the application.
Returns
RAIL_STATUS_NO_ERROR if setup of the verification feature successfully occurred. RAIL_STATUS_INVALID_PARAMETER is returned if the provided railHandle or configVerify structures are invalid.

RAIL_EnableDirectMode()

RAIL_Status_t RAIL_EnableDirectMode ( RAIL_Handle_t railHandle,
bool enable
)

Enable or disable direct mode for RAIL.

Parameters
[in] railHandle A RAIL instance handle.
[in] enable Whether or not to enable direct mode for TX and RX.
Returns
RAIL_STATUS_NO_ERROR on success and an error code on failure.
Warning
New applications should consider using RAIL_EnableDirectModeAlt() for this functionality.
Note
This feature is only available on certain devices. RAIL_SupportsDirectMode() can be used to check if a particular device supports this feature or not.
Warning
This API is not safe to use in a true multiprotocol app.

RAIL_EnableDirectModeAlt()

RAIL_Status_t RAIL_EnableDirectModeAlt ( RAIL_Handle_t railHandle,
bool enableDirectTx,
bool enableDirectRx
)

Enable or disable direct mode for RAIL.

Parameters
[in] railHandle A RAIL instance handle.
[in] enableDirectTx Enable direct mode for data being transmitted out of the radio.
[in] enableDirectRx Enable direct mode for data being received from the radio.
Returns
RAIL_STATUS_NO_ERROR on success and an error code on failure.

This API enables or disables the modem and GPIOs for direct mode operation. see /ref RAIL_ConfigDirectMode for information on selecting the correct hardware configuration. If direct mode is enabled, packets are output and input directly to the radio via GPIO and RAIL packet handling is ignored.

Note
This feature is only available on certain chips. RAIL_SupportsDirectMode() can be used to check if a particular chip supports this feature or not.
Warning
this API is not safe to use in a true multiprotocol app.

RAIL_GetRadioClockFreqHz()

uint32_t RAIL_GetRadioClockFreqHz ( RAIL_Handle_t railHandle )

Get the radio subsystem clock frequency in Hz.

Parameters
[in] railHandle A RAIL instance handle.
Returns
Radio subsystem clock frequency in Hz.

RAIL_GetRxFreqOffset()

RAIL_FrequencyOffset_t RAIL_GetRxFreqOffset ( RAIL_Handle_t railHandle )

Get the frequency offset.

Parameters
[in] railHandle A RAIL instance handle.
Returns
Returns the measured frequency offset on a received packet. The units are described in the RAIL_FrequencyOffset_t documentation. If this returns RAIL_FREQUENCY_OFFSET_INVALID , it was called while the radio wasn't active and there is no way to get the frequency offset.

Retrieves the measured frequency offset used during the previous received packet, which includes the current radio frequency offset (see RAIL_SetFreqOffset() ). If the chip has not been in RX, it returns the nominal radio frequency offset.

Note
Changing to any non-idle radio state after reception can cause this value to be overwritten so it is safest to capture during packet reception.

RAIL_GetTune()

uint32_t RAIL_GetTune ( RAIL_Handle_t railHandle )

Get the crystal tuning.

Parameters
[in] railHandle A RAIL instance handle.
Returns
A chip-dependent crystal capacitor bank tuning parameter.

Retrieves the current tuning value used by the crystal that the radio depends on.

Note
On EFR32xG2 series devices, this is the CTUNEXIANA value.

RAIL_GetTuneDelta()

int32_t RAIL_GetTuneDelta ( RAIL_Handle_t railHandle )

Get the crystal tuning delta on EFR32xG2 series devices.

Parameters
[in] railHandle A RAIL instance handle.
Returns
A chip-dependent crystal capacitor bank tuning delta.

Retrieves the current tuning delta used by RAIL_SetTune .

Note
The default delta if RAIL_SetTuneDelta has never been called is device-dependent and may not be 0.

RAIL_SetFreqOffset()

RAIL_Status_t RAIL_SetFreqOffset ( RAIL_Handle_t railHandle,
RAIL_FrequencyOffset_t freqOffset
)

Set the nominal radio frequency offset.

Parameters
[in] railHandle A RAIL instance handle.
[in] freqOffset RAIL_FrequencyOffset_t parameter (signed, 2's complement).
Returns
Status code indicating success of the function call.

This function is used to adjust the radio's tuning frequency slightly up or down. It might be used in conjunction with RAIL_GetRxFreqOffset() after receiving a packet from a peer to adjust the tuner to better match the peer's tuned frequency.

Note
Unlike RAIL_SetTune() , which affects the entire chip's timing including radio tuning and channel spacing, this function only affects radio tuning without disturbing channel spacing or other chip peripheral timing.

RAIL_SetTune()

RAIL_Status_t RAIL_SetTune ( RAIL_Handle_t railHandle,
uint32_t tune
)

Set the crystal tuning.

Parameters
[in] railHandle A RAIL instance handle.
[in] tune A chip-dependent crystal capacitor bank tuning parameter.
Returns
Status code indicating success of the function call.

Tunes the crystal that the radio depends on to change the location of the center frequency for transmitting and receiving. This function will only succeed if the radio is idle at the time of the call.

Note
This function proportionally affects the entire chip's timing across all its peripherals, including radio tuning and channel spacing. A separate function, RAIL_SetFreqOffset() , can be used to adjust just the radio tuner without disturbing channel spacing or other chip peripheral timing.
On EFR32xG2 series devices, this API sets CTUNEXIANA and internally CTUNEXOANA = CTUNEXIANA + delta where delta is set or changed by RAIL_SetTuneDelta . The default delta may not be 0 on some devices.

RAIL_SetTuneDelta()

RAIL_Status_t RAIL_SetTuneDelta ( RAIL_Handle_t railHandle,
int32_t delta
)

Set the crystal tuning delta.

Parameters
[in] railHandle A RAIL instance handle.
[in] delta A chip-dependent crystal capacitor bank tuning delta.
Returns
Status code indicating success of the function call.

Set the CTUNEXOANA delta for RAIL_SetTune to use on EFR32xG2 series devices: CTUNEXOANA = CTUNEXIANA + delta. This function does not change CTUNE values; call RAIL_SetTune to put a new delta into effect.

RAIL_StartTxStream()

RAIL_Status_t RAIL_StartTxStream ( RAIL_Handle_t railHandle,
uint16_t channel,
RAIL_StreamMode_t mode
)

Start transmitting a stream on a certain channel.

Parameters
[in] railHandle A RAIL instance handle.
[in] channel A channel on which to emit a stream.
[in] mode Choose the stream mode (PN9, and so on).
Returns
Status code indicating success of the function call.

Begins streaming onto the given channel. The sources can either be an unmodulated carrier wave or an encoded stream of bits from a PN9 source. All ongoing radio operations will be stopped before transmission begins.

RAIL_StartTxStreamAlt()

RAIL_Status_t RAIL_StartTxStreamAlt ( RAIL_Handle_t railHandle,
uint16_t channel,
RAIL_StreamMode_t mode,
RAIL_TxOptions_t options
)

Start transmitting a stream on a certain channel with the ability to select an antenna.

Parameters
[in] railHandle A RAIL instance handle.
[in] channel A channel on which to emit a stream.
[in] mode Choose the stream mode (PN9, and so on).
[in] options Choose the TX Antenna option. Takes only RAIL_TX_OPTION_ANTENNA0 , RAIL_TX_OPTION_ANTENNA1 , RAIL_TX_OPTIONS_DEFAULT or RAIL_TX_OPTIONS_NONE from the RAIL_TxOptions_t . If some other value is used then, transmission is possible on any antenna.
Returns
Status code indicating success of the function call.

Begins streaming onto the given channel. The sources can either be an unmodulated carrier wave or an encoded stream of bits from a PN9 source. All ongoing radio operations will be stopped before transmission begins.

RAIL_StopInfinitePreambleTx()

RAIL_Status_t RAIL_StopInfinitePreambleTx ( RAIL_Handle_t railHandle )

Stop infinite preamble transmission started and start transmitting the rest of the packet.

This function is only useful for radio configurations that specify an infinite preamble. Call this API only after RAIL_EVENT_TX_STARTED has occurred and the radio is transmitting.

Parameters
[in] railHandle A RAIL instance handle.
Returns
Status code indicating success of the function call: RAIL_STATUS_NO_ERROR if infinite preamble was stopped; RAIL_STATUS_INVALID_CALL if the radio isn't configured for infinite preamble; RAIL_STATUS_INVALID_STATE if the radio isn't transmitting.

RAIL_StopTxStream()

RAIL_Status_t RAIL_StopTxStream ( RAIL_Handle_t railHandle )

Stop stream transmission.

Parameters
[in] railHandle A RAIL instance handle.
Returns
Status code indicating success of the function call.

Halts the transmission started by RAIL_StartTxStream() .

RAIL_Verify()

RAIL_Status_t RAIL_Verify ( RAIL_VerifyConfig_t * configVerify,
uint32_t durationUs,
bool restart
)

Verify radio memory contents.

Parameters
[in,out] configVerify A configuration structure made available to RAIL to perform radio state verification. This structure must be allocated in application global read-write memory. RAIL may modify fields within or referenced by this structure during its operation.
[in] durationUs The duration (in microseconds) for how long memory verification should occur before returning to the application. A value of RAIL_VERIFY_DURATION_MAX indicates that all memory contents should be verified before returning to the application.
[in] restart This flag only has meaning if a previous call of this function returned RAIL_STATUS_SUSPENDED . By restarting (true), the verification process starts over from the beginning, or by resuming where verification left off after being suspended (false), verification can proceed towards completion.
Returns
RAIL_STATUS_NO_ERROR if the contents of all applicable memory locations have been verified. RAIL_STATUS_SUSPENDED is returned if the provided test duration expired but the time was not sufficient to verify all memory contents. By calling RAIL_Verify again, further verification will commence. RAIL_STATUS_INVALID_PARAMETER is returned if the provided verifyConfig structure pointer is not configured for use by the active RAIL handle. RAIL_STATUS_INVALID_STATE is returned if any of the verified memory contents are different from their reference values.