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
UVSOCK.h File Reference

Data Structures

struct  UVSOCK_OPTIONS
 
struct  CYCTS
 
struct  SSTR
 
struct  TVAL
 
struct  VSET
 
struct  IVARENUM
 
struct  VARVAL
 
struct  VARINFO
 
struct  MENUID
 
struct  MENUENUM
 
struct  AMEM
 
struct  SERIO
 
struct  ITMOUT
 
struct  EVTR_CMDSTAT
 
struct  PRJDATA
 
struct  BKPARM
 
struct  BKRSP
 
struct  BKCHG
 
struct  TRNOPT
 
struct  UV_MRANGE
 
struct  UV_MEMINFO
 
struct  UVLICINFO
 
struct  DBGTGTOPT
 
struct  PGRESS
 
struct  EXTVERS
 
struct  ENUMTPM
 
struct  ADRMTFL
 
struct  AFLMAP
 
struct  BPREASON
 
struct  iSTKENUM
 
struct  STACKENUM
 
struct  TASKENUM
 
struct  REGENUM
 
struct  iVTRENUM
 
struct  AVTR
 
struct  iINTERVAL
 
struct  iSHOWSYNC
 
struct  UVSC_PSTAMP
 
struct  RAW_EVENT
 
struct  DEC_EVENT
 
struct  EVTR_PACK
 
struct  EVTROUT
 
struct  EXECCMD
 
struct  iPATHREQ
 
struct  UVSOCK_ERROR_RESPONSE
 
struct  UVSOCK_CMD_RESPONSE
 
union  UVSOCK_CMD_DATA
 
struct  UVSOCK_CMD
 

Macros

#define UV3_SOCKIF_VERS   229
 
#define SOCK_NDATA   32768
 
#define xFALSE   ((xBOOL)0)
 
#define xTRUE   (!xFALSE)
 
#define EVFMT_RAW   1
 
#define EVFMT_DEC   2
 

Typedefs

typedef unsigned char xBOOL
 
typedef unsigned char xUC8
 
typedef unsigned short int xWORD16
 
typedef signed short int xINT16
 
typedef unsigned __int64 xU64
 
typedef signed __int64 xI64
 

Enumerations

