winIDEA SDK
isys::CDataController Class Reference

Description

This class enables access to data on the target - memory, variables, and registers.

Qualified Variable Names

When variables are specified by name, for example in evaluate() or modify() methods, it may happen that more than one variables in different source or download files share the same name. In such case we have to specify the fully qualified variable name in the following format:

"<moduleName>"#<varName>,,<downloadFileName>

where:

  • moduleName - name of the C source file, which contains variable
  • varName - name of the variable
  • downloadFileName - name of the download file, where the variable is located

Example:

"main.c"#iCounter,,executable.elf

The same syntax is used for function names, see also CAddressController::getFunctionName().

Another type of variables are function static variables, which have to be prefixed with <functionName>##, for example:

myFunction##myStaticVar

The same syntax can be used in winIDEA's Watch window.

Python example for batch access.
Python example for method getSymbols().
Python example for method evaluate().
Another Python example for method evaluate().
Python example for method readRegister().
Python example for method writeRegister().

#include <CDataController.h>

Inheritance diagram for isys::CDataController:
isys::WrapperBase isys::CDataController2

Public Types

enum  ESymbolsType {
  estFunctions , estGlobalVariables ,
  estModules
}
 Types of symbols to be returned by the method getSymbols(). More...
 

Public Member Functions

 CDataController (std::shared_ptr< ConnectionMgr > connectionMgr)
 Instantiates object. More...
 
CCPUInfo getCPUInfo ()
 Returns CPU info. More...
 
int getMemoryAreaBytesPerMAU (int memArea)
 Returns the number of bytes per addressable memory unit. More...
 
std::vector< BYTE > readMemory (IConnectDebug::EAccessFlags accessFlags, BYTE memArea, ADDRESS_64 aAddress, ADDRESS_64 aNumMAUs, BYTE bytesPerMAU)
 This method reads memory block and returns data and access info. More...
 
std::vector< BYTE > writeMemory (IConnectDebug::EAccessFlags accessFlags, BYTE memArea, ADDRESS_64 aAddress, ADDRESS_64 aNumMAUs, BYTE bytesPerMAU, std::vector< BYTE > &buff)
 Writes block of data to target memory, and returns access information. More...
 
void writeMemoryNAI (IConnectDebug::EAccessFlags accessFlags, BYTE memArea, ADDRESS_64 aAddress, ADDRESS_64 aNumMAUs, BYTE bytesPerMAU, std::vector< BYTE > &buff)
 Writes block of data to target memory. More...
 
CValueType readRegister (IConnectDebug::EAccessFlags accessFlags, const std::string &registerName)
 Reads the specified general purpose register. More...
 
void writeRegister (IConnectDebug::EAccessFlags accessFlags, const std::string &registerName, const CValueType &registerInfo)
 Writes value to the specified core register. More...
 
CValueType readValue (IConnectDebug::EAccessFlags accessFlags, BYTE memArea, ADDRESS_64 aAddress, const SType &type)
 Reads a value from the target system. More...
 
void writeValue (IConnectDebug::EAccessFlags accessFlags, BYTE memArea, ADDRESS_64 aAddress, const CValueType &value)
 Writes a value to the target system. More...
 
void writeValue (IConnectDebug::EAccessFlags accessFlags, bool isNotRefreshWinIDEAGUIAfterWrite, BYTE memArea, ADDRESS_64 aAddress, const CValueType &value)
 Writes a value to the target system. More...
 
CValueType evaluate (IConnectDebug::EAccessFlags accessFlags, const std::string &expression)
 Calls evaluate(IConnectDebug::EAccessFlags, IConnectDebug::EEvaluate, const std::string &expression) with evaluateFlags = IConnectDebug::efDefaultMemAreaDisplay. More...
 
CValueType evaluate (IConnectDebug::EAccessFlags accessFlags, IConnectDebug::EEvaluate evaluateFlags, const std::string &expression)
 Evaluates an expression. More...
 
std::string modify (IConnectDebug::EAccessFlags accessFlags, const std::string &expression, const CValueType &value, bool readBack=true)
 See modify(IConnectDebug::EAccessFlags, IConnectDebug::EEvaluate, const std::string &, const CValueType &, bool). More...
 
