-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rust10.html
369 lines (203 loc) · 30.5 KB
/
Rust10.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- Chrome, Firefox OS and Opera Status Bar Color -->
<meta name="theme-color" content="#FFFFFF">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css">
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.19.0/themes/prism.min.css">
<link rel="stylesheet" type="text/css" href="css/SourceSansPro.css">
<link rel="stylesheet" type="text/css" href="css/theme.css">
<link rel="stylesheet" type="text/css" href="css/notablog.css">
<link rel="stylesheet" type="text/css" href="css/CustomSetting.css">
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🥥</text></svg>">
<style>
:root {
font-size: 20px;
}
</style>
<title>使用 USB-JTAG/probe-rs 调试应用 | 413’s Website</title>
<meta property="og:type" content="blog">
<meta property="og:title" content="使用 USB-JTAG/probe-rs 调试应用">
<meta property="og:image" content="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🦀</text></svg>">
<style>
.DateTagBar {
margin-top: 1.0rem;
}
</style>
</head>
<body>
<nav class="Navbar">
<a href="index.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🥥</text></svg>"></span>
<span>Home</span>
</div>
</a>
<span class="Navbar__Delim">·</span>
<a href="blog-collection.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🥅</text></svg>"></span>
<span>blog mark</span>
</div>
</a>
<span class="Navbar__Delim">·</span>
<a href="Note.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🎶</text></svg>"></span>
<span>Note</span>
</div>
</a>
<span class="Navbar__Delim">·</span>
<a href="reference.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>😷</text></svg>"></span>
<span>杂项</span>
</div>
</a>
<span class="Navbar__Delim">·</span>
<a href="About.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>😀</text></svg>"></span>
<span>About</span>
</div>
</a>
</nav>
<header class="Header">
<div class="Header__Spacer Header__Spacer--NoCover">
</div>
<div class="Header__Icon">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🦀</text></svg>"></span>
</div>
<h1 class="Header__Title">使用 USB-JTAG/probe-rs 调试应用</h1>
<div class="DateTagBar">
<span class="DateTagBar__Item DateTagBar__Date">Posted on Mon, Sep 2, 2024</span>
<span class="DateTagBar__Item DateTagBar__Tag DateTagBar__Tag--purple">
<a href="tag/Rust.html">Rust</a>
</span>
<span class="DateTagBar__Item DateTagBar__Tag DateTagBar__Tag--red">
<a href="tag/单片机.html">单片机</a>
</span>
</div>
</header>
<div id="content-html"></div>
<article id="https://www.notion.so/2aa2bc468bf944c2b62da2ffc6dbd646" class="PageRoot PageRoot--FullWidth"><div id="https://www.notion.so/9fa8d1953602403582ed5b5fd4da8033" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">ESP32-S3 开发版一般有两个 USB 接口,一般标记为 UART 和 USB,后者是支持 USB-Serial-JTAG 调试的接口,该接口包含两个 USB 设备:</mark></span></span></p></div><ol class="NumberedListWrapper"><li id="https://www.notion.so/635f46e580d0422c92890e96730bb49a" class="NumberedList" value="1"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">USB-CDC-ACM:PC 识别为 USB 串口设备,可以用于下载固件和打印芯片输出的日志;</mark></span></span></li><li id="https://www.notion.so/46ffeee9980b4472aecd9eb1b58c0054" class="NumberedList" value="2"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">JTAG 设备:可以被用来进行 JTAG 调试;</mark></span></span></li></ol><h3 id="https://www.notion.so/7c9fed20f014411ea3b3bd2080f8064d" class="ColorfulBlock ColorfulBlock--ColorDefault Heading Heading--3"><a class="Anchor" href="#https://www.notion.so/7c9fed20f014411ea3b3bd2080f8064d"><svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">查看 MaxcOS USE-Serial-JTAG 设备信息:</mark></span></span></h3><div id="https://www.notion.so/447c64731b5f449c832c1449fb221ad0" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"></span></p></div><pre id="https://www.notion.so/bc04d87805be4a8bab8227f1bd19447c" class="Code Code--NoWrap"><code><span class="SemanticStringArray"><span class="SemanticString"><span>zj@a:~/docs$ system_profiler SPUSBDataType <span class="token operator">|</span> <span class="token function">grep</span> <span class="token parameter variable">-A</span> <span class="token number">11</span> <span class="token string">"USB JTAG"</span>
USB JTAG/serial debug unit:
Product ID: 0x1001
Vendor ID: 0x303a
Version: <span class="token number">1.01</span>
Serial Number: 3C:84:27:04:FE:18
Speed: Up to <span class="token number">12</span> Mb/s
Manufacturer: Espressif
Location ID: 0x02100000 / <span class="token number">2</span>
Current Available <span class="token punctuation">(</span>mA<span class="token punctuation">)</span>: <span class="token number">500</span>
Current Required <span class="token punctuation">(</span>mA<span class="token punctuation">)</span>: <span class="token number">500</span>
Extra Operating Current <span class="token punctuation">(</span>mA<span class="token punctuation">)</span>: <span class="token number">0</span></span></span></span></code></pre><div id="https://www.notion.so/7d55828e61674ea1a3eb50e25294e6fc" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">对应的设备名称为 /dev/tty.usbmodem* 或 /dev/cu.usbmodem*:</mark></span></span></p></div><div id="https://www.notion.so/8b0789ca21394ffe93aedd6142361d2a" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"></span></p></div><pre id="https://www.notion.so/04403eef28fe4f37ab9086aa3754bef8" class="Code Code--NoWrap"><code><span class="SemanticStringArray"><span class="SemanticString"><span>zj@a:~/docs$ <span class="token function">ls</span> <span class="token parameter variable">-l</span> /dev/*.usbmodem*
crw-rw-rw- <span class="token number">1</span> root <span class="token number">9</span>, <span class="token number">11</span> <span class="token number">5</span> <span class="token number">10</span> <span class="token number">21</span>:38 /dev/cu.usbmodem2101
crw-rw-rw- <span class="token number">1</span> root <span class="token number">9</span>, <span class="token number">10</span> <span class="token number">5</span> <span class="token number">10</span> <span class="token number">20</span>:16 /dev/tty.usbmodem2101</span></span></span></code></pre><div id="https://www.notion.so/6c0f78f0fb9e4cb3aafa067a14a6c20c" class="Image Image--PageWidth"><figure><a href="#?width=1088"><img src="#?width=1088" style="width:100%"/></a><figcaption><span class="SemanticStringArray"></span></figcaption></figure></div><div id="https://www.notion.so/8f9812c3c7e742aa9d269e93f98d1c65" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"></span></p></div><pre id="https://www.notion.so/0169e92fbd254c81b24c24a6aafdf8e1" class="Code Code--NoWrap"><code><span class="SemanticStringArray"><span class="SemanticString"><span>zj@a:~/docs$ espflash board-info
<span class="token punctuation">[</span><span class="token number">2024</span>-05-10T13:38:06Z INFO <span class="token punctuation">]</span> Detected <span class="token number">2</span> serial ports
<span class="token punctuation">[</span><span class="token number">2024</span>-05-10T13:38:06Z INFO <span class="token punctuation">]</span> Ports <span class="token function">which</span> match a known common dev board are highlighted
<span class="token punctuation">[</span><span class="token number">2024</span>-05-10T13:38:06Z INFO <span class="token punctuation">]</span> Please <span class="token keyword">select</span> a port
<span class="token punctuation">[</span><span class="token number">2024</span>-05-10T13:38:19Z INFO <span class="token punctuation">]</span> Serial port: <span class="token string">'/dev/cu.usbmodem2101'</span>
<span class="token punctuation">[</span><span class="token number">2024</span>-05-10T13:38:19Z INFO <span class="token punctuation">]</span> Connecting<span class="token punctuation">..</span>.
<span class="token punctuation">[</span><span class="token number">2024</span>-05-10T13:38:21Z INFO <span class="token punctuation">]</span> Using flash stub
Chip type: esp32s3 <span class="token punctuation">(</span>revision v0.2<span class="token punctuation">)</span>
Crystal frequency: <span class="token number">40</span> MHz
Flash size: 16MB
Features: WiFi, BLE
MAC address: 3c:84:27:04:fe:18
<span class="token comment"># 使用 probe-rs 工具</span>
zj@a:~/docs$ probe-rs info
Probing target via JTAG
WARN probe_rs::probe::espusbjtag: More than one TAP detected, defaulting to tap0
No DAP interface was found on the connected probe. ARM-specific information cannot be printed.
Error <span class="token keyword">while</span> reading RISC-V info: Connected target is not a RISC-V device.
Xtensa Chip:
IDCODE: 00120034e5
Version: <span class="token number">1</span>
Part: <span class="token number">8195</span>
Manufacturer: <span class="token number">626</span> <span class="token punctuation">(</span>Tensilica<span class="token punctuation">)</span>
Probing target via SWD
Error identifying target using protocol SWD: Probe does not support SWD
zj@a:~/docs$</span></span></span></code></pre><div id="https://www.notion.so/3467c0ef86b148e4ba870947d340a9b8" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">由于 ESP32-S3 自带 USB-Serial-JTAG Controller,故不需要单独的外接 debug probe 硬件来进行烧写或调试。确认方法:</mark></span></span></p></div><div id="https://www.notion.so/445c00a489c04981944238ba9e347ef4" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"></span></p></div><pre id="https://www.notion.so/d2bba21163e44a158af7505e767b5e22" class="Code Code--NoWrap"><code><span class="SemanticStringArray"><span class="SemanticString"><span><span class="token function">cargo</span> espflash board-info
<span class="token comment"># or </span>
espflash board-info</span></span></span></code></pre><div id="https://www.notion.so/f843c6815ced49c5bc0fb87c9096b75b" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">ESP32-S3 支持使用 probe-rs 或 ESP32 fork 的 OpenCDC 进行 JTAG 调试。</mark></span></span></p></div><div id="https://www.notion.so/d58160f3917c4437ab7c65f346ae8c8f" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">probe-rs 是一个使用 JTAG 接口进行芯片 flash 烧写和调试的工具,支持 RISC-V/ARM/Xtensor。</mark></span></span></p></div><div id="https://www.notion.so/5605126c0f3346be87b2cc945b11c47d" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">安装 probe-rs 和相关工具:</mark></span></span></p></div><div id="https://www.notion.so/72ac3314215f41d5a691fe9f23ebce3d" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">Copy</mark></span></span></p></div><pre id="https://www.notion.so/b8f679dfda25400d96bff7bc9385646f" class="Code Code--NoWrap"><code><span class="SemanticStringArray"><span class="SemanticString"><span>zj@a:~/docs$ <span class="token function">cargo</span> <span class="token function">install</span> probe-rs <span class="token parameter variable">--features</span> cli
Installed package <span class="token variable"><span class="token variable">`</span>probe-rs v0.23.0<span class="token variable">`</span></span> <span class="token punctuation">(</span>executables <span class="token variable"><span class="token variable">`</span>cargo-embed<span class="token variable">`</span></span>, <span class="token variable"><span class="token variable">`</span>cargo-flash<span class="token variable">`</span></span>, <span class="token variable"><span class="token variable">`</span>probe-rs<span class="token variable">`</span></span><span class="token punctuation">)</span></span></span></span></code></pre><div id="https://www.notion.so/e12b2fe24b934425a0e03960637cd521" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">probe-rs 最重要的是 run 命令,可以集成到 cargo run 中:.cargo/config.toml</mark></span></span></p></div><div id="https://www.notion.so/ff5b0f778b9247b19088648427906d84" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">Copy</mark></span></span></p></div><pre id="https://www.notion.so/18bc9050278c40d4868f6a1a876eeb46" class="Code Code--NoWrap"><code><span class="SemanticStringArray"><span class="SemanticString"><span><span class="token punctuation">[</span>target<span class="token punctuation">.</span><architecture-triple><span class="token punctuation">]</span>
<span class="token key property">runner</span> <span class="token punctuation">=</span> <span class="token string">'probe-rs run --chip esp32s3'</span></span></span></span></code></pre><div id="https://www.notion.so/0999159015d4401582502f08d299d1c5" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">Now you can execute </mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"><code class="SemanticString__Fragment SemanticString__Fragment--Code">cargo run</code></mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"> in your project as you would for any native binaries and you will receive </mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"><code class="SemanticString__Fragment SemanticString__Fragment--Code">RTT and defmt logs</code></mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"> in that very same console as if you wrote to standard out.</mark></span></span></p></div><ul class="BulletedListWrapper"><li id="https://www.notion.so/9aeb70d4e11a4b00952b1e3c2690c5d5" class="BulletedList"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">It makes it possible to </mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"><code class="SemanticString__Fragment SemanticString__Fragment--Code">flash, start and print logs</code></mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"> from your target with a simple cargo run.</mark></span></span></li></ul><div id="https://www.notion.so/f38700e807d24044891b509d15e3afce" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"><code class="SemanticString__Fragment SemanticString__Fragment--Code">probe-rs attach</code></mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"> works exactly like </mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"><code class="SemanticString__Fragment SemanticString__Fragment--Code">probe-rs run</code></mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"> except that it </mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"><code class="SemanticString__Fragment SemanticString__Fragment--Code">does not issue a reset and does not flash</code></mark></span><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault"> the target on connecting to preserve the currently running state. This is great for inspecting a target - where you might not even have knowledge of the firmware - without altering its state.</mark></span></span></p></div><div id="https://www.notion.so/c91ea375fa6e4719bd928ac169f41f90" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">probe-rs 实现了 DAP 协议,可以直接在 VS Code 中调试代码。</mark></span></span></p></div><div id="https://www.notion.so/2ef576555dd14c96bbe1cf12062d06b9" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">probe-rs 和 DAP 集成:</mark></span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://probe.rs/docs/tools/debugger/"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">https://probe.rs/docs/tools/debugger/</mark></a></span></span></p></div><ol class="NumberedListWrapper"><li id="https://www.notion.so/1e7bbaba41554ad085ae84c17737c97b" class="NumberedList" value="1"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">下载 probe-vs 的 vs-code 插件:页面右侧 Resouces 下的 Download Extension </mark></span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://marketplace.visualstudio.com/items?itemName=probe-rs.probe-rs-debugger"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">https://marketplace.visualstudio.com/items?itemName=probe-rs.probe-rs-debugger</mark></a></span></span></li><li id="https://www.notion.so/d4cd1bdb9cf6464d8c030b6be5c76a6c" class="NumberedList" value="2"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">解压 vsix 文件到 emacs 目录,参考:</mark></span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://github.com/svaante/dape"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">https://github.com/svaante/dape</mark></a></span></span></li><li id="https://www.notion.so/988580d408474d26868991f2003f53d4" class="NumberedList" value="3"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">配置 dape;</mark></span></span></li></ol><div id="https://www.notion.so/832c7e25138a4f19baa81817b8cb0a20" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">probe-rs 示例:</mark></span></span></p></div><div id="https://www.notion.so/100fc3f52a8880bf94a5e535676fc8cf" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"></span></p></div><pre id="https://www.notion.so/22094f8d84f64b069982f3da36566d39" class="Code Code--NoWrap"><code><span class="SemanticStringArray"><span class="SemanticString"><span>zj@a:~/code/slint/examples$ <span class="token function">ls</span> <span class="token parameter variable">-l</span> /dev/*usbmodem*
crw-rw-rw- <span class="token number">1</span> root <span class="token number">9</span>, <span class="token number">9</span> <span class="token number">5</span> <span class="token number">11</span> <span class="token number">17</span>:38 /dev/cu.usbmodem2101
crw-rw-rw- <span class="token number">1</span> root <span class="token number">9</span>, <span class="token number">8</span> <span class="token number">5</span> <span class="token number">11</span> <span class="token number">17</span>:38 /dev/tty.usbmodem2101
zj@a:~/code/slint/examples$ probe-rs list
The following debug probes were found:
<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>: ESP JTAG <span class="token punctuation">(</span>VID: 303a, PID: <span class="token number">1001</span>, Serial: 3C:84:27:04:FE:18, EspJtag<span class="token punctuation">)</span>
zj@a:~/code/slint/examples$ probe-rs info
Probing target via JTAG
WARN probe_rs::probe::espusbjtag: More than one TAP detected, defaulting to tap0
No DAP interface was found on the connected probe. ARM-specific information cannot be printed.
Error <span class="token keyword">while</span> reading RISC-V info: Connected target is not a RISC-V device.
Xtensa Chip:
IDCODE: 00120034e5
Version: <span class="token number">1</span>
Part: <span class="token number">8195</span>
Manufacturer: <span class="token number">626</span> <span class="token punctuation">(</span>Tensilica<span class="token punctuation">)</span>
Probing target via SWD
Error identifying target using protocol SWD: Probe does not support SWD
zj@a:~/code/slint/examples$ probe-rs chip list <span class="token operator">|</span><span class="token function">grep</span> esp
esp32c6
esp32c6
esp32s2
esp32s2
esp32h2
esp32h2
esp32s3
esp32s3
esp32
esp32-3.3v
esp32c2
esp32c2
esp32c3
esp32c3
esp32c6_lp
esp32c6_lp
zj@a:~/code/slint/examples$ probe-rs chip info esp32s3
esp32s3
Cores <span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span>:
- cpu0 <span class="token punctuation">(</span>Xtensa<span class="token punctuation">)</span>
NVM: 0x00000000<span class="token punctuation">..</span>0x04000000 <span class="token punctuation">(</span><span class="token number">64.00</span> MiB<span class="token punctuation">)</span>
RAM: 0x3fc88000<span class="token punctuation">..</span>0x3fcf0000 <span class="token punctuation">(</span><span class="token number">416.00</span> KiB<span class="token punctuation">)</span>
RAM: 0x3fcf0000<span class="token punctuation">..</span>0x3fd00000 <span class="token punctuation">(</span><span class="token number">64.00</span> KiB<span class="token punctuation">)</span>
RAM: 0x40370000<span class="token punctuation">..</span>0x40378000 <span class="token punctuation">(</span><span class="token number">32.00</span> KiB<span class="token punctuation">)</span>
RAM: 0x40378000<span class="token punctuation">..</span>0x403e0000 <span class="token punctuation">(</span><span class="token number">416.00</span> KiB<span class="token punctuation">)</span>
NVM: 0x42000000<span class="token punctuation">..</span>0x44000000 <span class="token punctuation">(</span><span class="token number">32.00</span> MiB<span class="token punctuation">)</span>
NVM: 0x3c000000<span class="token punctuation">..</span>0x3e000000 <span class="token punctuation">(</span><span class="token number">32.00</span> MiB<span class="token punctuation">)</span></span></span></span></code></pre><ul id="https://www.notion.so/c9b9fb022d03430e92a4c150ece327d9" class="ColorfulBlock ColorfulBlock--ColorGray TableOfContents"><li class="TableOfContents__Item"><a href="#https://www.notion.so/7c9fed20f014411ea3b3bd2080f8064d"><div style="margin-left:0px"><span class="SemanticStringArray"><span class="SemanticString"><mark class="SemanticString__Fragment SemanticString__Fragment--HighlightedColor SemanticString__Fragment--ColorDefault">查看 MaxcOS USE-Serial-JTAG 设备信息:</mark></span></span></div></a></li></ul></article>
<aside class="Aside">
<a href="#content-html"><div id="up">👆</div></a>
<a href="#message-board"><div id="down">👇</div></a>
</aside>
<div id="message-board"></div>
<script src="https://utteranc.es/client.js"
repo="syx-413/syx-413.github.io"
issue-term="pathname"
theme="boxy-light"
crossorigin="anonymous"
async>
</script>
<footer class="Footer">
<div>
© 413’s Website 2020~2024
</div>
<div>
·
</div>
<div>
Powered by
<a href="https://github.com/syx-413" target="_blank" rel="noopener noreferrer"> notablog</a>.
</div>
</footer>
</body>
</html>