enum  UV_OPERATION {
  UV_NULL_CMD = 0x0000,
  UV_GEN_GET_VERSION = 0x0001,
  UV_GEN_UI_UNLOCK = 0x0002,
  UV_GEN_UI_LOCK = 0x0003,
  UV_GEN_HIDE = 0x0004,
  UV_GEN_SHOW = 0x0005,
  UV_GEN_RESTORE = 0x0006,
  UV_GEN_MINIMIZE = 0x0007,
  UV_GEN_MAXIMIZE = 0x0008,
  UV_GEN_EXIT = 0x0009,
  UV_GEN_GET_EXTVERSION = 0x000A,
  UV_GEN_CHECK_LICENSE = 0x000B,
  UV_GEN_CPLX_COMPLETE = 0x000C,
  UV_GEN_SET_OPTIONS = 0x000D,
  UV_PRJ_LOAD = 0x1000,
  UV_PRJ_CLOSE = 0x1001,
  UV_PRJ_ADD_GROUP = 0x1002,
  UV_PRJ_DEL_GROUP = 0x1003,
  UV_PRJ_ADD_FILE = 0x1004,
  UV_PRJ_DEL_FILE = 0x1005,
  UV_PRJ_BUILD = 0x1006,
  UV_PRJ_REBUILD = 0x1007,
  UV_PRJ_CLEAN = 0x1008,
  UV_PRJ_BUILD_CANCEL = 0x1009,
  UV_PRJ_FLASH_DOWNLOAD = 0x100A,
  UV_PRJ_GET_DEBUG_TARGET = 0x100B,
  UV_PRJ_SET_DEBUG_TARGET = 0x100C,
  UV_PRJ_GET_OPTITEM = 0x100D,
  UV_PRJ_SET_OPTITEM = 0x100E,
  UV_PRJ_ENUM_GROUPS = 0x100F,
  UV_PRJ_ENUM_FILES = 0x1010,
  UV_PRJ_CMD_PROGRESS = 0x1011,
  UV_PRJ_ACTIVE_FILES = 0x1012,
  UV_PRJ_FLASH_ERASE = 0x1013,
  UV_PRJ_GET_OUTPUTNAME = 0x1014,
  UV_PRJ_ENUM_TARGETS = 0x1015,
  UV_PRJ_SET_TARGET = 0x1016,
  UV_PRJ_GET_CUR_TARGET = 0x1017,
  UV_PRJ_SET_OUTPUTNAME = 0x1018,
  UV_DBG_ENTER = 0x2000,
  UV_DBG_EXIT = 0x2001,
  UV_DBG_START_EXECUTION = 0x2002,
  UV_DBG_RUN_TO_ADDRESS = 0x2102,
  UV_DBG_STOP_EXECUTION = 0x2003,
  UV_DBG_STATUS = 0x2004,
  UV_DBG_RESET = 0x2005,
  UV_DBG_STEP_HLL = 0x2006,
  UV_DBG_STEP_HLL_N = 0x2106,
  UV_DBG_STEP_INTO = 0x2007,
  UV_DBG_STEP_INTO_N = 0x2107,
  UV_DBG_STEP_INSTRUCTION = 0x2008,
  UV_DBG_STEP_INSTRUCTION_N = 0x2108,
  UV_DBG_STEP_OUT = 0x2009,
  UV_DBG_CALC_EXPRESSION = 0x200A,
  UV_DBG_MEM_READ = 0x200B,
  UV_DBG_MEM_WRITE = 0x200C,
  UV_DBG_TIME_INFO = 0x200D,
  UV_DBG_SET_CALLBACK = 0x200E,
  UV_DBG_VTR_GET = 0x200F,
  UV_DBG_VTR_SET = 0x2010,
  UV_DBG_SERIAL_GET = 0x2011,
  UV_DBG_SERIAL_PUT = 0x2012,
  UV_DBG_VERIFY_CODE = 0x2013,
  UV_DBG_CREATE_BP = 0x2014,
  UV_DBG_ENUMERATE_BP = 0x2015,
  UV_DBG_CHANGE_BP = 0x2016,
  UV_DBG_ENUM_SYMTP = 0x2017,
  UV_DBG_ADR_TOFILELINE = 0x2018,
  UV_DBG_ENUM_STACK = 0x2019,
  UV_DBG_ENUM_VTR = 0x201A,
  UV_DBG_UNUSED = 0x201B,
  UV_DBG_ADR_SHOWCODE = 0x201C,
  UV_DBG_WAKE = 0x201D,
  UV_DBG_SLEEP = 0x201E,
  UV_MSGBOX_MSG = 0x201F,
  UV_DBG_EXEC_CMD = 0x2020,
  UV_DBG_POWERSCALE_SHOWCODE = 0x2021,
  UV_DBG_POWERSCALE_SHOWPOWER = 0x2022,
  POWERSCALE_OPEN = 0x2023,
  UV_DBG_EVAL_EXPRESSION_TO_STR = 0x2024,
  UV_DBG_FILELINE_TO_ADR = 0x2025,
  UV_DBG_ENUM_REGISTER_GROUPS = 0x2026,
  UV_DBG_ENUM_REGISTERS = 0x2027,
  UV_DBG_READ_REGISTERS = 0x2028,
  UV_DBG_REGISTER_SET = 0x2029,
  UV_DBG_DSM_READ = 0x202A,
  UV_DBG_EVAL_WATCH_EXPRESSION = 0x202B,
  UV_DBG_REMOVE_WATCH_EXPRESSION = 0x202D,
  UV_DBG_ENUM_VARIABLES = 0x202E,
  UV_DBG_VARIABLE_SET = 0x202F,
  UV_DBG_ENUM_TASKS = 0x2030,
  UV_DBG_ENUM_MENUS = 0x2031,
  UV_DBG_MENU_EXEC = 0x2032,
  UV_DBG_ITM_REGISTER = 0x2033,
  UV_DBG_ITM_UNREGISTER = 0x2034,
  UV_DBG_EVTR_REGISTER = 0x2035,
  UV_DBG_EVTR_UNREGISTER = 0x2036,
  UV_DBG_EVTR_GETSTATUS = 0x2037,
  UV_DBG_EVTR_ENUMSCVDFILES = 0x2038,
  UV_CMD_RESPONSE = 0x3000,
  UV_ASYNC_MSG = 0x4000,
  UV_PRJ_BUILD_COMPLETE = 0x5000,
  UV_PRJ_BUILD_OUTPUT = 0x5001,
  UV_DBG_CALLBACK = 0x5002,
  UV_DBG_BP_ENUM_START = 0x5004,
  UV_DBG_BP_ENUMERATED = 0x5005,
  UV_DBG_BP_ENUM_END = 0x5006,
  UV_PRJ_ENUM_GROUPS_START = 0x5007,
  UV_PRJ_ENUM_GROUPS_ENU = 0x5008,
  UV_PRJ_ENUM_GROUPS_END = 0x5009,
  UV_PRJ_ENUM_FILES_START = 0x500A,
  UV_PRJ_ENUM_FILES_ENU = 0x500B,
  UV_PRJ_ENUM_FILES_END = 0x500C,
  UV_PRJ_PBAR_INIT = 0x500D,
  UV_PRJ_PBAR_STOP = 0x500E,
  UV_PRJ_PBAR_SET = 0x500F,
  UV_PRJ_PBAR_TEXT = 0x5010,
  UV_DBG_ENUM_SYMTP_START = 0x5011,
  UV_DBG_ENUM_SYMTP_ENU = 0x5012,
  UV_DBG_ENUM_SYMTP_END = 0x5013,
  UV_DBG_ENUM_STACK_START = 0x5014,
  UV_DBG_ENUM_STACK_ENU = 0x5015,
  UV_DBG_ENUM_STACK_END = 0x5016,
  UV_DBG_ENUM_VTR_START = 0x5017,
  UV_DBG_ENUM_VTR_ENU = 0x5018,
  UV_DBG_ENUM_VTR_END = 0x5019,
  UV_DBG_CMD_OUTPUT = 0x5020,
  UV_DBG_SERIAL_OUTPUT = 0x5120,
  UV_PRJ_ENUM_TARGETS_START = 0x5021,
  UV_PRJ_ENUM_TARGETS_ENU = 0x5022,
  UV_PRJ_ENUM_TARGETS_END = 0x5023,
  UV_DBG_ENUM_REGISTER_GROUPS_START = 0x5024,
  UV_DBG_ENUM_REGISTER_GROUPS_ENU = 0x5025,
  UV_DBG_ENUM_REGISTER_GROUPS_END = 0x5026,
  UV_DBG_ENUM_REGISTERS_START = 0x5027,
  UV_DBG_ENUM_REGISTERS_ENU = 0x5028,
  UV_DBG_ENUM_REGISTERS_END = 0x5029,
  UV_DBG_ITM_OUTPUT = 0x5030,
  UV_DBG_ENUM_VARIABLES_START = 0x5040,
  UV_DBG_ENUM_VARIABLES_ENU = 0x5041,
  UV_DBG_ENUM_VARIABLES_END = 0x5042,
  UV_DBG_ENUM_TASKS_START = 0x5050,
  UV_DBG_ENUM_TASKS_ENU = 0x5051,
  UV_DBG_ENUM_TASKS_END = 0x5052,
  UV_DBG_ENUM_MENUS_START = 0x5060,
  UV_DBG_ENUM_MENUS_ENU = 0x5061,
  UV_DBG_ENUM_MENUS_END = 0x5062,
  UV_DBG_EVTR_OUTPUT = 0x5063,
  UV_DBG_EVTR_ENUMSCVDFILES_START = 0x5064,
  UV_DBG_EVTR_ENUMSCVDFILES_ENU = 0x5065,
  UV_DBG_EVTR_ENUMSCVDFILES_END = 0x5066,
  UV_RTA_MESSAGE = 0x6000,
  UV_RTA_INCOMPATIBLE = 0x6001,
  UV_TST_1 = 0xFF00,
  UV_TST_2 = 0xFF01,
  UV_TST_3 = 0xFF02,
  UV_TST_4 = 0xFF03,
  UV_TST_5 = 0xFF04,
  UV_TST_6 = 0xFF05,
  UV_TST_7 = 0xFF06,
  UV_TST_8 = 0xFF07,
  UV_TST_9 = 0xFF08,
  UV_TST_10 = 0xFF09
}
 