std::string modify (IConnectDebug::EAccessFlags accessFlags, const std::string &expression, const std::string &value, bool readBack=true)
 See modify(IConnectDebug::EAccessFlags, IConnectDebug::EEvaluate, const std::string &, const CValueType &, bool). More...
 
std::string modify (IConnectDebug::EAccessFlags accessFlags, IConnectDebug::EEvaluate evaluateFlags, const std::string &expression, const CValueType &value, bool readBack=true)
 Modifies expression to value. More...
 
std::string modify (IConnectDebug::EAccessFlags accessFlags, IConnectDebug::EEvaluate evaluateFlags, const std::string &expression, const std::string &value, bool readBack=true)
 Modifies expression to string value. More...
 
bool batchAccess (DWORD dwBatchAccessFlags, const struct SBatchAccessHeader *pBatchAccessHeader, const std::vector< SBatchAccessItem > &batchAccessItems, std::vector< SBatchAccessItemResult > &batchAccessItemResults)
 Performs multiple memory accesses, using deterministic delays. More...
 
void eraseFlash (int nDevice=-1)
 
void secureFlash (int nDevice=-1)
 Secures FLASH memory. More...
 
void unsecureFlash (int nDevice=-1)
 Unsecures FLASH memory. More...
 
void getSymbols (ESymbolsType symbolsType, iconnect::StrVector &symbolNames, int partition=PARTITION_DEFAULT)
 Gets list of all symbols of the specified type. More...
 
void getStackFrames (bool isActiveFrameOnly, bool isAbsPaths, isys::StackFrameVector &stackFrames)
 Gets list of current stack frames on a target. More...
 
void getVariables (int partition, VariableVector &variables)
 Returns list of global variables in a download file. More...
 
void getLabels (int partition, VariableVector &labels)
 Returns list of labels in a download file. More...
 
void getModules (int partition, ModuleVector &modules)
 Returns list of source code files which were used to generate a download file. More...
 
void getFunctions (int partition, FunctionVector &functions)
 Returns list of functions in a download file. More...
 
void getTypes (int partition, TypeVector &types)
 Returns list of types in a download file. More...
 
void getTypedefs (int partition, TypedefVector &typedefs)
 
void getPartitions (iconnect::StrVector &paths, iconnect::StrVector &fileNames)
 Returns a list of download files. More...
 
void getMacros (int partition, iconnect::StrVector &names, iconnect::StrVector &values)
 Returns a list of macros in the given partition. More...
 
CSystemMemoryAreas getSystemMemoryAreas ()
 This method returns information about memory areas available on a target. More...
 
EEndian getDefaultEndian ()
 Returns default CPU endian mode. More...
 
CStackUsage getStackUsage ()
 Returns information about maximum stack usage since seedStack() was called. More...
 
void seedStack ()
 Writes the given values to stack memory area. More...
 
void configureStackUsage (ADDRESS_64 start, ADDRESS_64 end, unsigned char value=0xcc)
 
void configureStackUsage (const std::string &start, const std::string &end, unsigned char value)
 
isys::CCodeStoreSPtr csCreate ()
 This method creates an empty code store object. More...
 
isys::CCodeStoreSPtr csGetDownloaded (BYTE memArea, const std::string &fileDownload, bool data)
 This method retrieves all downloaded code. More...
 
isys::CCodeStoreSPtr csReadMemory (BYTE memArea, const isys::CCodeStoreSPtr &rspSource)
 This method reads memory to the given rspSource object. More...
 
isys::CCodeStoreSPtr csVerifyDownloaded (BYTE memArea, const std::string &fileDownload, const std::string &fileReport, IConnectDebug2::ECodeCacheOp verifyAgainst=IConnectDebug2::ccSrcLoaded)
 This method verifies downloaded data with the given file. More...
 
isys::CCodeStoreSPtr csDif (const isys::CCodeStoreSPtr &rsp1, const isys::CCodeStoreSPtr &rsp2, bool flDifferent=true, bool flNotIn1=true, bool flNotIn2=true, bool flEqual=false)
 This method returns differences between two SPCodeStore instances. More...
 

Static Public Member Functions

