Using the µVision Socket Interface: Debug Functions

| Using the µVision Socket Interface Application Note 198 Control and monitor µVision via the built-in TCP/IP interface

- Main Page
- Usage and Description
- Reference

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Debug Functions
Client Functions

## Functions
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ENTER (int iConnHandle)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_EXIT (int iConnHandle)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_START_EXECUTION (int iConnHandle)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_RUN_TO_ADDRESS (int iConnHandle, xU64 address)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_STOP_EXECUTION (int iConnHandle)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_STATUS (int iConnHandle, int *pStatus)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_STEP_HLL (int iConnHandle)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_STEP_HLL_N (int iConnHandle, UINT count)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_STEP_INSTRUCTION (int iConnHandle)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_STEP_INSTRUCTION_N (int iConnHandle, UINT count)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_STEP_INTO (int iConnHandle)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_STEP_INTO_N (int iConnHandle, UINT count)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_STEP_OUT (int iConnHandle)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_RESET (int iConnHandle)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_MEM_READ (int iConnHandle, AMEM *pMem, int memLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_MEM_WRITE (int iConnHandle, AMEM *pMem, int memLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_CREATE_BP (int iConnHandle, BKPARM *pBkptSet, int bkptSetLen, BKRSP *pBkptRsp, int *pBkptRspLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_CHANGE_BP (int iConnHandle, BKCHG *pBkptChg, int bkptChgLen, BKRSP *pBkptRsp, int *pBkptRspLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ENUMERATE_BP (int iConnHandle, BKRSP *pBkptRsp, int *pBkptIndexes, int *pBkptCount)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_SERIAL_GET (int iConnHandle, SERIO *pSerIO, int serIOLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_SERIAL_PUT (int iConnHandle, SERIO *pSerIO, int serIOLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ITM_REGISTER (int iConnHandle, ITMOUT *pItmOut, int itmIoLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ITM_UNREGISTER (int iConnHandle, ITMOUT *pItmOut, int itmIoLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_CALC_EXPRESSION (int iConnHandle, VSET *pVSet, int vSetLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_EVAL_WATCH_EXPRESSION (int iConnHandle, VSET *pVSet, int vSetLen, VARINFO *pVarInfo)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_REMOVE_WATCH_EXPRESSION (int iConnHandle, VSET *pVSet, int vSetLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ENUM_VARIABLES (int iConnHandle, IVARENUM *iVarEnum, VARINFO *pVarInfo, int *nVarInfoCount)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_VARIABLE_SET (int iConnHandle, VARVAL *pVar, int vVarLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ENUM_VTR (int iConnHandle, iVTRENUM *piVtrEnum, AVTR *paVTR, int *pVtrIndexes, int *pVtrCount)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_VTR_GET (int iConnHandle, VSET *pVSet, int vSetLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_VTR_SET (int iConnHandle, VSET *pVSet, int vSetLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ENUM_STACK (int iConnHandle, iSTKENUM *piStkEnum, STACKENUM *pStackEnum, int *pStackCount)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ENUM_TASKS (int iConnHandle, TASKENUM *pTaskEnum, int *pTaskCount)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ENUM_MENUS (int iConnHandle, MENUID *pMenuID, MENUENUM *pViewEnum, int *pMenuCount)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_MENU_EXEC (int iConnHandle, MENUID *pMenuID)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ADR_TOFILELINE (int iConnHandle, ADRMTFL *pAdrMtfl, AFLMAP *pAflMap, int *pAflMapLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ADR_SHOWCODE (int iConnHandle, iSHOWSYNC *piShowSync)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_WAKE (int iConnHandle, iINTERVAL *piInterval)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_SLEEP (int iConnHandle)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_EXEC_CMD (int iConnHandle, EXECCMD *pCmd, int cmdLen)

## Description

## Function Documentation

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ADR_SHOWCODE | ( | int | iConnHandle,
|  | iSHOWSYNC * | piShowSync
| ) |  |

Show code at a specific address within uVision

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  piShowSync | Pointer to a structure containing the type of code to show

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 show code at a specific address within uVision. Either ASM code, HLL code, or both can shown.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ADR_TOFILELINE | ( | int | iConnHandle,
|  | ADRMTFL * | pAdrMtfl,
|  | AFLMAP * | pAflMap,
|  | int * | pAflMapLen
| ) |  |

Convert a code address to a High Level Language (HLL) file, line and function

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pAdrMtfl | Pointer to a structure containing the type of HLL information to retrieve
  pAflMap | Pointer to a structure to contain the HLL code information. 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
  pAflMapLen | Pointer to a variable containing the size of the pAflMap data (bytes). This variable will be updated with the length of the pAflMap data returned

Note
  The output parameter pAflMap cannot be used as an input parameter for function UVSC_DBG_FILELINE_TO_ADR

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_CALC_EXPRESSION | ( | int | iConnHandle,
|  | VSET * | pVSet,
|  | int | vSetLen
| ) |  |

Calculate the value of an expression

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pVSet | Pointer to a structure containing the expression to calculate. This variable will be updated with the result of the expression calculation. This is a variable length structure.
  vSetLen | Size 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 calculate the value of an expression, in the same way an expression would be calculated via the uVision command window. This function can also be used to read and write real and virtual registers.

Example 1: Evaluate the address of the function 'main()'

     Set pVSet->str to "&main"

Example 2: Read the value of R0

     Set pVSet->str to "R0"

Example 3: Modify the value of PC to 0x99

     Set pVSet->str to "PC = 0x99"

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_CHANGE_BP | ( | int | iConnHandle,
|  | BKCHG * | pBkptChg,
|  | int | bkptChgLen,
|  | BKRSP * | pBkptRsp,
|  | int * | pBkptRspLen
| ) |  |

Modify an existing breakpoint

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pBkptChg | Pointer to a structure containing the breakpoint to change. This is a variable length structure.
  bkptChgLen | Size of the pBkptChg data (bytes)
  pBkptRsp | Pointer to a structure to contain the new breakpoint information. 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.
  pBkptRspLen | Size of the pBkptRsp data (bytes). This variable will be updated with the actual length of data written to the pBkptRsp structure

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 modify an exisiting breakpoint in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_CREATE_BP | ( | int | iConnHandle,
|  | BKPARM * | pBkptSet,
|  | int | bkptSetLen,
|  | BKRSP * | pBkptRsp,
|  | int * | pBkptRspLen
| ) |  |

Create a breakpoint

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pBkptSet | Pointer to a structure containing the new breakpoint data. This is a variable length structure.
  bkptSetLen | Size of the pBkptSet data (bytes)
  pBkptRsp | Pointer to a structure to contain the new breakpoint information. 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.
  pBkptRspLen | Size of the pBkptRsp data (bytes). This variable will be updated with the actual length of data written to the pBkptRsp structure

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 create a new breakpoint in uVision. The information returned in the pBkptRsp structure contains nTickMark which can be used to identify this breakpoint in the future to other UVSC command functions.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENTER | ( | int | iConnHandle | ) |

Enter debug mode

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  A valid project is loaded, a binary has been built, and uVision is not building, downloading, or debugging

Use this function to put uVision into debug mode.

This is the equivalent of clicking the 'Debug–>Start/Stop Debug Session' menu item in uVision (when not in debug mode).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_MENUS | ( | int | iConnHandle,
|  | MENUID * | pMenuID,
|  | MENUENUM * | pViewEnum,
|  | int * | pMenuCount
| ) |  |

Enumerate dynamic menus

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pMenuID | Pointer to a structure containing the type of menu enumeration to perform
  pViewEnum | Pointer to a structure to contain the menu items
  pMenuCount | Pointer to a variable to containing the number of items

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 a list of the available uVision dynamic menus to execute remotely

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_STACK | ( | int | iConnHandle,
|  | iSTKENUM * | piStkEnum,
|  | STACKENUM * | pStackEnum,
|  | int * | pStackCount
| ) |  |

Enumerate stack frames

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  piStkEnum | Pointer to a structure containing the type of stack enumeration to perform
  pStackEnum | Pointer to a structure to contain the stack frame(s)
  pStackCount | Pointer to a variable to containing the number of items it is possible to fit into the pStackEnum structure. This variable will be updated with the actual number of stack frames returned

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to get a list of the current stack frames.

The pointer pStackEnum must point to memory which is a multiple of the size of the STACKENUM structure. This multiple must be passed in the variable pStackCount. The multiple must be at least equal to the maximum number of stack frames that may be returned. A recommended value is 256.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_TASKS | ( | int | iConnHandle,
|  | TASKENUM * | pTaskEnum,
|  | int * | pTaskCount
| ) |  |

Enumerate task list

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pTaskEnum | Pointer to a TASKENUM structure to contain the task items
  pTaskCount | Pointer to a variable to containing the number of items

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing
  Extended stack mode is set using UVSC_GEN_SET_OPTIONS call

Use this function to get a list of the current RTX task in non-RTX mode default implicit main thread is returned

The pointer pTaskEnum must point to memory which is a multiple of the size of the TASKENUM structure. This multiple must be passed in the variable pTaskCount. The multiple must be at least equal to the maximum number of task items that may be returned. A recommended value is 256.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_VARIABLES | ( | int | iConnHandle,
|  | IVARENUM * | iVarEnum,
|  | VARINFO * | pVarInfo,
|  | int * | nVarInfoCount
| ) |  |

Enumerarte variables of stack frame, watch expression or variable members/array elements

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  iVarEnum | - pointer to IVARENUM structure containing task, stack frame and variable ID together with request flags
  pVarInfo | pointer to array of VARINFO sturctures to receive member infos
  nVarInfoCount | pointer variable containing nember of VARINFO to receive member infos on return its value is updated with actual number read

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode
  Extended stack mode is set using UVSC_GEN_SET_OPTIONS call

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_VTR | ( | int | iConnHandle,
|  | iVTRENUM * | piVtrEnum,
|  | AVTR * | paVTR,
|  | int * | pVtrIndexes,
|  | int * | pVtrCount
| ) |  |

Enumerate the device Virtual Registers (VTRs)

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  piVtrEnum | Pointer to a structure containing the type of VTR enumeration to perform
  paVTR | Pointer to a structure to contain the VTR(s)
  pVtrIndexes | Pointer to a variable to contain the VTR index(es) within the paVTR data.
  pVtrCount | Pointer to a variable to containing the number of items it is possible to fit into the paVTR and pVtrIndexes structures. This variable will be updated with the actual number of VTRs returned

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to get a list of all the VTRs that exist within the target device. Optionally their values can also be retreived

The pointers paVTR and pVtrIndexes must point to memory which is a multiple of the size of these structures. This multiple must be passed in the variable pVtrCount. The multiple must make the paVTR memory space large enough to contain the maximum number of VTRs 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.

The AVTR structure is designed to contain variable length data, therefore it may be the case that one record within paVTR actually takes up more than 1 index. Because of this, the returned data should be interpreted in the following way:

    for (i=0; i<*pVtrCount; i++) {
      pointer_to_ith_VTR = paVTR[pVtrIndexes[i]];
    }

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUMERATE_BP | ( | int | iConnHandle,
|  | BKRSP * | pBkptRsp,
|  | int * | pBkptIndexes,
|  | int * | pBkptCount
| ) |  |

Enumerate all breakpoints

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pBkptRsp | Pointer to a structure to contain the breakpoint(s) information
  pBkptIndexes | Pointer to a variable to contain the breakpoint index(es) within the pBkptRsp data.
  pBkptCount | Pointer to a variable to containing the number of items it is possible to fit into the pBkptRsp and pBkptIndexes structures. This variable will be updated with the actual number of breakpoints returned.

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 a list of all the breakpoints that exist in uVision, and their current status.

The pointers pBkptRsp and pBkptIndexes must point to memory which is a multiple of the size of these structures. This multiple must be passed in the variable pBkptCount. The multiple must make the pBkptRsp memory space large enough to contain the maximum number of breakpoints 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.

The BKRSP structure is designed to contain variable length data, therefore it may be the case that one record within pBkptRsp actually takes up more than 1 index. Because of this, the returned data should be interpreted in the following way:

    for (i=0; i<*pBkptCount; i++) {
      pointer_to_ith_Breakpoint = pBkptRsp[pBkptIndexes[i]];
    }

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_EVAL_WATCH_EXPRESSION | ( | int | iConnHandle,
|  | VSET * | pVSet,
|  | int | vSetLen,
|  | VARINFO * | pVarInfo
| ) |  |

Evaluate watch expression

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pVSet | pointer to a VSET structure: TVAL member: stack frame address (VTT_uint64) (reserved) SSTR contains watch expression.
  vSetLen | Size of the pVSet data (bytes)
  pVarInfo | Pointer to a variable to receive watch expression result

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode
  Extended stack mode is set using UVSC_GEN_SET_OPTIONS call

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_EXEC_CMD | ( | int | iConnHandle,
|  | EXECCMD * | pCmd,
|  | int | cmdLen
| ) |  |

Execute a command (as if via the command line)

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pCmd | Pointer to a structure containing the command line to execute in uVision. This is a variable length structure
  cmdLen | Length of the data within the pCmd
  cmdLen | Size of the structure pointed to by pCmd.

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 execute a command in the same way as typing the command in the uVision Command Window.

If required, the command output text can be retrieved via the UVSC_GetCmdOutputSize and UVSC_GetCmdOutput functions.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_EXIT | ( | int | iConnHandle | ) |

Exit debug mode

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

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 exit debug mode.

This is the equivalent of clicking the 'Debug–>Start/Stop Debug Session' menu item in uVision (when in debug mode).

Attention
  - Always call UVSC_DBG_STOP_EXECUTION before exiting the debug mode.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ITM_REGISTER | ( | int | iConnHandle,
|  | ITMOUT * | pItmOut,
|  | int | itmIoLen
| ) |  |

Register for an ITM Channel that should be sent to Client

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pItmOut | Pointer to ITMOUT structure containing the ITM channel to register. This is a variable length structure
  itmIoLen | Size of the pItmOut 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 register an ITM Channel.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ITM_UNREGISTER | ( | int | iConnHandle,
|  | ITMOUT * | pItmOut,
|  | int | itmIoLen
| ) |  |

Unregister for an ITM Channel that should be sent to Client

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pItmOut | Pointer to ITMOUT structure containing the ITM channel to unregister. This is a variable length structure.
  itmIoLen | Size of the pItmOut 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 register an ITM Channel.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_MEM_READ | ( | int | iConnHandle,
|  | AMEM * | pMem,
|  | int | memLen
| ) |  |

Read memory

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pMem | Pointer to a structure containing the information about the memory to read. This variable will be updated with the data read from memory. 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
  memLen | Size of the pMem 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 read target memory.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_MEM_WRITE | ( | int | iConnHandle,
|  | AMEM * | pMem,
|  | int | memLen
| ) |  |

Write memory

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pMem | Pointer to a structure containing the information about the memory to write, including the data to write. This is a variable length structure
  memLen | Size of the pMem 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 write target memory.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_MENU_EXEC | ( | int | iConnHandle,
|  | MENUID * | pMenuID
| ) |  |

Execute meu item obtained by calling UVSC_DBG_ENUM_MENUS

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pMenuID | Pointer to a structure containing menu type and its ID

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_REMOVE_WATCH_EXPRESSION | ( | int | iConnHandle,
|  | VSET * | pVSet,
|  | int | vSetLen
| ) |  |

Remove watch expression added by UVSC_DBG_EVAL_WATCH_EXPRESSION

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pVSet | pointer to a VSET structure: SSTR contains watch expression.
  vSetLen | Size of the pVSet data (bytes)

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode
  Extended stack mode is set using UVSC_GEN_SET_OPTIONS call

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_RESET | ( | int | iConnHandle | ) |

Reset the target

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

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 reset the target processor or simulation.

This is the equivalent of clicking the 'Peripherals–>Reset CPU' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_RUN_TO_ADDRESS | ( | int | iConnHandle,
|  | xU64 | address
| ) |  |

Start execution and run to specified address

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  address | (xU64) address to run to

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to start the target or simulation execution.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_SERIAL_GET | ( | int | iConnHandle,
|  | SERIO * | pSerIO,
|  | int | serIOLen
| ) |  |

DEPRECATED: use DBG_SERIAL_OUTPUT response Get terminal data from a uVision terminal window

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pSerIO | Pointer to a structure containing the information about the terminal window to get data from. This variable will be updated with the data read from the terminal window. 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.
  serIOLen | Size of the pSerIO 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 terminal data from a uVision terminal window.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_SERIAL_PUT | ( | int | iConnHandle,
|  | SERIO * | pSerIO,
|  | int | serIOLen
| ) |  |

Send terminal data to a uVision terminal window

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pSerIO | Pointer to a structure containing the information about the terminal window to write data to, including the data to write. This is a variable length structure
  serIOLen | Size of the pSerIO 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 send terminal data to a uVision terminal window.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_SLEEP | ( | int | iConnHandle | ) |

Sleep the simulation [SIMULATOR ONLY]

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and is targetting the simulator

Use this function to put the simulation to sleep. When the simulator is asleep, simulation is paused, but uVision still shows the simulation as running.

NOTE: The simulator will automatically wake up after 500ms if it is not told to wake up by a UVSC_DBG_WAKE command.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_START_EXECUTION | ( | int | iConnHandle | ) |

Start execution

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to start the target or simulation execution.

This is the equivalent of clicking the 'Debug–>Run' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STATUS | ( | int | iConnHandle,
|  | int * | pStatus
| ) |  |

Get execution status

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pStatus | Pointer to a variable to contain the execution status. 1:= the target is executing, 0:= the target is stopped.

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 find out if the target or simulator is executing, or is stopped.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_HLL | ( | int | iConnHandle | ) |

Step one High Level Language (HLL) code line

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to step one High Level Language (HLL) code line.

This is the equivalent of clicking the 'Debug–>Step Over' menu item in uVision (when viewing HLL code).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_HLL_N | ( | int | iConnHandle,
|  | UINT | count
| ) |  |

Step N High Level Language (HLL) code lines

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  count | (UINT) - number of steps to perform

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to N High Level Language (HLL) code lines.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_INSTRUCTION | ( | int | iConnHandle | ) |

Step one ASM instruction

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to step one ASM instruction.

This is the equivalent of clicking the 'Debug–>Step' menu item in uVision (when viewing ASM code).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_INSTRUCTION_N | ( | int | iConnHandle,
|  | UINT | count
| ) |  |

Step N ASM instructions

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Parameters

  count | (UINT) - number of steps to perform

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to step N ASM instructions.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_INTO | ( | int | iConnHandle | ) |

Step into the current High Level Language (HLL) function

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to step into the current High Level Language (HLL) function.

This is the equivalent of clicking the 'Debug–>Step' menu item in uVision (when viewing HLL code).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_INTO_N | ( | int | iConnHandle,
|  | UINT | count
| ) |  |

Step into the current High Level Language (HLL) function

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Parameters

  count | (UINT) - number of steps to perform

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to step into the current High Level Language (HLL) function.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_OUT | ( | int | iConnHandle | ) |

Step out of the current High Level Language (HLL) function

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and not executing

Use this function to step out of the current High Level Language (HLL) function.

This is the equivalent of clicking the 'Debug–>Step out of current function' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STOP_EXECUTION | ( | int | iConnHandle | ) |

Stop execution

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and executing

Use this function to stop the target or simulation execution.

This is the equivalent of clicking the 'Debug–>Stop Running' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_VARIABLE_SET | ( | int | iConnHandle,
|  | VARVAL * | pVar,
|  | int | vVarLen
| ) |  |

Set variable value

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pVar | pointer to a VARVAL structure that contains: variable member contains full variable ID as IVARENUM structure value member contains variable value as string expression in SSTR cturcture
  vVarLen | size of VARVAL 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
  Extended stack mode is set using UVSC_GEN_SET_OPTIONS call

Use this function to set a new value to a variable

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_VTR_GET | ( | int | iConnHandle,
|  | VSET * | pVSet,
|  | int | vSetLen
| ) |  |

Get the value of a virtual register (VTR)

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pVSet | Pointer to a structure containing the VTR to get. This structure will be updated with the VTR value. This is a variable length structure
  vSetLen | Size 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 the value of a virtual register (VTR).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_VTR_SET | ( | int | iConnHandle,
|  | VSET * | pVSet,
|  | int | vSetLen
| ) |  |

Set the value of a virtual register (VTR)

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pVSet | Pointer to a structure containing the VTR to set, and the value to set it to. This is a variable length structure
  vSetLen | Size 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 set the value of a virtual register (VTR).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_WAKE | ( | int | iConnHandle,
|  | iINTERVAL * | piInterval
| ) |  |

Wake the simulation [SIMULATOR ONLY]

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  piInterval | Pointer to a structure containing the information on how long the simulation should wake for.

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode, and is targetting the simulator

Use this function to simulate I/O to and from the uVision simulator in a synchronous manner.

The function call can run the simulation for a specified time, after which the simulation is put to sleep and a notification generated. At this point, simulation virtual registers (ie device IO) can be read and written, and then this message can be sent again to wake the simulation again. This sequence can be used to simulate I/O to and from the simulator in a synchronous manner.

When the simulator is asleep, simulation is paused, but uVision still shows the simulation as running.

NOTE: The simulator will automatically wake up after 500ms if it is not told to wake up by another UVSC_DBG_WAKE command.