enum  UV_STATUS {
  UV_STATUS_SUCCESS = 0,
  UV_STATUS_FAILED = 1,
  UV_STATUS_NO_PROJECT = 2,
  UV_STATUS_WRITE_PROTECTED = 3,
  UV_STATUS_NO_TARGET = 4,
  UV_STATUS_NO_TOOLSET = 5,
  UV_STATUS_NOT_DEBUGGING = 6,
  UV_STATUS_ALREADY_PRESENT = 7,
  UV_STATUS_INVALID_NAME = 8,
  UV_STATUS_NOT_FOUND = 9,
  UV_STATUS_DEBUGGING = 10,
  UV_STATUS_TARGET_EXECUTING = 11,
  UV_STATUS_TARGET_STOPPED = 12,
  UV_STATUS_PARSE_ERROR = 13,
  UV_STATUS_OUT_OF_RANGE = 14,
  UV_STATUS_BP_CANCELLED = 15,
  UV_STATUS_BP_BADADDRESS = 16,
  UV_STATUS_BP_NOTSUPPORTED = 17,
  UV_STATUS_BP_FAILED = 18,
  UV_STATUS_BP_REDEFINED = 19,
  UV_STATUS_BP_DISABLED = 20,
  UV_STATUS_BP_ENABLED = 21,
  UV_STATUS_BP_CREATED = 22,
  UV_STATUS_BP_DELETED = 23,
  UV_STATUS_BP_NOTFOUND = 24,
  UV_STATUS_BUILD_OK_WARNINGS = 25,
  UV_STATUS_BUILD_FAILED = 26,
  UV_STATUS_BUILD_CANCELLED = 27,
  UV_STATUS_NOT_SUPPORTED = 28,
  UV_STATUS_TIMEOUT = 29,
  UV_STATUS_UNEXPECTED_MSG = 30,
  UV_STATUS_VERIFY_FAILED = 31,
  UV_STATUS_NO_ADRMAP = 32,
  UV_STATUS_INFO = 33,
  UV_STATUS_NO_MEM_ACCESS = 34,
  UV_STATUS_FLASH_DOWNLOAD = 35,
  UV_STATUS_BUILDING = 36,
  UV_STATUS_HARDWARE = 37,
  UV_STATUS_SIMULATOR = 38,
  UV_STATUS_BUFFER_TOO_SMALL = 39,
  UV_STATUS_EVTR_FAILED = 40,
  UV_STATUS_END
}
 
enum  VTT_TYPE {
  VTT_void = 0,
  VTT_bit = 1,
  VTT_char = 2,
  VTT_uchar = 3,
  VTT_int = 4,
  VTT_uint = 5,
  VTT_short = 6,
  VTT_ushort = 7,
  VTT_long = 8,
  VTT_ulong = 9,
  VTT_float = 10,
  VTT_double = 11,
  VTT_ptr = 12,
  VTT_union = 13,
  VTT_struct = 14,
  VTT_func = 15,
  VTT_string = 16,
  VTT_enum = 17,
  VTT_field = 18,
  VTT_int64 = 19,
  VTT_uint64 = 20,
  VTT_end
}
 
enum  UVMENUTYPES {
  UVMENU_DEBUG = 0,
  UVMENU_SYS_VIEW = 1,
  UVMENU_PERI = 2,
  UVMENU_RTX = 3,
  UVMENU_CAN = 4,
  UVMENU_AGDI = 5,
  UVMENU_TOOLBOX = 6,
  UVMENU_END
}
 
enum  MENUENUMTYPES {
  MENU_INFO_ITEM = 1,
  MENU_INFO_GROUP = 2,
  MENU_INFO_GROUP_END = -2,
  MENU_INFO_LIST_END = -1,
  MENU_INFO_RESERVED = 3,
  MENU_INFO_END = 4
}
 
enum  UVBUILDCODES {
  UVBUILD_OK = 1,
  UVBUILD_OK_WARNINGS = 2,
  UVBUILD_ERRORS = 3,
  UVBUILD_CANCELLED = 4,
  UVBUILD_CLEANED = 5,
  UVBUILD_CODES_END
}
 
enum  BKTYPE {
  BRKTYPE_EXEC = 1,
  BRKTYPE_READ = 2,
  BRKTYPE_WRITE = 3,
  BRKTYPE_READWRITE = 4,
  BRKTYPE_COMPLEX = 5,
  BRKTYPE_END
}
 
enum  CHG_TYPE {
  CHG_KILLBP = 1,
  CHG_ENABLEBP = 2,
  CHG_DISABLEBP = 3,
  CHG_END
}
 
enum  OPTSEL {
  OPT_LMISC = 1,
  OPT_CMISC = 2,
  OPT_AMISC = 3,
  OPT_CINCL = 4,
  OPT_AINCL = 5,
  OPT_CDEF = 6,
  OPT_ADEF = 7,
  OPT_CUNDEF = 8,
  OPT_AUNDEF = 9,
  OPT_COPTIMIZE = 10,
  OPT_CODEGEN = 11,
  OPT_MEMRANGES = 12,
  OPT_ASNMEMRANGES = 13,
  OPT_UBCOMP1 = 14,
  OPT_UBCOMP2 = 15,
  OPT_UBBUILD1 = 16,
  OPT_UBBUILD2 = 17,
  OPT_UABUILD1 = 18,
  OPT_UABUILD2 = 19,
  OPT_UBEEP = 20,
  OPT_USTARTDEB = 21,
  OPT_END
}
 
enum  UV_MR {
  UV_MR_NONE = 0,
  UV_MR_ROM = 1,
  UV_MR_RAM = 2,
  UV_MR_END
}
 
enum  UV_TARGET {
  UV_TARGET_HW = 0,
  UV_TARGET_SIM = 1,
  UV_TARGET_END
}
 
enum  PGCMD {
  UV_PROGRESS_INIT = 1,
  UV_PROGRESS_SETPOS = 2,
  UV_PROGRESS_CLOSE = 3,
  UV_PROGRESS_INITTXT = 4,
  UV_PROGRESS_SETTEXT = 5,
  UV_PROGRESS_END
}
 
enum  ENTPJOB {
  UV_TPENUM_MEMBERS = 1,
  UV_TPENUM_END
}
 
enum  STOPREASON {
  STOPREASON_UNDEFINED = 0x0000,
  STOPREASON_EXEC = 0x0001,
  STOPREASON_READ = 0x0002,
  STOPREASON_HIT_WRITE = 0x0004,
  STOPREASON_HIT_COND = 0x0008,
  STOPREASON_HIT_ESC = 0x0010,
  STOPREASON_HIT_VIOLA = 0x0020,
  STOPREASON_TIME_OVER = 0x0040,
  STOPREASON_UNDEFINS = 0x0080,
  STOPREASON_PABT = 0x0100,
  STOPREASON_DABT = 0x0200,
  STOPREASON_NONALIGN = 0x0400,
  STOPREASON_END
}
 