static void setByte (BYTE *array, int idx, BYTE value)
 Sets array element at index idx to value. More...
 
static BYTE getByte (BYTE *array, int idx)
 Gets array element at index idx. More...
 
static std::vector< BYTE > byteArrayToVector (BYTE *array, size_t len)
 This method converts byte array to std::vector<BYTE>, which is supported by SWIG and provides better access than pure C arrays.
 
static void vectorToByteArray (std::vector< BYTE > &buff, BYTE *array, size_t size)
 This method converts std::vector<BYTE> to byte array.
 

Static Public Attributes

static const int PARTITION_DEFAULT = -1
 The default download file is sued.
 
static const int PARTITION_CURRENT = -2
 The current download file is used.
 

Member Enumeration Documentation

◆ ESymbolsType

Types of symbols to be returned by the method getSymbols().

Enumerator
estFunctions 

get functions

estGlobalVariables 

get global variables

estModules 

get modules

Constructor & Destructor Documentation

◆ CDataController()

isys::CDataController::CDataController ( std::shared_ptr< ConnectionMgr connectionMgr)

Instantiates object.

Parameters
connectionMgrclass which maintains connection to winIDEA. Connection must be established before this call.

Python example: test_cpu_info.py

Member Function Documentation

◆ batchAccess()

bool isys::CDataController::batchAccess ( DWORD  dwBatchAccessFlags,
const struct SBatchAccessHeader pBatchAccessHeader,
const std::vector< SBatchAccessItem > &  batchAccessItems,
std::vector< SBatchAccessItemResult > &  batchAccessItemResults 
)

Performs multiple memory accesses, using deterministic delays.

Parameters
dwBatchAccessFlagssee enum EFlags in SBatchAccessHeader, flags that start with prefix 'fl'
pBatchAccessHeadersee SBatchAccessHeader
batchAccessItemsitems defining the type and time of an individual access.
batchAccessItemResultsobjects that will receive the results of every individual access.
Returns
true if OK, false if the specified time restrictions could not be kept
Exceptions
IOExceptionif one of the accesses failed
FeatureNotImplementedExceptionif batch access is not implemented for your target

Example:

  const int NUM_ITEMS = 1;  // just one item to execute in every run
  const int NUM_RUNS  = 100;   // perform so many iterations

  SBatchAccessHeader  BAH = {0};
  SBatchAccessItem    aBAI[NUM_ITEMS];
  memset(aBAI, 0, sizeof aBAI);

  // define header
  BAH.m_dwFlags       = SBatchAccessHeader::flRealTime; // use real-time access
  BAH.m_dwFlags       |= SBatchAccessHeader::flWantTimeStamp;
  BAH.m_dwNumItems    = NUM_ITEMS;
  BAH.m_dwNumRuns     = NUM_RUNS;
  BAH.m_qwRunInterval = 500;                            // every 500 us

  // Define item(s), iCounter in this case. Call CAddressController::getSymbolInfo()
  // to get aSizeMAUs, byMemArea, and aAddress of iCounter.

  aBAI[0].m_byFlags   = SBatchAccessItem::flRead;       // it's a read
  aBAI[0].m_bySize    = (BYTE)aSizeMAUs;                // size or iCounter
  aBAI[0].m_byMemArea = byMemArea;                      // memory area of iCounter
  aBAI[0].m_aAddress  = aAddress;                       // address of iCounter

  SBatchAccessItemResult aBAIR[NUM_ITEMS * NUM_RUNS];   // make space for results

  bool hr = batchAccess(0, &BAH, aBAI, aBAIR);

Python example: test_batch_access.py

◆ configureStackUsage() [1/2]

void isys::CDataController::configureStackUsage ( ADDRESS_64  start,
ADDRESS_64  end,
unsigned char  value = 0xcc 
)
Deprecated:
use CConfigurationController::ide_app() to control stack configuration instead. Python example: test_configure_stack_usage.py

◆ configureStackUsage() [2/2]

void isys::CDataController::configureStackUsage ( const std::string &  start,
const std::string &  end,
unsigned char  value 
)
Deprecated:
use CConfigurationController::ide_app() to control stack configuration instead. See python example.

