RadioTestLibrary
1.34.0
|
#include <rtl_device_26_13xx.h>
Public Member Functions | |
RTLDevice26_13xx (void) | |
virtual | ~RTLDevice26_13xx (void) |
int | addDynamicOverride (const QString &devId, const QString &type, const QString &value, const QString &id) |
Add Dynamic Override. More... | |
int | connect (const QString rfDevName, const QString &devId) |
Connect to target device. More... | |
int | removeDynamicOverride (const QString &devId, const QString &id) |
Remove Dynamic Override. More... | |
int | doLinkTest (const QString &txId, const QString &rxId, TestResult_t *pTestResult) |
Run link test. More... | |
int | startPacketTx (const QString &txId) |
Start a packet transmission with pre configured packets, interval and number of packets. More... | |
int | eraseFlash (const QString &devName, const QString &devId, EraseInfo_t *pEraseInfo=NULL, FPLFile *pFile=NULL) |
Erase Flash (FPL Feature) More... | |
int | executeCmd (const QString &devId, quint8 *pCmd, const quint16 &cmdLength, quint32 *pCmdResult) |
Execute Command. More... | |
int | programFlash (const QString &devName, const QString &devId, FPLFile *pFplFile, ProgramInfo_t *pProgInfo=NULL) |
Program Flash from file (FPL Feature) More... | |
int | programFlash (const QString &devName, const QString &devId, const quint32 &address, const quint32 &length, quint8 *pBuffer) |
Program Flash from buffer (FPL Feature) More... | |
int | readCmdSettingsFromFile (const QString &devId, TestConfig_t &testConfig) |
Read command settings from file. More... | |
int | readFrequencyOffset (const QString &devId, TestResult_t *pTestResult) |
Read frequency offset value from given device. More... | |
int | readFrequencyOffsetCW (const QString &devId, TestResult_t *pTestResult) |
Read frequency offset value from given device when receiving CW. More... | |
int | readMcuReg (const QString &devId, const quint32 &address, quint32 *pValue) |
Read MCU Register. More... | |
int | readMemory (const QString &devName, const QString &devId, const quint32 &address, quint32 *pLength, quint8 *pBuffer) |
Read memory (FPL Feature) More... | |
int | readRfReg (const QString &devId, const quint32 &address, quint32 *pValue) |
Read RF core Register. More... | |
int | verifyFlash (const QString &devName, const QString &devId, FPLFile *pFplFile, ProgramInfo_t *pProgInfo=NULL) |
Verify Flash (FPL Feature) More... | |
int | writeMemory (const QString &devName, const QString &devId, const quint32 &address, const quint32 &length, quint8 *pBuffer) |
Write memory (FPL Feature) More... | |
int | writeMcuReg (const QString &devId, const quint32 &address, const quint32 &value) |
Write MCU Register. More... | |
int | writeRfReg (const QString &devId, const quint32 &address, const quint32 &value) |
Write RF core Register. More... | |
int | runCpu (const QString &devName, const QString &devId, bool debugMode) |
Run CPU (FPL Feature) More... | |
int | haltCpu (const QString &devName, const QString &devId) |
Halt CPU (FPL Feature) More... | |
int | writeCpuReg (const QString &devName, const QString &devId, const CM3_CPU_REGISTERS ®Number, const uint32_t &value) |
Write CPU register (FPL Feature) More... | |
int | readCpuReg (const QString &devName, const QString &devId, const CM3_CPU_REGISTERS ®Number, uint32_t *pValue) |
Read CPU register (FPL Feature) More... | |
int | setCapArrayDelta (const QString &devId, const qint16 &value) |
Set Cap Array Delta. More... | |
Public Member Functions inherited from RTLDevice | |
RTLDevice (void) | |
virtual | ~RTLDevice (void) |
virtual void | appendError (const QString &error) |
Append error. More... | |
virtual void | clearAllErrors (void) |
Clear errors. More... | |
virtual int | deleteFileObject (FPLFile *pFplFile) |
Delete file Object. More... | |
virtual int | disconnect (const QString &devId) |
Disconnect target device. More... | |
virtual QStringList | enumerateEbs (bool enableXdsDev=false) |
Enumerate EB devices. More... | |
virtual QString | getRfDevNameFromDevId (const QString devId) |
Get RF Device name from Device ID. More... | |
virtual int | executeCmd (const QString &devId, const QString &cmdName) |
Execute command. More... | |
virtual int | getAverageRssi (void) |
virtual QString | getLastError (void) |
Get last error. More... | |
virtual QString | getRfState (const QString &devId) |
Get RF State. More... | |
virtual int | getRssi (const QString &devId, QString *pRssiInDbm, QString *pRssiRaw) |
Get RSSI. More... | |
virtual int | initPacketTx (const QString rfDevName, const QString &devId) |
Initialize Packet TX. More... | |
virtual bool | isConnected (const QString &devId) |
virtual int | isPacketReceived (const QString rfDevName, const QString &devId) |
Is Packet Received. More... | |
virtual FPLFile * | readFile (const QString &devName, const QString &devId, const QString &fileName, const quint32 &startAddress=0) |
Read File. More... | |
virtual int | readPacket (const QString rfDevName, const QString &devId, PacketData_t *pPacketData) |
Read Packet. More... | |
virtual int | resetTarget (const QString rfDevName, const QString &devId, RESET_MODE mode) |
Reset Target device. More... | |
virtual int | sendPacket (const QString rfDevName, const QString &devId) |
Send Packet. More... | |
virtual int | setParameter (const QString &devId, const QString &parName, const QString &parValue) |
Set Parameter. More... | |
virtual void | setPacketData (char *pPayload, int len) |
Set packet Data. More... | |
virtual int | setPacketInterval (const QString &devId, const int &interval) |
Set Packet interval. More... | |
virtual void | setNbrOfPackets (int n) |
virtual int | setIdle (const QString rfDevName, const QString &devId) |
Set device in Idle. More... | |
virtual int | startContTx (const QString rfDevName, const QString &devId, TestResult_t *pTestResult) |
Start continuous TX. More... | |
virtual int | startContRx (const QString rfDevName, const QString &devId, TestResult_t *pTestResult) |
Start continuous RX. More... | |
virtual int | startPacketRx (const QString rfDevName, const QString &devId) |
Start Packet RX. More... | |
Additional Inherited Members | |
Public Types inherited from RTLDevice | |
enum | TEST_MODE { TM_CONT_TX, TM_CONT_RX, TM_PACKET_TX, TM_PACKET_RX } |
enum | TEST_RESULT { TST_OK, TST_FAILED, TST_PKT_RECEIVED, TST_PKT_RX_BUF_OVERFLOW, TST_UNKNOWN } |
enum | TEST_STATE { STATE_DAL, STATE_FPL } |
Static Public Member Functions inherited from RTLDevice | |
static void | initEraseInfo (EraseInfo_t *pEraseInfo) |
static void | initProgramInfo (ProgramInfo_t *pProgInfo) |
static void | setCallBackProgressFunction (_PROGRESS_FUNC_PTR pPf) |
Protected Member Functions inherited from RTLDevice | |
QString | normDeviceName (const QString &rfDevName) |
Function to normalize the device name for use in DAL. More... | |
RTLFlashHandler * | getFlashHandler (const QString &devName, const QString &devId) |
Get Flash Handler. More... | |
bool | fwUpdateRequired (const QString &devId) |
The function will return true if FW updated is required. More... | |
Protected Attributes inherited from RTLDevice | |
int | m_averageRssi |
Used to keep the average RSSI value calculated during a link test. More... | |
QByteArray | m_packetData |
Buffer used for packet data during link test. More... | |
int | m_nbrOfPackets |
Number of packets that will be sent during the link test. More... | |
QList< DeviceInfo_t > | m_ebList |
List of connected EB devices (XDS serial number) returned from DALEbDevice::enumEB() More... | |
QMap< QString, DALEbDevice * > | m_mapConDevices |
Map of connected devices. More... | |
QMultiMap< char, int > | m_mapFreqOffset |
List used to average the frequency offset value. The offset value is used as key and the packet number as value. More... | |
QMap< QString, RTLFlashHandler * > | m_mapFlashHandlers |
Mapped list of Flash handler objects. More... | |
Static Protected Attributes inherited from RTLDevice | |
static _PROGRESS_FUNC_PTR | sm_pProgressFunction = NULL |
Static function pointer used to give feedback on progress. More... | |
RTLDevice26_13xx::RTLDevice26_13xx | ( | void | ) |
|
virtual |
References RTLDevice::m_mapConDevices, RTLDevice::m_mapFlashHandlers, and RTLDevice::TST_OK.
|
virtual |
Add Dynamic Override.
This function can be used to add Register override elements. The default override elements are defined with the command settings and can be found under ..\config\xml\<device name>\overrides. The exact file that is used for a given setting, is specified in the setting_xxx.xml file.
[in] | devId | USB Device ID |
[in] | type | Type of override element. This will determine how the value will be handled. |
[in] | value | The override value |
[in] | id | An override ID. Used to identify the override element. Using the same ID for two different elements will fail. Only the last will be remembered. |
Implements RTLDevice.
References RTLDevice::m_mapConDevices, RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Connect to target device.
This function should be called to setup a connection with given target. If the target doesn't exist in the list of devices, enum in DAL must be called. If DAL object for given device already exist, it will be delete and a new object created.
[in] | rfDevName | RF Device name like "CC2650" |
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
Reimplemented from RTLDevice.
References RTLDevice::connect().
|
virtual |
Remove Dynamic Override.
This function is used to remove override elements that was added with addDynamicOverride()
[in] | devId | USB Device ID |
[in] | id | Override ID as used in function addDynamicOverride(). Used to identify the override element. |
Implements RTLDevice.
References RTLDevice::m_mapConDevices, RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Run link test.
Before calling this function a connection must be setup and the command settings must have been loaded for both the transmitter and the receiver. In addition packet data and number of packets must be set. See connect()
, readCmdSettingsFromFile()
, setPacketData()
and setNbrOfPackets()
This function will set the receiver in RX mode and start sending packets from the transmitter. For each packet sent by the transmitter the receiver will do 3 attempts to check if a packet has been received. If no packet received after 3 attempts, the packet is seen as lost. If packet has been received, the packet is read from receiver and compared with the packet sent from the transmitter. The frequency offset and the RSSI value for each packet will be saved. The sequence of sending and receiving packets will be repeated for the number of packets set with the setNbrOfPackets()
function.
The Packet Error Rate(PER) is calculated using the expected number of packets and the number of successfully received packets: PER = (NbrOfExpPkts - NbrOfRecPkts)/(NbrOfExpPkts * 100)
The RSSI value will be accumulated and the average value calculated at the end.
The Frequency offset value for each packet is stored in a sorted list and at the end the median value of the list will be returned.
[in] | txId | USB Device ID of the TX device. |
[in] | rxId | USB Device ID of the RX device. |
[out] | pTestResult | Pointer to structure with test results:
|
DEBUG
DEBUG
Implements RTLDevice.
References DUMMY_FREQUENCY_OFFSET, RTLDevice::TestResult_t::freqOff, RTLDevice::m_averageRssi, RTLDevice::m_mapConDevices, RTLDevice::m_mapFreqOffset, RTLDevice::m_nbrOfPackets, RTLDevice::m_packetData, NBR_OF_READ_ATTEMPTS, PROGRESS_START_RX, PROGRESS_START_TX, RTLDevice::TestResult_t::qsError, RTLDevice::TestResult_t::result, rssi(), RTLDevice::TestResult_t::rssi, RTLDevice::sm_pProgressFunction, RTLDevice::TST_FAILED, RTLDevice::TST_OK, and RTLDevice::TestResult_t::value.
int RTLDevice26_13xx::startPacketTx | ( | const QString & | txId | ) |
Start a packet transmission with pre configured packets, interval and number of packets.
[in] | txId | USB Device ID of the TX device. |
References RTLDevice::appendError(), RTLDevice::m_mapConDevices, RTLDevice::m_nbrOfPackets, RTLDevice::m_packetData, PROGRESS_START_TX, RTLDevice::sm_pProgressFunction, RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Erase Flash (FPL Feature)
This function will erase the part of flash specified in pEraseInfo
.
Erase type RTLDevice::ET_ERASE_ALL_FORCED, must be followed by a device re-connect.
[in] | devName | Device name |
[in] | devId | USB Device ID |
[in] | pEraseInfo | Pointer to erase info. If set to NULL all main flash sectors that are not locked will be erased. |
[in] | pFile | Pointer to FPL file object. Must be given if erase type is set to RTLDevice::ET_ERASE_PAGES_IN_SOURCE. |
Implements RTLDevice.
References RTLDevice::appendError(), RTLDevice::getFlashHandler(), and RTLDevice::TST_FAILED.
int RTLDevice26_13xx::executeCmd | ( | const QString & | devId, |
quint8 * | pCmd, | ||
const quint16 & | cmdLength, | ||
quint32 * | pCmdResult | ||
) |
Execute Command.
This function is an override of the exported function and support execution of commands defined by the command buffer.
[in] | devId | USB Device ID |
[in] | pCmd | Pointer to the command buffer |
[in] | cmdLength | Length of the command buffer |
[in] | pCmdResult | Status of the command. |
References RTLDevice::m_mapConDevices, RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Program Flash from file (FPL Feature)
This function will program the flash with data from the given file. The file format must be either a binary file(*.bin), an Intel hex file(*.hex), or an "elf" file (Executable and Linkable Format, *.elf).
RTLDevice26_13xx::eraseFlash()
.[in] | devName | Device name |
[in] | devId | USB Device ID |
[in] | pFplFile | Pointer to FPL file object |
[in] | pProgInfo | Pointer to program info. If set to NULL, all pages in file will be programmed. |
Implements RTLDevice.
References RTLDevice::appendError(), RTLDevice::getFlashHandler(), and RTLDevice::TST_FAILED.
|
virtual |
Program Flash from buffer (FPL Feature)
This function will program flash with data from the given buffer. To write data to a non-flash memory, see RTLDevice26_13xx::writeMemory()
.
RTLDevice26_13xx::eraseFlash()
.[in] | devName | Device name |
[in] | devId | USB Device ID |
[in] | address | Flash address to program |
[in] | length | Length of data buffer that should be programmed |
[in] | pBuffer | Buffer with input data to be programmed |
Implements RTLDevice.
References RTLDevice::appendError(), RTLDevice::getFlashHandler(), and RTLDevice::TST_FAILED.
|
virtual |
Read command settings from file.
Called to read the command settings for CC26xx or CC13xx. The configuration data will be read from file and used to populate a data buffer on the PC side.
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
[in] | testConfig | Structure with configuration data. |
Implements RTLDevice.
References RTLDevice::appendError(), RTLDevice::clearAllErrors(), RTLDevice::m_mapConDevices, RTLDevice::TestConfig_t::qsCategory, RTLDevice::TestConfig_t::qsSetting, RTLDevice::TestConfig_t::qsTargetName, RTLDevice::TestConfig_t::testMode, RTLDevice::TM_CONT_RX, RTLDevice::TM_CONT_TX, RTLDevice::TM_PACKET_RX, RTLDevice::TM_PACKET_TX, RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Read frequency offset value from given device.
The Frequency offset value is only available after receiving a packet.
Reading of frequency offset value is only supported for a given configuration of the device: CC13xx: Only supported for modulation type FSK and GFSK CC26xx: Only supported for BLE.
[in] | devId | USB Device ID |
[out] | pTestResult | Pointer to structure with test results. |
Reimplemented from RTLDevice.
References FREQ_OFFSET_RESOLUTION_IEEE802_15_4, RTLDevice::TestResult_t::freqOff, RTLDevice::m_mapConDevices, RTLDevice::TestResult_t::qsError, readRfReg(), RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Read frequency offset value from given device when receiving CW.
This function can be used to read the frequency offset while staying in RX and receiving a Continuous Wave.
[in] | devId | USB Device ID |
[out] | pTestResult | Pointer to structure with test results. |
Reimplemented from RTLDevice.
References RTLDevice::appendError(), FREQ_OFFSET_RESOLUTION_IEEE802_15_4, RTLDevice::TestResult_t::freqOff, RTLDevice::m_mapConDevices, RTLDevice::m_mapFreqOffset, MOD_TYPE_FSK, MOD_TYPE_GFSK, RTLDevice::TestResult_t::qsError, readRfReg(), RTLDevice::TestResult_t::result, RTLDevice::TST_FAILED, RTLDevice::TST_OK, and writeRfReg().
|
virtual |
Read MCU Register.
[in] | devId | USB Device ID |
[in] | address | Register address |
[out] | pValue | Register value |
Implements RTLDevice.
References RTLDevice::m_mapConDevices, RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Read memory (FPL Feature)
Read any kind of memory that is accessible from the debug interface of the target device.
This method will use the FPL library to read the memory but it will not have any affect on the time when using any non-FPL Feature afterwards. See "Limitations" under the "Introduction" for further details.
Before reading GPRAM the user must make sure that the GPRAM is enabled. This function will return TST_OK even if the GPRAM is not enabled but the returned data will be garbage.
[in] | devName | Device name |
[in] | devId | USB Device ID |
[in] | address | Memory address to read |
[in,out] | pLength | Maximum length of buffer as input and actual length of data successfully read as output. |
[out] | pBuffer | Buffer to save the data |
Implements RTLDevice.
References RTLDevice::getFlashHandler(), and RTLDevice::TST_FAILED.
|
virtual |
Read RF core Register.
[in] | devId | USB Device ID |
[in] | address | Offset address of HW Register bank 0x40040000 |
[out] | pValue | Register value |
Implements RTLDevice.
References RTLDevice::m_mapConDevices, RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
Referenced by readFrequencyOffset(), readFrequencyOffsetCW(), and writeRfReg().
|
virtual |
Verify Flash (FPL Feature)
This function will verify the flash content by calculating the CRC checksum in flash and compare it with the CRC checksum from the file object on the host.
[in] | devName | Device name |
[in] | devId | USB Device ID |
[in] | pFplFile | Pointer to FPL File Object |
[in] | pProgInfo | Pointer to the program info used for programming. The verification will inherit the option set for programming. E.g. if a set of pages was excluded in programming, the same pages will be excluded in verification. If set to NULL all pages in file will be verified. |
Implements RTLDevice.
References RTLDevice::appendError(), RTLDevice::getFlashHandler(), and RTLDevice::TST_FAILED.
|
virtual |
Write memory (FPL Feature)
This function can be used to write all non-flash memory. Before using this function the user must make sure that the requested memory range is enabled. The function will return TST_FAILED if memory not enabled. For example flash cache RAM must be configured as GPRAM before it can be written. Some memory blocks can be powered down and in that case the memory block must be powered before it can be written.
For programming flash memory, see RTLDevice26_13xx::programFlash(const QString&, const QString&, const quint32&, const quint32&, quint8*)
.
[in] | devName | Device name |
[in] | devId | USB Device ID |
[in] | address | Memory address to write |
[in] | length | Length of buffer to be written. |
[out] | pBuffer | Buffer with data to be written. |
Implements RTLDevice.
References RTLDevice::getFlashHandler(), and RTLDevice::TST_FAILED.
|
virtual |
Write MCU Register.
[in] | devId | USB Device ID |
[in] | address | Register address |
[in] | value | Register value |
Implements RTLDevice.
References RTLDevice::m_mapConDevices, RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Write RF core Register.
[in] | devId | USB Device ID |
[in] | address | Offset address of HW Register bank 0x40040000 |
[in] | value | Register value |
Implements RTLDevice.
References RTLDevice::m_mapConDevices, readRfReg(), RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
Referenced by readFrequencyOffsetCW().
|
virtual |
Run CPU (FPL Feature)
Start CPU (in free run [debug disabled] or in profiling mode [debug enabled])
[in] | devName | Device name |
[in] | devId | USB Device ID |
[in] | debugMode | Debug mode enabled or disabled. |
Implements RTLDevice.
References RTLDevice::getFlashHandler(), and RTLDevice::TST_FAILED.
|
virtual |
Halt CPU (FPL Feature)
[in] | devName | Device name |
[in] | devId | USB Device ID |
Implements RTLDevice.
References RTLDevice::getFlashHandler(), and RTLDevice::TST_FAILED.
|
virtual |
Write CPU register (FPL Feature)
[in] | devName | Device name |
[in] | devId | USB Device ID |
[in] | regNumber | CPU Register number. |
[in] | value | Register value |
Implements RTLDevice.
References RTLDevice::getFlashHandler(), and RTLDevice::TST_FAILED.
|
virtual |
Read CPU register (FPL Feature)
[in] | devName | Device name |
[in] | devId | USB Device ID |
[in] | regNumber | Register number. Valid range from 0 to 20 |
[out] | pValue | Register value |
Implements RTLDevice.
References RTLDevice::getFlashHandler(), and RTLDevice::TST_FAILED.
|
virtual |
Set Cap Array Delta.
This function provides an easy-to-use method for modifying the load capacitor array for the HF crystal on the fly, allowing you to tune the frequency offset suitable for your HW design. Normally the default value will be set to zero. For HW designs where the HF crystal will be tuned with external capacitors the value should be set to a minimum.
For more details refer to the documentation, Technical Reference Manual or the online wiki entry
[in] | devId | USB Device ID. E.g.: "XDS-06EB12100472A" |
[in] | value | The Capacitor delta value |
Implements RTLDevice.
References RTLDevice::appendError(), CAP_ARRAY_AGA_MAX, CAP_ARRAY_AGA_MIN, CAP_ARRAY_CHA_MAX, CAP_ARRAY_CHA_MIN, CAP_ARRAY_CHA_WCSP_MAX, CAP_ARRAY_CHA_WCSP_MIN, RTLDevice::m_mapConDevices, RTLDevice::TST_FAILED, and RTLDevice::TST_OK.