RadioTestLibrary  1.32.0
rtl_flash_handler.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 /*
3  * File rtl_flash_handler.h
4  * Revision $Revision: 40069 $
5  * Description Super class for Radio Test Library to interface flash
6  * actions supported by FPL.
7  *
8 // ##### LICENSE HEADER #####
9  *
10  */
11  //-----------------------------------------------------------------------------
12 
13 
14 #ifndef RTLFLASHHANDLER_H
15 #define RTLFLASHHANDLER_H
16 
17 #include <QtCore>
18 
19 #include "fpl_common.h"
20 
21 #define DONT_CHANGE_TEST_STATE false
22 
23 class RTLDevice;
24 class FPLEbDevice;
25 class FPLTargetDevice;
26 class XbalEb;
27 
28 typedef enum
29 {
35 
36 typedef enum
37 {
42 
43 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
58 typedef struct
59 {
61  QString parameters;
62 } EraseInfo_t;
63 
64 //-----------------------------------------------------------------------------
83 //-----------------------------------------------------------------------------
84 typedef struct {
86  QString parameters;
88 
90 typedef enum
91 {
93  CM3_CPU_REG_R1 = 1 + 512,
94  CM3_CPU_REG_R2 = 2 + 512,
95  CM3_CPU_REG_R3 = 3 + 512,
96  CM3_CPU_REG_R4 = 4 + 512,
97  CM3_CPU_REG_R5 = 5 + 512,
98  CM3_CPU_REG_R6 = 6 + 512,
99  CM3_CPU_REG_R7 = 7 + 512,
100  CM3_CPU_REG_R8 = 8 + 512,
101  CM3_CPU_REG_R9 = 9 + 512,
102  CM3_CPU_REG_R10 = 10 + 512,
103  CM3_CPU_REG_R11 = 11 + 512,
104  CM3_CPU_REG_R12 = 12 + 512,
105  CM3_CPU_REG_R13 = 13 + 512,
106  CM3_CPU_REG_R14 = 14 + 512,
107  CM3_CPU_REG_R15 = 15 + 512,
108  CM3_CPU_REG_R13MSP = 17 + 512,
110 
112 {
113 
114 public:
115  RTLFlashHandler(const QString &devName, const QString &devId, XbalEb *pXbalEb, RTLDevice *pParent = NULL);
116  virtual ~RTLFlashHandler(void);
117 
118  virtual int eraseFlash(EraseInfo_t *pEraseInfo = NULL, FPLFile *pFile = NULL);
119  virtual int programFlash(FPLFile *pFplFile, ProgramInfo_t *pProgInfo = NULL);
120  virtual int programFlash(const quint32 &address, const quint32 &length, quint8 *pBuffer);
121  virtual FPLFile *readFile(const QString &fileName, const quint32 &startAddress = 0);
122  virtual int readMemory(const quint32 &address, quint32 *pLength, quint8 *pBuffer);
123  virtual int resetTarget(RESET_MODE mode);
124  virtual int verifyFlash(FPLFile *pFplFile, ProgramInfo_t *pProgInfo = NULL);
125  virtual int writeMemory(const quint32 &address, const quint32 &length, quint8 *pBuffer);
126  virtual int runCpu(bool debugMode);
127  virtual int haltCpu(void);
128  virtual int writeCpuReg(const CM3_CPU_REGISTERS &regNumber, const uint32_t &value);
129  virtual int readCpuReg(const CM3_CPU_REGISTERS &regNumber, uint32_t *pValue);
130 
131  static int deleteFileObject(FPLFile *pFplFile);
132  static void initEraseInfo(EraseInfo_t *pEraseInfo);
133  static void initProgramInfo(ProgramInfo_t *pProgInfo);
134 
135 protected:
137  QString normDeviceNameForFpl(const QString rfDevName);
138 
139 private:
140  QString m_deviceId;
141  QString m_deviceName;
143  FPLEbDevice *m_pFplEbDevice;
145  FPLTargetDevice *m_pFplTargetDevice;
147  RTLDevice *m_pRTLDevice;
148 
149  int createFplTargetDevice(XbalEb *pXbalEb);
150  int setTargetInfo(TargetInfo_t *pTargetInfo);
151  int setError(const QString &text);
152 };
153 
154 #endif
This structure is used as input to RTLDevice::programFlash() and RTLDevice::verifyFlash().
Definition: rtl_flash_handler.h:84
CPU Register 15.
Definition: rtl_flash_handler.h:107
Definition: rtl_device.h:29
CPU Register 10.
Definition: rtl_flash_handler.h:102
CPU Register 5.
Definition: rtl_flash_handler.h:97
QString parameters
Definition: rtl_flash_handler.h:86
This structure is used as input to RTLDevice::eraseFlash().
Definition: rtl_flash_handler.h:58
CPU Register 9.
Definition: rtl_flash_handler.h:101
CPU Register 3.
Definition: rtl_flash_handler.h:95
RTL_PROGRAM_TYPE type
Definition: rtl_flash_handler.h:85
Erase all pages used in source file.
Definition: rtl_flash_handler.h:33
CPU Register 13.
Definition: rtl_flash_handler.h:105
CPU Register 12.
Definition: rtl_flash_handler.h:104
Forced mass erase. Must be followed by a device re-connect.
Definition: rtl_flash_handler.h:31
CM3_CPU_REGISTERS
The XDS debug interface uses an offset of 512 to address the CPU registers.
Definition: rtl_flash_handler.h:90
CPU Register 4.
Definition: rtl_flash_handler.h:96
Definition: rtl_flash_handler.h:111
Exclude pages from source file filled with given value.
Definition: rtl_flash_handler.h:40
CPU Register 1.
Definition: rtl_flash_handler.h:93
Erase all unprotected pages.
Definition: rtl_flash_handler.h:30
RTL_ERASE_TYPE
Definition: rtl_flash_handler.h:28
Program all pages used in source file.
Definition: rtl_flash_handler.h:38
void writeMemory(void)
Write memory.
Definition: main.cpp:1905
void programFlash(void)
Program flash.
Definition: main.cpp:1798
QString parameters
Definition: rtl_flash_handler.h:61
CPU Register 14.
Definition: rtl_flash_handler.h:106
CPU Register 15.
Definition: rtl_flash_handler.h:108
RTL_PROGRAM_TYPE
Definition: rtl_flash_handler.h:36
RTL_ERASE_TYPE type
Definition: rtl_flash_handler.h:60
CPU Register 8.
Definition: rtl_flash_handler.h:100
CPU Register 0.
Definition: rtl_flash_handler.h:92
CPU Register 6.
Definition: rtl_flash_handler.h:98
Erase a range of pages.
Definition: rtl_flash_handler.h:32
void readMemory(void)
Read memory.
Definition: main.cpp:1850
Exclude given pages from source file.
Definition: rtl_flash_handler.h:39
CPU Register 11.
Definition: rtl_flash_handler.h:103
CPU Register 7.
Definition: rtl_flash_handler.h:99
CPU Register 2.
Definition: rtl_flash_handler.h:94
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale