Using the µVision Socket Interface  Application Note 198
Control and monitor µVision via the built-in TCP/IP interface
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Advanced Client Functions

Functions

_UVSC_FUNC_ UVSC_STATUS UVSC_TxRxRaw (int iConnHandle, UVSOCK_CMD *buf)
 
_UVSC_FUNC_ UVSOCK_CMDUVSC_CreateMsg (UVSOCK_CMD *buf, UV_OPERATION eCmd, int nLen, const void *pData)
 
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_EVAL_EXPRESSION_TO_STR (int iConnHandle, VSET *pVSet, int vSetLen)
 
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_FILELINE_TO_ADR (int iConnHandle, AFLMAP *pAflMap, int nAflMapLen, VSET *pVSet, int vSetLen)
 
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_REGISTER_GROUPS (int iConnHandle, SSTR *pGroups, int *pGroupCount)
 
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_REGISTERS (int iConnHandle, REGENUM *pRegisters, int *pRegisterCount)
 
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_READ_REGISTERS (int iConnHandle, char *pBuf, int *pBufLen)
 
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_REGISTER_SET (int iConnHandle, VSET *pVSet, int vSetLen)
 
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_DSM_READ (int iConnHandle, AMEM *pMem, int memLen)
 

Description

Function Documentation

_UVSC_FUNC_ UVSOCK_CMD * UVSC_CreateMsg ( UVSOCK_CMD buf,
UV_OPERATION  eCmd,
int  nLen,
const void *  pData 
)

Create a UVSOCK message

Parameters
bufPointer to a structure to hold the UVSOCK message data
eCmdMssage command to add to the message
nLenLength of the data in pData
pDataPointer to the data to add to the message
Returns
Equal to the input parameter buf

Use this function to create a correctly formatted UVSOCK message. This function is useful only in conjunction with the UVSC_TxRxRaw function. This is an advanced feature, and normally is not required.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_DSM_READ ( int  iConnHandle,
AMEM pMem,
int  memLen 
)

Get block of disassembly lines for given address

Parameters
iConnHandleHandle for the connection, as returned by UVSC_OpenConnection
pMemPointer to a structure containing the information about the address of disassembly to read. This variable will be updated with block of disassembly lines. This is a variable length structure, and must be large enough to contain the returned data, otherwise an error code will be returned from the function
memLenSize of the pMem data (bytes)
Returns
UVSC_STATUS_SUCCESS on success, or an error code
Precondition
UVSC_OpenConnection must have been called successfully
A valid project is loaded, and uVision is debugging

Use this function to get a block of disassembly lines starting with given address current project.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_REGISTER_GROUPS ( int  iConnHandle,
SSTR pGroups,
int *  pGroupCount 
)

Enumerate register groups

Parameters
iConnHandleHandle for the connection, as returned by UVSC_OpenConnection
pGroupsPointer to a structure to contain the group(s)
pGroupCountPointer to a variable to containing the number of items it is possible to fit into the pGroups structures. This variable will be updated with the actual number of groups returned.
Returns
UVSC_STATUS_SUCCESS on success, or an error code
Precondition
UVSC_OpenConnection must have been called successfully
A valid project is loaded, and uVision is debugging

Use this function to get a list of all register groups that exist within the current project.

The pointer pGroups must point to memory which is a multiple of the size of these structures. This multiple must be passed in the variable pGroupCount. The multiple must make the pGroups memory space large enough to contain the maximum number of groups that may be returned. If the memory area is not large enough for the returned data, the function will return an error. A recommended value is 256.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_REGISTERS ( int  iConnHandle,
REGENUM pRegisters,
int *  pRegisterCount 
)

Enumerate registers

Parameters
iConnHandleHandle for the connection, as returned by UVSC_OpenConnection
pRegistersPointer to a structure to contain the registers
pRegisterCountPointer to a variable containing the number of items it is possible to fit into the pRegisters. This variable will be updated with the actual number of registers returned.
Returns
UVSC_STATUS_SUCCESS on success, or an error code
Precondition
UVSC_OpenConnection must have been called successfully
A valid project is loaded, and uVision is debugging

Use this function to get a list of all register groups that exist within the current project.

The pointer pRegisters must point to memory which is a multiple of the size of these structures. This multiple must be passed in the variable pRegisterCount. The multiple must make the pRegisters memory space large enough to contain the maximum number of registers that may be returned. If the memory area is not large enough for the returned data, the function will return an error. A recommended value is 256.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_EVAL_EXPRESSION_TO_STR ( int  iConnHandle,
VSET pVSet,
int  vSetLen 
)

Evaluate expession and retur result as string

Parameters
iConnHandleHandle for the connection, as returned by UVSC_OpenConnection
pVSetPointer to a structure containing the expression to calculate. This variable will be updated with the result of the expression calculation. input : pVSet->val : stack frame address (VTT_uint64) pVSet-str : expression to avaluate
vSetLenSize of the pVSet data (bytes)
Returns
UVSC_STATUS_SUCCESS on success, or an error code
Precondition
UVSC_OpenConnection must have been called successfully
uVision is in debug mode

Use this function to get stack frame based expression evaluation, for example to display a variable value in a tooltip

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_FILELINE_TO_ADR ( int  iConnHandle,
AFLMAP pAflMap,
int  nAflMapLen,
VSET pVSet,
int  vSetLen 
)

Convert High Level Language (HLL) file and line to an address

Parameters
iConnHandleHandle for the connection, as returned by UVSC_OpenConnection
pAflMapPointer to a structure to contain the HLL code information about file and line
nAflMapLensize of the pAflMap data (bytes).
pVSetPointer to a structure containing calculated address. This variable will be updated with the result of the calculation.
vSetLenSize of the pVSet data (bytes)
Note
The input parameter pAflMap cannot consume the output parameter pAflMap from function UVSC_DBG_ADR_TOFILELINE
Returns
UVSC_STATUS_SUCCESS on success, or an error code
Precondition
UVSC_OpenConnection must have been called successfully
uVision is in debug mode

Use this function to convert a code address to a High Level Language (HLL) file, line and function.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_READ_REGISTERS ( int  iConnHandle,
char *  pBuf,
int *  pBufLen 
)

Read all register values

Parameters
iConnHandleHandle for the connection, as returned by UVSC_OpenConnection
pBufpointer to a string buffer to contain the register values
pBufLenpointer to a variable containing the size of pBuf in bytes This variable will be updated with the actual number of bytes returned.
Returns
UVSC_STATUS_SUCCESS on success, or an error code
Precondition
UVSC_OpenConnection must have been called successfully
A valid project is loaded, and uVision is debugging

Use this function to get a list of all register groups that exist within the current project.

The pointer pBuf must point to memory which is a multiple of the 32 bytes (32*register_count). The length of this buffer be passed in the variable pBufLen. The multiple must make the pBuf memory space large enough to contain the maximum number of register values that may be returned. If the memory area is not large enough for the returned data, the function will return an error. A recommended value is 4096.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_REGISTER_SET ( int  iConnHandle,
VSET pVSet,
int  vSetLen 
)

Set register value

Parameters
iConnHandleHandle for the connection, as returned by UVSC_OpenConnection
pVSetpointer to a VSET structure that contains: TVAL member contains register index as integer SSTR contains register value as string expression
vSetLensize of VSET stucture
Returns
UVSC_STATUS_SUCCESS on success, or an error code
Precondition
UVSC_OpenConnection must have been called successfully
A valid project is loaded, and uVision is debugging

Use this function to set a new value to a register

_UVSC_FUNC_ UVSC_STATUS UVSC_TxRxRaw ( int  iConnHandle,
UVSOCK_CMD buf 
)

Send a raw UVSOCK message, and retreive the response

Parameters
iConnHandleHandle for the connection, as returned by UVSC_OpenConnection
bufPointer to a structure containing the UVSOCK request message data. This will be replaced by the response message data
Returns
UVSC_STATUS_SUCCESS on success, or an error code
Precondition
UVSC_OpenConnection must have been called successfully

Use this function to send a raw UVSOCK message, and retreive the response. This is useful when implementing UVSOCK features that are not yet fully supported in UVSC. This is an advanced feature, and normally is not required.