Configures winIDEA options used for measuring stack usage. This method changes values of options Debug.StackUsage.* in winIDEA. This method must be called before download, for settings to take effect. After download you should call seedStack() without parameters to seed the stack memory region.

Parameters
startstarting address. If both start and end are empty strings, then stack usage monitoring is disabled.
endend address - value at this address is not modified, so that size = end - start. If both start and end are empty strings, then stack usage monitoring is disabled.
valuevalue to write to the stack. Not that this value should not interfere with other values written to stack to get reliable stack usage with getStackUsage().

Python example: test_configure_stack_usage.py

◆ csCreate()

isys::CCodeStoreSPtr isys::CDataController::csCreate ( )

This method creates an empty code store object.

Returns

Python example: test_cs_read_memory.py

◆ csDif()

isys::CCodeStoreSPtr isys::CDataController::csDif ( const isys::CCodeStoreSPtr rsp1,
const isys::CCodeStoreSPtr rsp2,
bool  flDifferent = true,
bool  flNotIn1 = true,
bool  flNotIn2 = true,
bool  flEqual = false 
)

This method returns differences between two SPCodeStore instances.

Parameters
rsp1the first CCodeStore object
rsp2the second CCodeStore object
flDifferentreport locations present in both objects, but with different contents
flNotIn1report locations that are not in rsp1, but present int rsp2
flNotIn2report locations that are not in rsp2, but present int rsp1
flEqualreport locations with equal contents
Returns
  • CCodeStore object containing the differences between rsp1 and rsp2. Data values use ICodeCache::EDifType encoding

Python example: test_code_store_diff.py

◆ csGetDownloaded()

isys::CCodeStoreSPtr isys::CDataController::csGetDownloaded ( BYTE  memArea,
const std::string &  fileDownload,
bool  data 
)

This method retrieves all downloaded code.

Parameters
memAreaspecifies the memory space for which the downloaded code should be retrieved
fileDownloadif empty, all downloaded code is retrieved, otherwise only for the specified file
datatrue to retrieve the data. Otherwise only address information is retrieved.
Returns
  • CCodeStore object containing the downloaded code

Python example: test_code_store.py

◆ csReadMemory()

isys::CCodeStoreSPtr isys::CDataController::csReadMemory ( BYTE  memArea,
const isys::CCodeStoreSPtr rspSource 
)

This method reads memory to the given rspSource object.

Parameters
memAreaspecifies the memory space from which to read
rspSourcea CCodeStore object filled with items (address and size), which should be read
Returns

Python example: test_cs_read_memory.py

◆ csVerifyDownloaded()

isys::CCodeStoreSPtr isys::CDataController::csVerifyDownloaded ( BYTE  memArea,
const std::string &  fileDownload,
const std::string &  fileReport,
IConnectDebug2::ECodeCacheOp  verifyAgainst = IConnectDebug2::ccSrcLoaded 
)

This method verifies downloaded data with the given file.

Parameters
memAreaspecifies the memory space for which the verify should be performed
fileDownloadif empty, all downloaded code is verified, otherwise only for the specified file
fileReportfile path to which the report should be written. If empty no report is generated
verifyAgainstcan be one of IConnectDebug2::ccSrcLoaded, IConnectDebug2::ccSrcInFiles, or IConnectDebug2::ccSrcFiltered.
Returns
  • CCodeStore object containing the differences between loaded and read-back code. All data values are ICodeCache::EDifType::dtDif

Python example: test_cs_verify_downloaded.py

◆ eraseFlash()

void isys::CDataController::eraseFlash ( int  nDevice = -1)
Deprecated:
use isys::CStorageDeviceController::erase() instead.

Erases FLASH memory.

Parameters
nDeviceif -1 all FLASH devices are processed, otherwise only the specified device

◆ evaluate() [1/2]

CValueType isys::CDataController::evaluate ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  expression 
)

Calls evaluate(IConnectDebug::EAccessFlags, IConnectDebug::EEvaluate, const std::string &expression) with evaluateFlags = IConnectDebug::efDefaultMemAreaDisplay.

Python example with online value graph: chart_sample.py
Python module for plotting of watch expressions: variables_chart.py
Python example with web server providing results of this method: webserver.py

