You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+75-29Lines changed: 75 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,10 @@ The Arm CMSIS Debugger includes [pyOCD](https://pyocd.io/) for target connection
18
18
-[Peripheral Inspector](https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.peripheral-inspector) provides a structured view to device peripheral registers during debugging.
19
19
-[Serial Monitor](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-serial-monitor) to view output from and send messages to serial (UART) or TCP ports.
20
20
21
+
For RTOS awareness, we recommend installing this extension manually:
22
+
23
+
-[RTOS Views](https://marketplace.visualstudio.com/items?itemName=mcu-debug.rtos-views) provides insights into resources of popular RTOS implementations at runtime.
24
+
21
25
This extension is [free to use](https://marketplace.visualstudio.com/items/Arm.vscode-cmsis-debugger/license) and you can install it individually or as part of the [Arm Keil® Studio pack](https://marketplace.visualstudio.com/items?itemName=Arm.keil-studio-pack). For optimum debugger experience, use it with extensions from Arm (included in the Arm Keil Studio pack) and from other parties:
22
26
23
27
-[Arm CMSIS Solution](https://marketplace.visualstudio.com/items?itemName=Arm.cmsis-csolution) a user interface for _csolution projects_ that simplifies the [Run and Debug configuration](https://mdk-packs.github.io/vscode-cmsis-solution-docs/configuration.html#configure-run-and-debug).
@@ -42,7 +46,9 @@ Many features of the CMSIS Debugger extension are exposed in the **Run and Debug
42
46
43
47
1.**Start debugging** selects a configuration: _launch_ to start download/debug, _attach_ to connect with a running system.
44
48
2.**Debug Toolbar** has buttons for the most common debugging actions that control execution.
45
-
3.**Debug Statusbar** shows the configuration along with the workspace name. A color change indicates an active debug session.
49
+
3. The **Trace and Live View** shows the **LIVE WATCH** window.
50
+
4.**Debug Statusbar** shows the time spent running the application.
51
+
5. The **Debug Console** can be used to interact with the debugger on the command line.
46
52
47
53

48
54
@@ -60,10 +66,14 @@ The **Run and Debug** view provides:
60
66
61
67
Other debugger specific views or features:
62
68
63
-
-[**Disassembly**](#disassembly) shows assembly instructions and supports run control, for example with stepping and breakpoints.
69
+
-[**Live Watch**](#trace-and-live-view) offers run-time viewing of user-defined expressions, for example, variable
70
+
values.
71
+
-[**Disassembly**](#disassembly) shows assembly instructions and supports run control, for example with stepping and
72
+
breakpoints.
64
73
-[**Debug Console**](#debug-console) lists debug output messages and allows entering expressions or GDB commands.
65
74
-[**Peripherals**](#peripherals) show the device peripheral registers and allow changing their values.
66
-
-[**Serial Monitor**](#serial-monitor) uses serial or TCP communication to interact with application I/O functions (`printf`, `getc`, etc.).
75
+
-[**Serial Monitor**](#serial-monitor) uses serial or TCP communication to interact with application I/O functions
76
+
(`printf`, `getc`, etc.).
67
77
-[**CPU Time**](#cpu-time) shows execution timing and statistics of the past five breakpoints.
68
78
-[**Multi-Core Debug**](#multi-core-debug) to view and control several processors in a device.
69
79
@@ -136,8 +146,23 @@ For more control of breakpoints, use the **BREAKPOINTS** section that lists and
> You can set breakpoints anytime during your debug session. However, when setting a breakpoint while running an
152
+
> application, the target stops for a short period of time.
153
+
139
154
#### Breakpoint types
140
155
156
+
Apart from the code breakpoint, there are other breakpoint types to satisfy specific use cases.
157
+
158
+
##### Function breakpoints
159
+
160
+
Instead of placing breakpoints directly in source code, a debugger can support creating breakpoints by specifying
161
+
a function name. This is useful in situations where the source is not available but a function name is known.
162
+
163
+
To create a function breakpoint, select the + button in the **BREAKPOINTS section** header and enter the function
164
+
name. Function breakpoints are shown with a red triangle in the **BREAKPOINTS section**.
165
+
141
166
##### Conditional breakpoints
142
167
143
168
Set breakpoint conditions based on expressions, hit counts, or a combination of both.
@@ -166,6 +191,25 @@ To add a condition to an existing breakpoint:
166
191
167
192
- Edit the condition (expression, hit count, or wait for breakpoint).
168
193
194
+
> 📝 **Note:**
195
+
>
196
+
> For checking the the breakpoint condition, the target is halted for a short period of time.
197
+
198
+
##### Data breakpoints
199
+
200
+
Data breakpoints can be set from the context menu of a variable in the **WATCH section**. The Break on Value
201
+
Change/Read/Access commands add a data breakpoint that is hit when the value of the underlying variable changes/is
202
+
read/is accessed. Data breakpoints are shown with a red hexagon in the **BREAKPOINTS section** and the type of
203
+
breakpoint is shown (Write/Read/Access).
204
+
205
+

206
+
207
+
> 📝 **Note:**
208
+
>
209
+
> When hitting a data breakpoint, the program execution does not stop exactly on that line of code. Depending on the
210
+
> underlying CPU architecture, stopping can be delayed by up to 5 cycles. Use the
211
+
> [Call Stack](#call-stack) view to determine what caused the execution to stop.
212
+
169
213
##### Triggered breakpoints
170
214
171
215
A triggered breakpoint is type of conditional breakpoint that is enabled once another breakpoint is hit. They can
@@ -176,6 +220,7 @@ then, choose which other breakpoint enables the breakpoint.
176
220
177
221

178
222
223
+
<!--
179
224
##### Inline breakpoints
180
225
181
226
Inline breakpoints are only hit when the execution reaches the column associated with the inline breakpoint.
@@ -186,36 +231,16 @@ Inline breakpoints are shown inline in the editor.
186
231
187
232
Inline breakpoints can also have conditions. Editing multiple breakpoints on a line is possible through the
188
233
context menu in the editor's left margin.
189
-
190
-
##### Function breakpoints
191
-
192
-
Instead of placing breakpoints directly in source code, a debugger can support creating breakpoints by specifying
193
-
a function name. This is useful in situations where the source is not available but a function name is known.
194
-
195
-
To create a function breakpoint, select the + button in the **BREAKPOINTS section** header and enter the function
196
-
name. Function breakpoints are shown with a red triangle in the **BREAKPOINTS section**.
197
-
198
-
##### Data breakpoints
199
-
200
-
If a debugger supports data breakpoints, they can be set from the context menu of a variable in the **WATCH section**.
201
-
The Break on Value Change/Read/Access commands add a data breakpoint that is hit when the value of the underlying
202
-
variable changes/is read/is accessed. Data breakpoints are shown with a red hexagon in the **BREAKPOINTS section**.
203
-
204
-

205
-
206
-
> 📝 **Note:**
207
-
>
208
-
> When hitting a data breakpoint, the program execution does not stop exactly on that line of code. Depending on the
209
-
> underlying CPU architecture, stopping can be delayed by up to 5 cycles. Use the
210
-
> [Call Stack](#call-stack) view to determine what caused the execution to stop.
234
+
-->
211
235
212
236
##### Logpoints
213
237
214
-
A logpoint is a variant of a breakpoint that does not interrupt the debugger, but instead logs a message to the
215
-
debug console. Logpoints can help you save time by not having to add or remove logging statements in your code.
238
+
A logpoint pauses the program execution for a short period of time, sends a message to the debug console, and then
239
+
continues with the application. Logpoints can help you save time by not having to add or remove logging statements in
240
+
your code.
216
241
217
242
A logpoint is represented by a diamond-shaped icon. Log messages are plain text, but can also include expressions to be
218
-
evaluated within curly braces ('{}').
243
+
evaluated within curly braces (`{}`).
219
244
220
245
To add a logpoint, right-click in the editor left margin and select Add Logpoint, or use the
221
246
**Debug: Add Logpoint...** command in the Command Palette (**Ctrl/Cmd + Shift + p**).
@@ -242,6 +267,26 @@ Most Arm Cortex-M processors (except Cortex-M0/M0+/M23) include a `DWT->CYCCNT`
242
267
> -`DWT->CYCCNT` is a 32-bit register incremented with [`SystemCoreClock`](https://arm-software.github.io/CMSIS_6/latest/Core/group__system__init__gr.html) frequency. The time calculation copes with one overflow between program stops. Multiple overflows between program stops deliver wrong time information.
243
268
> - Each processor in a multi-processor system has and independent `DWT->CYCCNT` register.
244
269
270
+
### Trace and Live view
271
+
272
+
The **Trace and Live View**
273
+

274
+
(available from the VS Code Activty Bar) currently shows the **LIVE WATCH**. You can add expressions to this view that
275
+
are updated while the application is running on your target.
276
+
277
+

278
+
279
+
You can add expressions to this view by:
280
+
281
+
1. Pressing the three dots to the right.
282
+
2. Pressing the `+` sign.
283
+
3. Using the context menu item **Add to Live Watch** in:
284
+
- source code files.
285
+
- the **Watch** window.
286
+
- the **Variables** window.
287
+
4. From the **Trace and Live View**, you can show an expression in the Memory Inspector. Right-click on the expression
288
+
and select **Show in Memory Inspector**.
289
+
245
290
### PERIPHERALS
246
291
247
292
The **PERIPHERALS** view shows the device peripheral registers and allows to change their values. It uses the CMSIS-SVD files that are provided by silicon vendors and distributed as part of the CMSIS Device Family Packs (DFP).
@@ -284,7 +329,8 @@ The command **Open Disassembly View** (available from [command palette](https://
284
329
### RTOS Views
285
330
286
331
For RTOS awareness, the [RTOS Views](https://marketplace.visualstudio.com/items?itemName=mcu-debug.rtos-views)
287
-
extension is used. Currently, it supports FreeRTOS, Zephyr, embOS,and various flavors of uC/OS. Keil RTX5 will be added soon.
332
+
extension needs to be added to CS Code. This extension supports a wide range of real-time operating systems, such as
333
+
FreeRTOS, Zephyr, embOS,and Keil RTX5.
288
334
289
335

0 commit comments