![]() |
Using the µVision Socket Interface
Application Note 198
Control and monitor µVision via the built-in TCP/IP interface
|
| _UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ADR_SHOWCODE | ( | int | iConnHandle, |
| iSHOWSYNC * | piShowSync | ||
| ) |
Show code at a specific address within uVision
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
| piShowSync | Pointer to a structure containing the type of code to show |
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
| 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 |
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
| 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) |
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
| 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 |
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
| 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 |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
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
| 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 |
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
| 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 |
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
| 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 |
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
| 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 |
| _UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_VTR | ( | int | iConnHandle, |
| iVTRENUM * | piVtrEnum, | ||
| AVTR * | paVTR, | ||
| int * | pVtrIndexes, | ||
| int * | pVtrCount | ||
| ) |
Enumerate the device Virtual Registers (VTRs)
| 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 |
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
| 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. |
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
| 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 |
| _UVSC_FUNC_ UVSC_STATUS UVSC_DBG_EXEC_CMD | ( | int | iConnHandle, |
| EXECCMD * | pCmd, | ||
| int | cmdLen | ||
| ) |
Execute a command (as if via the command line)
| 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. |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
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).
| _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
| 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) |
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
| 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) |
Use this function to register an ITM Channel.
| _UVSC_FUNC_ UVSC_STATUS UVSC_DBG_MEM_READ | ( | int | iConnHandle, |
| AMEM * | pMem, | ||
| int | memLen | ||
| ) |
Read memory
| 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) |
Use this function to read target memory.
| _UVSC_FUNC_ UVSC_STATUS UVSC_DBG_MEM_WRITE | ( | int | iConnHandle, |
| AMEM * | pMem, | ||
| int | memLen | ||
| ) |
Write memory
| 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) |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
| pMenuID | Pointer to a structure containing menu type and its ID |
| _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
| 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) |
| _UVSC_FUNC_ UVSC_STATUS UVSC_DBG_RESET | ( | int | iConnHandle | ) |
Reset the target
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
| address | (xU64) address to run to |
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
| 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) |
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
| 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) |
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]
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
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
| 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. |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
| count | (UINT) - number of steps to perform |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
| count | (UINT) - number of steps to perform |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
| count | (UINT) - number of steps to perform |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
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
| iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection |
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
| 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 |
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)
| 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) |
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)
| 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) |
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]
| 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. |
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.