Python example: test_data_evaluate.py

◆ evaluate() [2/2]

CValueType isys::CDataController::evaluate ( IConnectDebug::EAccessFlags  accessFlags,
IConnectDebug::EEvaluate  evaluateFlags,
const std::string &  expression 
)

Evaluates an expression.

Works only for simple types. See also Qualified Variable Names.

Parameters
accessFlagsIConnectDebug::EAccessFlags determine what kind of memory access is permitted if required to resolve the expression
evaluateFlagsdefine result format
expressionany C syntax expression. CPU registers (including SFRs) can be used in expression with prefix '@', for example '@R0'.
Exceptions
IOExceptionif complex type is given or in case of an error

◆ getByte()

static BYTE isys::CDataController::getByte ( BYTE *  array,
int  idx 
)
static

Gets array element at index idx.

This is general method, which can be used to read arrays, which are returned by isystem.connect function parameters or are elements of isystem.connect structures, for example SBatchAccessItem.

Python example: test_batch_access.py

◆ getCPUInfo()

CCPUInfo isys::CDataController::getCPUInfo ( )

Returns CPU info.

See definition of this struct in CCPUInfo.h for enum constants which describe CPU type.

Python example: test_cpu_info.py

◆ getDefaultEndian()

EEndian isys::CDataController::getDefaultEndian ( )

Returns default CPU endian mode.

Python example: test_get_default_endian.py

◆ getFunctions()

void isys::CDataController::getFunctions ( int  partition,
FunctionVector functions 
)

Returns list of functions in a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
functionsvector to receive result

Python example: test_get_functions.py

◆ getLabels()

void isys::CDataController::getLabels ( int  partition,
VariableVector labels 
)

Returns list of labels in a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
labelsvector to receive result

Python example: test_get_labels.py

◆ getMacros()

void isys::CDataController::getMacros ( int  partition,
iconnect::StrVector names,
iconnect::StrVector values 
)

Returns a list of macros in the given partition.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
namesvector, which will contain names of macros on return.
valuesvector, which will contain values of macros on return.

Python example: test_get_macros.py

◆ getMemoryAreaBytesPerMAU()

int isys::CDataController::getMemoryAreaBytesPerMAU ( int  memArea)

Returns the number of bytes per addressable memory unit.

Parameters
memAreamemory area for which to return the number

Python example: test_get_memory_area_bytes_per_mau.py

◆ getModules()

void isys::CDataController::getModules ( int  partition,
ModuleVector modules 
)

Returns list of source code files which were used to generate a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
modulesvector to receive result

Python example: test_get_modules.py

◆ getPartitions()

void isys::CDataController::getPartitions ( iconnect::StrVector paths,
iconnect::StrVector fileNames 
)

Returns a list of download files.

Parameters
pathsvector to receive paths of download files
fileNamesvector to receive names of download files

Python example: test_get_partitions.py

◆ getStackFrames()

void isys::CDataController::getStackFrames ( bool  isActiveFrameOnly,
bool  isAbsPaths,
isys::StackFrameVector stackFrames 
)

Gets list of current stack frames on a target.

The stack frame information depends on compiler debug info and may not be always available.

Parameters
isActiveFrameOnlyif true, only the active frame is returned. This can be much faster than retrieving all frames.
isAbsPathsif true, absolute paths are returned
stackFramesvector to receive stack frame objects

Python example: test_get_stack_frames.py

◆ getStackUsage()

CStackUsage isys::CDataController::getStackUsage ( )

Returns information about maximum stack usage since seedStack() was called.

Python example: test_seed_get_stack_usage.py

◆ getSymbols()

void isys::CDataController::getSymbols ( ESymbolsType  symbolsType,
iconnect::StrVector symbolNames,
int  partition = PARTITION_DEFAULT 
)

Gets list of all symbols of the specified type.

Symbols must be downloaded in winIDEA before this function is called.

Parameters
symbolsTypetype of symbols to retrieve
symbolNamesafter return this vector contains names of all symbols of the specified type from download file.
partitionindex of download file to get symbols from

Python example: test_get_symbols.py

◆ getSystemMemoryAreas()

