Once you have selected your debug instrument, you are ready to start debugging. The debugging features described in this section are available for all hardware configurations: Simulator, DVP2, DVP3, EMU2B (HDS2), ICD and EMU3 emulators and STice. The following sections tell you about:
● Section 5.1: Selecting the debug instrument ● Section 5.2: Configuring your target MCU ● Section 5.3: Running an application ● Section 5.4: Editor debug actions ● Section 5.5: Disassembly window ● Section 5.6: Online assembler ● Section 5.7: Memory window ● Section 5.8: Instruction breakpoints ● Section 5.9: Data breakpoints ● Section 5.12: Watch window ● Section 5.10: Call stack window ● Section 5.11: Local variables window ● Section 5.13: Core registers window ● Section 5.14: MSCI tools window ● Section 5.15: Symbols browser
● Section 5.16: Peripheral registers window ● Section 5.17: Memory trace window ● Section 5.18: Online commands
● Section 5.19: Limitations and discrepancies
For other features that are specific to your debug instrument refer to:
● Section 6: Simulator features on page 202 for software simulation without a debug instrument
● Section 7: In-circuit debugging on page 223 for EMU3 with ICC add-on
● Section 8: DVP and EMU2 (HDS2) emulator features on page 237 for all DVP and EMU2 emulators
● Section 10: EMU3 emulator features on page 284 — for EMU3 emulators
5.1
Selecting the debug instrument
Your choice of target microcontroller and debugging hardware determine what features you will have access to when debugging. In the Debug Instrument Settings window you can: ● Identify your debug instrument and the port it is connected to
● and Add communication ports
5.1.1 Identify your debug instrument
To identify your debug instrument for STVD:
1. Select Debug Instrument>Target Settings from the main menu bar.
Figure 103. Identify debug instrument and connection
2. Select the appropriate option for your debugging hardware in the Debug Instrument Selection list box. Table 58 describes the available options.
Table 58. Debug instrument types
Selection in STVD Applicable development tools
DVP2 If you have an ST7-DVP2 series emulator
DVP3 If you have an ST7-DVP3 series emulator
EMU3 If you have an ST7-EMU3 series emulator
EMU2B (HDS2) If you have an ST7-EMU2 (also known as HDS2) series emulator. ICD (ST Micro Connect or
DVP3)
If you are using an ST7-ICD (STMC) debugger, the EMU3 emulator with ICC add-on, or the DVP3 emulator for in-circuit debugging.
ICD RLINK If you are using the Raisonance RLink for in-circuit debugging over ICC.
ICD STICK If you are using the ST7 STICK for in-circuit debugging over ICC. SIMULATOR If you are not using any debugging hardware.
3. If the selected debug instrument is SWIM RLink or SWIM STice, then you can optionally enable the Hot Plug Start Debug checkbox to start a debug session in hot plug mode.
Note that this option is disabled when you start a debug session from an open workspace in STVD.
When you start a debug session in hot plug mode, a connection to the MCU is established while it is running, allowing you to see the state of the memory. For more information on debugging in hot plug mode, refer to Section 7.4: In-circuit debugging in hot plug mode (SWIM only) on page 233.
4. In the Target Port Selection list box, select the communication port (parallel, USB or Ethernet) that your debugging hardware is connected to.
The option usb://usb is the automatic USB search option, whereas usb://hti1, hti2,..., hti128, are used to indicate a specific USB port. Ethernet connections are listed by the IP address for the device. If the connection that you want to use is not in the list, you can add it by clicking on the Add button. (see Section 5.1.2: Add communication ports).
Note: When Simulator (SIM) is selected as the target, Port Selection is not available because Simulator is a software debugging tool.
5. Click on OK, to confirm your settings and close the Debug Instrument Settings
window.
5.1.2
Add communication ports
To access the window for adding hardware connections:
1. Select Debug Instrument>Target Settings, then click on the Add button in the Debug Instrument Settings window.
This will open the Add Connection dialog box where you can specify USB or Ethernet connections to add to the list of options in the Debug Instrument Settings window. 2. Select the type of connection (USB or Ethernet) that you would like to add from the
Connection Type list box.
3. Enter the necessary information in the appropriate fields. For Ethernet connections:
● Type the IP address (four sets of three numbers) that is assigned to your debug instrument in the IP Address field (see Figure 104). Information about assigning an IP address to your debug instrument is provided in the Connectivity section of your hardware user manual for the debug instruments that support Ethernet connections. ● Type a description (up to 40 characters) in the Comments field.
STice If you are using the STice as a plain emulator.
SWIM RLink If you are using the Raisonance RLink for in-circuit debugging over SWIM.
SWIM STice If you are using the STice advanced emulation system in ICD configuration.
Table 58. Debug instrument types (continued)
Figure 104. Add an Ethernet connection
For USB connections, either:
● Enter the number for the USB port (an integer between 1 and 128) in the Please Insert STMC ID field, to create an option that identifies a specific USB port (see Figure 105), ● or place a checkmark in the Automatic USB Connection Search checkbox to create
a connection option that automatically searches all USB ports for your debug instrument (usb://usb).
Figure 105. Add a USB connection
This returns you to the Debug Instrument Settings window. The new connection option has been added to those in the Target Port Selection list box and the new option is selected automatically.