-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild_run.html
More file actions
310 lines (283 loc) · 15.9 KB
/
build_run.html
File metadata and controls
310 lines (283 loc) · 15.9 KB
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
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="img/favicon.ico" />
<title>Build and run - Arm Keil Studio for VS Code</title>
<link rel="stylesheet" href="css/theme.css" />
<link rel="stylesheet" href="css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />
<link href="css/extra.css" rel="stylesheet" />
<script>
// Current page data
var mkdocs_page_name = "Build and run";
var mkdocs_page_input_path = "build_run.md";
var mkdocs_page_url = null;
</script>
<!--[if lt IE 9]>
<script src="js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Arm Keil Studio for VS Code
</a>
<div class="version">
1.66.0
</div><div role="search">
<form id ="rtd-search-form" class="wy-form" action="./search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul>
<li class="toctree-l1"><a class="reference internal" href="index.html">Home</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="userinterface.html">User interface</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="create_app.html">Work with CMSIS solutions</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="zephyr.html">Work with Zephyr applications</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="manage_settings.html">Manage solutions</a>
</li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="#">Build and run</a>
<ul class="current">
<li class="toctree-l2"><a class="reference internal" href="#build-output">Build output</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#load-and-run">Load and Run</a>
<ul>
<li class="toctree-l3"><a class="reference internal" href="#check-target-information">Check target information</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#download-and-run-the-application">Download and run the application</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#monitor-printf-messages">Monitor printf messages</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="debug.html">Debug</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="importuv.html">Import uVision projects</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="runexternal.html">Run external tools</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tipsandtricks.html">Tips and tricks</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="reldocs.html">Related documentation</a>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="featureroadmap.html">Features and roadmap</a>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="Mobile navigation menu">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Arm Keil Studio for VS Code</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Docs"></a></li>
<li class="breadcrumb-item active">Build and run</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/MDK-Packs/vscode-cmsis-solution-docs/edit/main/docs/build_run.md" class="icon icon-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div class="section" itemprop="articleBody">
<h1 id="build">Build</h1>
<p>Before you can download the application on your target device, you need to build it. There are various ways to trigger
a build:</p>
<ul>
<li>
<p>In the <strong>Explorer</strong> view <img alt="Explorer icon" src="images/ExplorerView.png" />, right-click the <code>*.csolution.yml</code> file and
select <strong>Build solution</strong>.</p>
</li>
<li>
<p>In the <strong>CMSIS</strong> view <img alt="CMSIS view" src="images/CMSISView.png" />, click <img alt="Build icon" src="images/build-icon.png" />.</p>
</li>
</ul>
<p>Continue to <a href="#load-and-run">load and run</a> the solution.</p>
<h2 id="build-output">Build output</h2>
<p>After you initiate the build process, a Terminal opens and displays the build operation:</p>
<pre><code class="language-txt">🔄 Execute: cbuild /Users/user/Git/Org/Blinky_PL10-CNANO/Blinky.csolution.yml --target all --active PIC32CM6408PL10048 --packs --skip-convert
Building CMake target 'Blinky.Debug+PIC32CM6408PL10048'
Using compiler: AC6 V6.24.0
[20/20] Linking C executable /Users/user/Git/Org/Blinky_PL10-CNANO/out/Blinky/PIC32CM6408PL10048/Debug/Blinky.axf
Program Size: Code=24128 RO-data=1304 RW-data=196 ZI-data=4652
[1/1] cd /Users/user/Git/Org/Blinky_PL10-CNANO/tmp/1 &...Git/Org/Blinky_PL10-CNANO/out/Blinky/PIC32CM6408PL10048/Debug
✅ Completed: cbuild succeed with exit code 0
</code></pre>
<p>The output directory usually contains an ELF (<code>.axf</code>) and a HEX (<code>.hex</code>) file.</p>
<p>To learn about the solution structure, refer to
<a href="https://open-cmsis-pack.github.io/cmsis-toolbox/build-overview/">CMSIS-Toolbox documentation</a></p>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>You can (re-)run the build command also manually in a VS Code <strong>Terminal</strong> window. This enables you to add further
options (for example <code>--debug</code>) to it.</p>
</div>
<h2 id="load-and-run">Load and Run</h2>
<h3 id="check-target-information">Check target information</h3>
<p>In the <strong>CMSIS</strong> view, click <img alt="More options" src="images/more-actions-icon.png" /> and then select "Target Information" to
check that your target is connected.</p>
<p><img alt="Target Information" src="images/target-information.png" /></p>
<p>In the <strong>Terminal</strong>, the result of the <code>pyocd list</code> command is shown:</p>
<pre><code class="language-sh"> * Executing task: pyocd list --cbuild-run /Users/user/Blinky/Blinky+B-U585I-IOT02A.cbuild-run.yml
# Probe/Board Unique ID Target
-------------------------------------------------------------------
0 STLINK-V3 001000254D46501220383832 ✖︎ stm32u585aiix
B-U585I-IOT02A
</code></pre>
<div class="admonition note">
<p class="admonition-title">Note</p>
<ul>
<li>Various debug adapters are supported. Select them using the <a href="manage_settings.html#debug-adapter">manage solutions</a> dialog.
The <a href="debug.html#configure-run-and-debug">configure run and debug</a> chapter explains the details.</li>
<li>If your debug adapter is not shown, make sure that all
<a href="debug.html#debug-adapter-support">drivers are installed</a> and that the target is connected to the PC.</li>
</ul>
</div>
<h3 id="download-and-run-the-application">Download and run the application</h3>
<p>In the <strong>CMSIS</strong> view, click <img alt="Run icon" src="images/run-icon.png" />. This executes the "Load & Run application" command
that executes the commands <code>CMSIS Load</code> and <code>CMSIS Run</code> from the <code>tasks.json</code> file. This flashes the project onto the
target and issues a reset to start the application.</p>
<p>To verify that the step has run correctly, check the <strong>Terminal</strong> output:</p>
<pre><code class="language-text"> * Executing task: pyocd load --probe stlink: --cbuild-run /Users/user/B-U585-Board/Blinky/Blinky+B-U585I-IOT02A.cbuild-run.yml
0000712 I Loading /Users/user/B-U585-Board/Blinky/out/Blinky/B-U585I-IOT02A/Debug/Blinky.axf [load_cmd]
[==================================================] 100%
0003015 I Erased 49152 bytes (6 sectors), programmed 49152 bytes (48 pages), skipped 0 bytes (0 pages) at 20.96 kB/s [loader]
* Terminal will be reused by tasks, press any key to close it.
* Executing task: pyocd gdbserver --probe stlink: --connect attach --persist --reset-run --cbuild-run /Users/user/B-U585-Board/Blinky/Blinky+B-U585I-IOT02A.cbuild-run.yml
0000251 I Target type is stm32u585aiix [board]
0000434 I DP IDR = 0x0be12477 (v2 MINDP rev0) [dap]
0000511 I debugvar 'DbgMCU_AHB1_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_AHB3_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_APB1H_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_APB1L_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_APB2_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_APB3_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_CR' = 0x6 (6) [cbuild_run]
0000511 I debugvar 'DoOptionByteLoading' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'TraceClk_Pin' = 0x40002 (262146) [cbuild_run]
0000511 I debugvar 'TraceD0_Pin' = 0x20009 (131081) [cbuild_run]
0000511 I debugvar 'TraceD1_Pin' = 0x2000a (131082) [cbuild_run]
0000511 I debugvar 'TraceD2_Pin' = 0x40005 (262149) [cbuild_run]
0000511 I debugvar 'TraceD3_Pin' = 0x2000c (131084) [cbuild_run]
0000516 I AHB5-AP#0 IDR = 0x14770015 (AHB5-AP var1 rev1) [discovery]
0000517 I AHB5-AP#0 Class 0x1 ROM table #0 @ 0xe00fe000 (designer=020:ST part=482) [rom_table]
0000518 I [0]<e00ff000:ROM class=1 designer=43b:Arm part=4c9> [rom_table]
0000518 I AHB5-AP#0 Class 0x1 ROM table #1 @ 0xe00ff000 (designer=43b:Arm part=4c9) [rom_table]
0000520 I [0]<e000e000:SCS M33 class=9 designer=43b:Arm part=d21 devtype=00 archid=2a04 devid=0:0:0> [rom_table]
0000520 I [1]<e0001000:DWT M33 class=9 designer=43b:Arm part=d21 devtype=00 archid=1a02 devid=0:0:0> [rom_table]
0000521 I [2]<e0002000:BPU M33 class=9 designer=43b:Arm part=d21 devtype=00 archid=1a03 devid=0:0:0> [rom_table]
0000522 I [3]<e0000000:ITM M33 class=9 designer=43b:Arm part=d21 devtype=43 archid=1a01 devid=0:0:0> [rom_table]
0000523 I [5]<e0041000:ETM M33 class=9 designer=43b:Arm part=d21 devtype=13 archid=4a13 devid=0:0:0> [rom_table]
0000524 I [6]<e0042000:CTI M33 class=9 designer=43b:Arm part=d21 devtype=14 archid=1a14 devid=40800:0:0> [rom_table]
0000524 I [1]<e0040000:TPIU M33 class=9 designer=43b:Arm part=d21 devtype=11 archid=0000 devid=ca1:0:0> [rom_table]
0000525 I [2]<e0044000:DBGMCU class=15 designer=020:ST part=000> [rom_table]
0000533 I CPU core #0: Cortex-M33 r0p4, v8.0-M architecture [cortex_m]
0000533 I Extensions: [DSP, FPU, FPU_V5, MPU] [cortex_m]
0000533 I FPU present: FPv5-SP-D16-M [cortex_m]
0000534 I Setting core #0 (Cortex-M33) default reset sequence to ResetSystem [cbuild_run]
0000534 I 4 hardware watchpoints [dwt]
0000537 I 8 hardware breakpoints, 1 literal comparators [fpb]
0000662 I Semihost server started on port 4444 (core 0) [server]
0000718 I GDB server started on port 3333 (core 0) [gdbserver]
</code></pre>
<p>When running, <img alt="Run button" src="images/run-icon.png" /> changes to <img alt="Stop button" src="images/stop-button.png" />. Use it to stop
the GDB session anytime.</p>
<div class="admonition notes">
<p class="admonition-title">Notes</p>
<ul>
<li>When you have several solutions in one folder, VS Code ignores the <code>tasks.json</code> and <code>launch.json</code> files that
you created for each solution. Instead, VS Code generates new JSON files at the root of the workspace in a
<code>.vscode</code> folder and ignores the other JSON files. As a workaround, open one solution first, then add other
solutions to your workspace with the <strong>File</strong> > <strong>Add Folder to Workspace</strong> option.</li>
<li>If you are using a multi-core device and you did not specify a <code>"processorName"</code> in the <code>launch.json</code> file,
select the appropriate processor for your project in the <strong>Select a processor</strong> drop-down list at the top of the
window.</li>
<li>If you want to run the application on an Arm FVP simulation model, you need to
<a href="debug.html#arm-fvps">configure it</a> in the <strong>Manage Solution</strong> dialog.</li>
</ul>
</div>
<h3 id="monitor-printf-messages">Monitor printf messages</h3>
<p>Keil Studio includes the <strong>Serial Monitor</strong> extension that connects to the target's serial output port. If your example
contains <code>printf</code> statements, use the Serial Monitor to observe them.</p>
<p><img alt="Serial Monitor showing printf messages" src="images/serial-monitor.png" /></p>
</div>
</div><footer>
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
<a href="manage_settings.html" class="btn btn-neutral float-left" title="Manage solutions"><span class="icon icon-circle-arrow-left"></span> Previous</a>
<a href="debug.html" class="btn btn-neutral float-right" title="Debug">Next <span class="icon icon-circle-arrow-right"></span></a>
</div>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
</div>
Built with <a href="https://www.mkdocs.org/">MkDocs</a> using a <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" aria-label="Versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span>
<a href="https://github.com/MDK-Packs/vscode-cmsis-solution-docs" class="fa fa-github" style="color: #fcfcfc"> GitHub</a>
</span>
<span><a href="manage_settings.html" style="color: #fcfcfc">« Previous</a></span>
<span><a href="debug.html" style="color: #fcfcfc">Next »</a></span>
</span>
</div>
<script src="js/jquery-3.6.0.min.js"></script>
<script>var base_url = ".";</script>
<script src="js/theme_extra.js"></script>
<script src="js/theme.js"></script>
<script src="search/main.js"></script>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>