CSystemMemoryAreas isys::CDataController::getSystemMemoryAreas ( )

This method returns information about memory areas available on a target.

Python example: test_get_system_memory_areas.py

◆ getTypedefs()

void isys::CDataController::getTypedefs ( int  partition,
TypedefVector typedefs 
)
Deprecated:
Use getTypes() instead.

Returns list of typedefs in a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
typedefsvector to receive result

Python example: test_get_typedefs.py

◆ getTypes()

void isys::CDataController::getTypes ( int  partition,
TypeVector types 
)

Returns list of types in a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
typesvector to receive result

Python example: test_get_types.py

◆ getVariables()

void isys::CDataController::getVariables ( int  partition,
VariableVector variables 
)

Returns list of global variables in a download file.

Parameters
partitionpartition number, or PARTITION_CURRENT for current download file or PARTITION_DEFAULT for default download file.
variablesvector to receive result

Python example: test_get_variables.py

◆ modify() [1/4]

std::string isys::CDataController::modify ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  expression,
const CValueType value,
bool  readBack = true 
)

◆ modify() [2/4]

std::string isys::CDataController::modify ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  expression,
const std::string &  value,
bool  readBack = true 
)

◆ modify() [3/4]

std::string isys::CDataController::modify ( IConnectDebug::EAccessFlags  accessFlags,
IConnectDebug::EEvaluate  evaluateFlags,
const std::string &  expression,
const CValueType value,
bool  readBack = true 
)

Modifies expression to value.

The expression must evaluate to a lvalue. See also Qualified Variable Names.

Parameters
accessFlagsdetermines what kind of memory access is permitted if required to resolve the expression,
evaluateFlagsdefine result format.
expressionany C syntax expression that evaluates to a lvalue
valuecontains the value to write to expression
readBackset to false to skip reading back the value
Returns
result of evaluation as string or error description in case of error. For example for expression 'a = 10' return value is '10'.
Exceptions
IOExceptionin case of an error

Python example: test_data_modify.py

◆ modify() [4/4]

std::string isys::CDataController::modify ( IConnectDebug::EAccessFlags  accessFlags,
IConnectDebug::EEvaluate  evaluateFlags,
const std::string &  expression,
const std::string &  value,
bool  readBack = true 
)

Modifies expression to string value.

The expression must evaluate to a lvalue. See also Qualified Variable Names.

Parameters
accessFlagsdetermines what kind of memory access is permitted if required to resolve the expression,
evaluateFlagsdefine result format.
expressionany C syntax expression that evaluates to a lvalue
valuecontains the value to write to expression
readBackset to false to skip reading back the value
Exceptions
IOExceptionin case of an error

Python example: test_data_modify.py

◆ readMemory()

std::vector< BYTE > isys::CDataController::readMemory ( IConnectDebug::EAccessFlags  accessFlags,
BYTE  memArea,
ADDRESS_64  aAddress,
ADDRESS_64  aNumMAUs,
BYTE  bytesPerMAU 
)

This method reads memory block and returns data and access info.

Returned vector contains data in the first (aNumMAUs * bytesPerMAU) bytes, and access info in aNumMAUs bytes at offset (aNumMAUs * bytesPerMAU).

Access info bytes tell us, whether read for MAU succeeded or not. Each byte is set to ACCESS_OK or ACCESS_FAIL. These two constants are defined in globdefs.h.

Contents of the returned vector:

[(target memory data, size = aNumMAUs * bytesPerMAU) (access info, size = aNumMAUs)]
Parameters
accessFlagsuse IConnectDebug::EAccessFlags
memAreamemory space. Definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location
aNumMAUsnumber of MAUs (memory addressable units) to read.
bytesPerMAUNumber of BYTE type locations required to fit one MAU (memory addressable unit). The number of bytes required for every MAU is:
MAU Size in bitsBytes Required per MAU
1 - 8 1
9 - 16 2
17 - 32 4
Almost all microprocessors supported by our tools have 1 byte of data stored at one address, so this value is usually set to 1. winIDEA will check this parameter and return ICONNECT_E_SIZE in case of mismatch.
Exceptions
IOExceptionin case of an error

