-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtipsandtricks.html
More file actions
311 lines (288 loc) · 15.4 KB
/
tipsandtricks.html
File metadata and controls
311 lines (288 loc) · 15.4 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
311
<!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>Tips and tricks - 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 = "Tips and tricks";
var mkdocs_page_input_path = "tipsandtricks.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>
<li class="toctree-l1"><a class="reference internal" href="build_run.html">Build and run</a>
</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 class="current">
<li class="toctree-l1 current"><a class="reference internal current" href="#">Tips and tricks</a>
<ul class="current">
<li class="toctree-l2"><a class="reference internal" href="#create-vcpkg-configuration-file">Create vcpkg configuration file</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#set-current-solution-in-workspace">Set current solution in workspace</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#documentation-does-not-open">Documentation does not open</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#create-a-library-file">Create a library file</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#downgrading-tool-versions">Downgrading tool versions</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#stm32cubemx-generator-issues">STM32CubeMX generator issues</a>
</li>
<li class="toctree-l2"><a class="reference internal" href="#debugging">Debugging</a>
<ul>
<li class="toctree-l3"><a class="reference internal" href="#memory-and-peripheral-inspector-are-missing">Memory and Peripheral Inspector are missing</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#change-variable-display-radix">Change variable display radix</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#cannot-connect-uart-when-debugging">Cannot connect UART when debugging</a>
</li>
</ul>
</li>
</ul>
</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">Tips and tricks</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/MDK-Packs/vscode-cmsis-solution-docs/edit/main/docs/tipsandtricks.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="tips-and-tricks">Tips and tricks</h1>
<p>This chapter contains useful information to help you solve specific issues.</p>
<h2 id="create-vcpkg-configuration-file">Create vcpkg configuration file</h2>
<p>If your solution does not contain the <code>vcpkg-configuration.json</code>, right-click anywhere in the workspace and select
<strong>Configure Arm Tools Environment</strong>. The <strong>Arm Tools Environment Manager</strong> extension then generates this file.</p>
<h2 id="set-current-solution-in-workspace">Set current solution in workspace</h2>
<p>To activate a solution in the <strong>Solution</strong> outline view, use the <strong>Select Active Solution from workspace</strong> option in
<strong>Views and More Actions</strong>:<br />
<img alt="Views and More Actions icon" src="images/select-active-solution.png" />.</p>
<h2 id="documentation-does-not-open">Documentation does not open</h2>
<p>If you are using a Linux machine that uses the Snap package manager, your web browser will not be able to open
documentation that is shipped in CMSIS-Packs as the <code>CMSIS_PACK_ROOT</code> directory is in <code>${HOME}/.cache/arm/packs</code> which
is not accessible to Snaps. Likewise, the Keil Studio help is located in <code>${HOME}/.vscode/extensions</code> which is also not
available.</p>
<p>To get this working, use a browser that is not installed as a Snap package:</p>
<ul>
<li>
<p>Uninstall the Snap package. For example, run <code>sudo snap remove firefox</code> in a Terminal.</p>
</li>
<li>
<p>Download the installer from the browser's web site.</p>
</li>
<li>
<p>Install it on your machine.</p>
</li>
</ul>
<h2 id="create-a-library-file">Create a library file</h2>
<p>With Keil Studio, it is possible to create a library file. All you need to do is to change the <strong>output type</strong> in the
<code>*.cproject.yml</code> file to <code>lib</code>:</p>
<pre><code class="language-yml"># Control output files (elf is generated by default)
output:
type:
- lib
</code></pre>
<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" />. The Terminal
output will look like this:</p>
<pre><code class="language-txt">Execute: cbuild /Users/user/project/Arm/ArmCM3/Library/Library.csolution.yml --build --context-set --packs
+----------------------------------------------
(1/1) Cleaning context: "Library.Debug+Library"
+----------------------------------------------
(1/1) Building context: "Library.Debug+Library"
Using AC6 V6.24.0 compiler, from: '/Users/user/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/'
Building CMake target 'Library.Debug+Library'
[1/2] Building C object CMakeFiles/Group_Source_Files.dir/Users/user/project/Arm/ArmCM3/Library/main.o
[2/2] Linking C static library /Users/user/project/Arm/ArmCM3/Library/out/Library/Library/Debug/Library.lib
+------------------------------------------------------------
Build summary: 1 succeeded, 0 failed - Time Elapsed: 00:00:02
+============================================================
Completed: cbuild succeed with exit code 0
</code></pre>
<p>The corresponding library file will be present in the <code>/out</code>-directory.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This only works with CMSIS-Toolbox starting v2.11.0.</p>
</div>
<h2 id="downgrading-tool-versions">Downgrading tool versions</h2>
<p>When you downgrade a tool version in the <code>vcpkg-configuration,json</code> file, this will only be taken into account if you
toggle the tools activation.</p>
<p>Do the following:</p>
<ul>
<li>Click on the <strong>Arm Tools</strong> entry in the status bar.</li>
<li>In the <strong>Manage Arm Tools</strong> dialog, select <em>Deactivate Environment</em>. The status bar will show that tools are
deactivated: <img alt="Arm Tools deactivated" src="images/arm-tools-deactivated.png" /></li>
<li>Again, click on the <strong>Arm Tools</strong> entry in the status bar.</li>
<li>In the <strong>Manage Arm Tools</strong> dialog, select <em>Reactivate Environment</em>.</li>
</ul>
<p>The new settings will now the taken into account and you can start working with the downgraded tool version.</p>
<h2 id="stm32cubemx-generator-issues">STM32CubeMX generator issues</h2>
<p>If you are relying on the <strong>LL</strong> drivers, it may happen that STM32CubeMX does not generate/update a <code>*.cgen.yml</code> file.
To get this fixed, go to:</p>
<ol>
<li>Project Manager</li>
<li>Advanced Settings</li>
<li>Select <strong>HAL</strong> (default) for at least one peripheral.</li>
</ol>
<p>If you rely on <strong>LL</strong> for your peripherals, select/add an unused peripheral:</p>
<p><img alt="Make STM32CubeMX generate the cgen.yml file" src="images/cubemx-cgen-hal.png" /></p>
<p>Now, the <strong>GENERATE CODE</strong> button creates/writes the <code>*.cgen.yml</code> file.</p>
<h2 id="debugging">Debugging</h2>
<h3 id="memory-and-peripheral-inspector-are-missing">Memory and Peripheral Inspector are missing</h3>
<p>If your <strong>Debug</strong> view does not contain
<a href="https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.peripheral-inspector">"PERIPHERALS"</a> and you cannot
open the <a href="https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.memory-inspector">Memory Inspector</a>, check if
the extensions are installed correctly. If you had previously uninstalled the
<a href="https://marketplace.visualstudio.com/items?itemName=Arm.arm-debugger">Arm Debugger</a> extension, these two extensions
might have been removed with it. Just reinstall them via the <strong>Extensions</strong> view.</p>
<h3 id="change-variable-display-radix">Change variable display radix</h3>
<p>In the <strong>Watch</strong> and <strong>Live Watch</strong> views, you can change the radix of variables by using the
<code>set output-radix base</code> command in the <strong>Debug Console</strong>. For example,</p>
<pre><code class="language-txt">> set output-radix 16
</code></pre>
<p>changes the radix to hexadecimal. Supported choices for base are decimal <code>8</code>, <code>10</code>, or <code>16</code>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<ul>
<li>The <code>></code> is part of the entered command instructing the console processing to use GDB CLI.</li>
<li>Refer to <a href="https://sourceware.org/gdb/current/onlinedocs/gdb.html/Numbers.html">Numbers</a> for more information.</li>
</ul>
</div>
<h3 id="cannot-connect-uart-when-debugging">Cannot connect UART when debugging</h3>
<p><strong>Symptom</strong></p>
<p>Using older <strong>DAPLink</strong> or <strong>LPC-Link2</strong> implementations, it is not possible to have a debug connection and monitor the
output of the UART on the SERIAL MONITOR at the same time. Once the serial connection is opened, the debug connect
stalls and throws these two errors:</p>
<pre><code class="language-txt">Cannot execute this command while the target is running.
Use the "interrupt" command to stop the target and then try again.
</code></pre>
<p>And</p>
<pre><code class="language-txt">Unable to read memory.
</code></pre>
<p><strong>Solution</strong></p>
<p>Using an NXP board with the new MCU-Link FW, this problem does not occur.</p>
<p>For older boards, there is no new DAPLink firmware available. Please avoid using the UART when debugging or use an
external debug adapter.</p>
</div>
</div><footer>
<div class="rst-footer-buttons" role="navigation" aria-label="Footer Navigation">
<a href="runexternal.html" class="btn btn-neutral float-left" title="Run external tools"><span class="icon icon-circle-arrow-left"></span> Previous</a>
<a href="reldocs.html" class="btn btn-neutral float-right" title="Related documentation">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="runexternal.html" style="color: #fcfcfc">« Previous</a></span>
<span><a href="reldocs.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>