RadioTestLibrary
1.34.0
|
#include <rtl_flash_handler.h>
Public Member Functions | |
RTLFlashHandler (const QString &devName, const QString &devId, XbalEb *pXbalEb, RTLDevice *pParent=NULL) | |
virtual | ~RTLFlashHandler (void) |
virtual int | eraseFlash (EraseInfo_t *pEraseInfo=NULL, FPLFile *pFile=NULL) |
Erase Flash (FPL Feature) More... | |
virtual int | programFlash (FPLFile *pFplFile, ProgramInfo_t *pProgInfo=NULL) |
Program Flash from file (FPL Feature) More... | |
virtual int | programFlash (const quint32 &address, const quint32 &length, quint8 *pBuffer) |
Program Flash (FPL Feature) More... | |
virtual FPLFile * | readFile (const QString &fileName, const quint32 &startAddress=0) |
Read File. More... | |
virtual int | readMemory (const quint32 &address, quint32 *pLength, quint8 *pBuffer) |
Read memory (FPL Feature) More... | |
virtual int | resetTarget (RESET_MODE mode) |
Reset Target device. More... | |
virtual int | verifyFlash (FPLFile *pFplFile, ProgramInfo_t *pProgInfo=NULL) |
Verify Flash (FPL Feature) More... | |
virtual int | writeMemory (const quint32 &address, const quint32 &length, quint8 *pBuffer) |
Write memory (FPL Feature) More... | |
virtual int | runCpu (bool debugMode) |
Run CPU (FPL Feature) More... | |
virtual int | haltCpu (void) |
Halt CPU (FPL Feature) More... | |
virtual int | writeCpuReg (const CM3_CPU_REGISTERS ®Number, const uint32_t &value) |
Write CPU register (FPL Feature) More... | |
virtual int | readCpuReg (const CM3_CPU_REGISTERS ®Number, uint32_t *pValue) |
Read CPU register (FPL Feature) More... | |
Static Public Member Functions | |
static int | deleteFileObject (FPLFile *pFplFile) |
Delete file Object. More... | |
static void | initEraseInfo (EraseInfo_t *pEraseInfo) |
Initialize erase info. Default is to erase all unprotected pages. More... | |
static void | initProgramInfo (ProgramInfo_t *pProgInfo) |
Initialize program info. Default is to program all pages in the source file. More... | |
Protected Member Functions | |
QString | normDeviceNameForFpl (const QString rfDevName) |
Function to normalize the device name for use in FPL. More... | |
RTLFlashHandler::RTLFlashHandler | ( | const QString & | devName, |
const QString & | devId, | ||
XbalEb * | pXbalEb, | ||
RTLDevice * | pParent = NULL |
||
) |
References normDeviceNameForFpl().
|
virtual |
References 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] | 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. |
References ET_ERASE_ALL, ET_ERASE_ALL_FORCED, ET_ERASE_PAGE_RANGE, ET_ERASE_PAGES_IN_SOURCE, EraseInfo_t::parameters, RTLDevice::TST_FAILED, RTLDevice::TST_OK, and EraseInfo_t::type.
|
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).
[in] | pFplFile | Pointer to FPL file object |
[in] | pProgInfo | Pointer to program info. If set to NULL, all pages in file will be programmed. |
References ProgramInfo_t::parameters, PT_PROGRAM_EXLUDE_PAGES, PT_PROGRAM_EXLUDE_PAGES_FILLED_WITH, PT_PROGRAM_PAGES_IN_SOURCE, RTLDevice::TST_FAILED, RTLDevice::TST_OK, and ProgramInfo_t::type.
|
virtual |
Program Flash (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()
[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 |
References RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Read File.
Read given file and create FPL File object.
[in] | fileName | File name with relative or absolute path |
[in] | startAddress | The start address is required if the input file is a binary file (.bin) |
References 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] | 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 |
References RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Reset Target device.
Reset target device.
The connection to the target device will be lost after a reset.
[in] | mode | Reset mode |
References RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
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] | 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. |
References ProgramInfo_t::parameters, PT_PROGRAM_EXLUDE_PAGES, PT_PROGRAM_EXLUDE_PAGES_FILLED_WITH, PT_PROGRAM_PAGES_IN_SOURCE, RTLDevice::TST_FAILED, RTLDevice::TST_OK, and ProgramInfo_t::type.
|
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] | address | Memory address to write |
[in] | length | Length of buffer to be written. |
[out] | pBuffer | Buffer with data to be written. |
References RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Run CPU (FPL Feature)
Start Cortex CPU (in free run [debug disabled] or in profiling mode [debug enabled])
[in] | debugMode | Debug mode enabled or disabled. |
References RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Halt CPU (FPL Feature)
References RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Write CPU register (FPL Feature)
[in] | regNumber | Register number. Valid range from 0 to 15 |
[in] | value | Register value |
References RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
virtual |
Read CPU register (FPL Feature)
[in] | regNumber | CPU Register number. |
[out] | pValue | Register value |
References RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
|
static |
Delete file Object.
Delete given File Object.
[in] | pFplFile | Pointer to FPL file object |
References RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
Referenced by RTLDevice::deleteFileObject().
|
static |
Initialize erase info. Default is to erase all unprotected pages.
[in,out] | pEraseInfo | Pointer to the erase info structure to initialize. |
References ET_ERASE_ALL, EraseInfo_t::parameters, and EraseInfo_t::type.
Referenced by RTLDevice::initEraseInfo().
|
static |
Initialize program info. Default is to program all pages in the source file.
[in,out] | pProgInfo | Pointer to the program info structure to initialize. |
References RTLDevice::appendError(), ProgramInfo_t::parameters, PT_PROGRAM_PAGES_IN_SOURCE, RTLDevice::TST_FAILED, RTLDevice::TST_OK, and ProgramInfo_t::type.
Referenced by RTLDevice::initProgramInfo().
|
protected |
Function to normalize the device name for use in FPL.
Normalize device name for FPL.
Some of the device names need to be changed in order to be recognized by the FPL library.
[in] | rfDevName | RF Device name like "CC2650" |
References RTLDevice::TST_FAILED, and RTLDevice::TST_OK.
Referenced by RTLFlashHandler().