Description

UVSOCK Interface.

Version
V2.29

API for uVision UVSOCK socket interface.

General API Rules

  • Multiple TCP connections are possible simultaneously
  • All 'reserved' data fields must be sent as 0 and ignored when received
  • Non-relevant data fields in requests must be sent as 0

Version History

Author, Date, Version

  • PH , 12.03.2006, V1.00
  • RAS, 11.11.2007, V2.00
  • RAS, 03.01.2008, V2.01
  • RAS, 08.02.2008, V2.02
  • RAS, 20.02.2008, V2.03
  • RAS, 18.03.2008, V2.04
  • RAS, 22.04.2008, V2.05
  • RAS, 25.04.2008, V2.06
  • RAS, 09.05.2008, V2.07
  • RAS, 25.09.2008, V2.08
  • PH, 22.07.2009, V2.09
  • TdB, 25.11.2010, V2.10
  • ED, 20.02.2011, V2.11
  • ED, 20.03.2011, V2.12 / V2.13
  • PH, 28.04.2011, V2.14
  • JR, 18.04.2012, V2.24
  • JR, 16.04.2013, V2.25
  • TdB, 09.06.2016, V2.26
  • TdB, 09.06.2016, V2.27
  • TdB, 09.06.2016, V2.28
  • TdB, 25.01.2017, V2.29

Change Log

Version 2.00:

  • Socket server move from UI thread to own thread
  • DBG WAKE/SLEEP implemented for Simulated I/O

Version 2.01:

  • API renamed to UVSOCK(.h)
  • BKRSP command default length increased to 512 bytes

Version 2.02:

  • API documented
  • Changed defines to enumerations

Version 2.03:

  • Added more status codes

Version 2.04:

  • Increased size of UVSC internal message queue to 200

Version 2.05:

  • Added xBOOL type definition

Version 2.06:

  • Enhancement: Modified Message Box blocking mechanism, reducing the amount of messages required to complete several commands
  • Baseline: Backwards compatibility for UVSC_C.h from this version

Version 2.07:

  • UVSC changes only

Version 2.08:

  • Enhancement: Added UVSC_DBG_EXEC_CMD / GetCmdOutput / GetCmdOutputSize functions. They allows any command line to be executed via UVSOCK
  • Enhancement: Added UVSC_PRG_GET_OUTPUTNAME command. It allows the current executable name to be retrieved.

Version 2.09:

  • Enhancement: Changed display of Breakpoint-command responses to show BP_DELETED, BP_ENABLED etc. This requires to look at 'cmdRsp.status' for exact Bp-action.

Version 2.10:

Version 2.11:

Version 2.14:

  • Correction: Mantis #4789: removed 'UVSC_PSTAMP' from response created by OkToClientGeneric()

Version 2.15:

  • Bugfix: Writing beyond buffer size is fixed in UV_DBG_ENUM_STACK

Version 2.17:

Version 2.18:

Version 2.19:

Version 2.20:

Version 2.21:

  • Enhancement: Struct VARINO is extended with number of flags to support Eclipse client

Version 2.22:

  • Correction: Comments are changed to match implementation

Version 2.23:

  • Enahncement: Added UV_GEN_SET_OPTIONS to set general UVSC options

Version 2.24:

Version 2.25:

  • Enhancement: Added 'showSyncErr' flag to UVSC_PSTAMP to show sync error message in uVision

Version 2.26:

Version 2.27:

  • Enhancement: fixed Copyright

Version 2.28:

  • Enhancement: fixed Version numbers for all UVSock related files

Version 2.29:

  • Enhancement: added Event Recorder

Macro Definition Documentation

#define EVFMT_DEC   2
#define EVFMT_RAW   1