Python example: test_read_write_memory.py

◆ readRegister()

CValueType isys::CDataController::readRegister ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  registerName 
)

Reads the specified general purpose register.

For SFRs please use method evaluate().

Parameters
accessFlagssee IConnectDebug::EAccessFlags for available flags, except fCacheCode
registerNamename of the register to read
Exceptions
IOExceptionin case of an error

Python example: test_read_write_register.py

◆ readValue()

CValueType isys::CDataController::readValue ( IConnectDebug::EAccessFlags  accessFlags,
BYTE  memArea,
ADDRESS_64  aAddress,
const SType type 
)

Reads a value from the target system.

This function resembles readMemory() but additionally it formats the value according to the type specified (including endian conversions).

Example:

debug = ic.CDebugFacade(cmgr)

varType = ic.SType()
varType.m_byBitSize = 32
varType.m_byType = ic.SType.tSigned

memArea = 0
addr = 1073768999

value = debug.readValue(ic.IConnectDebug.fMonitor, memArea, addr, varType)

print "Result = ", value.getInt()
Parameters
accessFlagsuse IConnectDebug::EAccessFlags, except fCore, and fSFR
memAreamemory area, definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location of the first access.
typevariable containing the type info of value to be read
Exceptions
IOExceptionin case of an error

Python example: test_read_write_value.py

◆ secureFlash()

void isys::CDataController::secureFlash ( int  nDevice = -1)

Secures FLASH memory.

Parameters
nDeviceif -1 all FLASH devices are processed, otherwise only the specified device

Python example: service_functions.py

◆ seedStack()

void isys::CDataController::seedStack ( )

Writes the given values to stack memory area.

Memory locations and value are defined with options Debug.StackUsage.* in winIDEA, which can be configured with Debug | Configure Session... | Applications dialog or method configureStackUsage() in this class.

Python example: test_seed_get_stack_usage.py

◆ setByte()

static void isys::CDataController::setByte ( BYTE *  array,
int  idx,
BYTE  value 
)
static

Sets array element at index idx to value.

This is general method, which can be used to set arrays, which are required as isystem.connect function parameters or are elements of isystem.connect structures, for example SBatchAccessItem.

Python example: test_batch_access.py

◆ unsecureFlash()

void isys::CDataController::unsecureFlash ( int  nDevice = -1)

Unsecures FLASH memory.

Parameters
nDeviceif -1 all FLASH devices are processed, otherwise only the specified device

Python example: service_functions.py

◆ writeMemory()

std::vector< BYTE > isys::CDataController::writeMemory ( IConnectDebug::EAccessFlags  accessFlags,
BYTE  memArea,
ADDRESS_64  aAddress,
ADDRESS_64  aNumMAUs,
BYTE  bytesPerMAU,
std::vector< BYTE > &  buff 
)

Writes block of data to target memory, and returns access information.

Parameters
accessFlagsuse IConnectDebug::EAccessFlags
memAreamemory space. Definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location
aNumMAUsnumber of MAUs (memory addressable units) to write.
bytesPerMAUNumber of BYTE type locations required to fit one MAU (memory addressable unit). The number of bytes required for every MAU is:
MAU Size in bitsBytes Required per MAU
1 - 8 1
9 - 16 2
17 - 32 4
Almost all microprocessors supported by our tools have 1 byte of data stored at one address, so this value is usually set to 1. winIDEA will check this parameter and return ICONNECT_E_SIZE in case of mismatch.
buffvector, which contains data to be written to memory on the target. Languages other than C++ should instantiate class VectorBYTE for this parameter. Examples:
Python:
    buff = isystem.connect.VectorBYTE([0, 0, 0, 0xff])
Java:
    VectorBYTE buff = new VectorBYTE();
    buff.add((short)0);
    buff.add((short)0);
    buff.add((short)0);
    buff.add((short)255);
Exceptions
IOExceptionin case of an error
Returns
accessInfo contains write status, one byte per MAU for each MAU. Byte at index 0 contains access info for MAU at address aAddress, byte at index 1 contains access info for MAU at address aAddress + 1, ... See ACCESS_OK and ACCESS_FAIL in globdefs.h for possible values of access info bytes.

Python example: test_read_write_memory.py

◆ writeMemoryNAI()

void isys::CDataController::writeMemoryNAI ( IConnectDebug::EAccessFlags  accessFlags,
BYTE  memArea,
ADDRESS_64  aAddress,
ADDRESS_64  aNumMAUs,
BYTE  bytesPerMAU,
std::vector< BYTE > &  buff 
)

Writes block of data to target memory.

This method is faster than writeMemory(), because no access information is returned.

Parameters
accessFlagsuse IConnectDebug::EAccessFlags
memAreamemory space. Definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location
aNumMAUsnumber of MAUs (memory addressable units) to write.
bytesPerMAUNumber of BYTE type locations required to fit one MAU (memory addressable unit). The number of bytes required for every MAU is:
MAU Size in bitsBytes Required per MAU
1 - 8 1
9 - 16 2
17 - 32 4
Almost all microprocessors supported by our tools have 1 byte of data stored at one address, so this value is usually set to 1. winIDEA will check this parameter and return ICONNECT_E_SIZE in case of mismatch.
buffvector, which contains data to be written to memory on the target. Languages other than C++ should instantiate class VectorBYTE for this parameter. Examples:
Python:
    buff = isystem.connect.VectorBYTE([0, 0, 0, 0xff])
Java:
    VectorBYTE buff = new VectorBYTE();
    buff.add((short)0);
    buff.add((short)0);
    buff.add((short)0);
    buff.add((short)255);
Exceptions
IOExceptionin case of an error
See also
writeMemory()

Python example: see test_read_write_memory.py

◆ writeRegister()

void isys::CDataController::writeRegister ( IConnectDebug::EAccessFlags  accessFlags,
const std::string &  registerName,
const CValueType registerInfo 
)

Writes value to the specified core register.

Example:

# bit size is 32, value is 1234567
r1Value = isystem.connect.CValueType(32, 1234567)
debug.writeRegister(IConnectDebug.fMonitor, 'R1', r1Value)

Longer way, if we use specific data types:

# first we should define value type
valueType = isystem.connect.SType()
valueType.m_byType = isystem.connect.SType.tSigned
valueType.m_byBitSize = 32

# create 'Value' with type and value
r0Value = isystem.connect.CValueType(valueType, 5678)

debug.writeRegister(0, "R0", r0Value)
Parameters
accessFlagssee IConnectDebug::EAccessFlags for available flags, except fCacheCode
registerNamename of the register to write to
registerInfoa value to be written to the register
Exceptions
IOExceptionin case of an error

Note: This method can modify only core registers. To modify SFRs please use the modify() method.

Python example : test_read_write_register.py

◆ writeValue() [1/2]

void isys::CDataController::writeValue ( IConnectDebug::EAccessFlags  accessFlags,
bool  isNotRefreshWinIDEAGUIAfterWrite,
BYTE  memArea,
ADDRESS_64  aAddress,
const CValueType value 
)

Writes a value to the target system.

This function resembles writeMemory() but additionally it formats the value according to the type specified (including endian conversions).

Parameters
accessFlagsuse IConnectDebug::EAccessFlags, except fCore, fSFR, and fCacheXXX.
isNotRefreshWinIDEAGUIAfterWriteif true, winIDEA windows are not refreshed after write operation - this speeds up operation.
memAreamemory space. Definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location of the first access
valuevariable containing the value to write
Exceptions
IOExceptionin case of an error

Python example: test_read_write_value.py

◆ writeValue() [2/2]

void isys::CDataController::writeValue ( IConnectDebug::EAccessFlags  accessFlags,
BYTE  memArea,
ADDRESS_64  aAddress,
const CValueType value 
)

Writes a value to the target system.

This function resembles writeMemory() but additionally it formats the value according to the type specified (including endian conversions).

Parameters
accessFlagsuse IConnectDebug::EAccessFlags, except fCore, fSFR, and fCacheXXX.
memAreamemory space. Definitions for individual CPUs are provided in MemArea.h
aAddressaddress of the memory location of the first access
valuevariable containing the value to write
Exceptions
IOExceptionin case of an error

Python example: test_read_write_value.py