Skip to content

Commit fd6077f

Browse files
author
pyocd-bot
committed
Deploying to main from @ pyocd/pyocd-website-source@ae49d32 🚀
1 parent 39ccf9a commit fd6077f

34 files changed

+1604
-41
lines changed

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- [Target support](target_support.md)
1414
- [Debug probes](debug_probes.md)
1515
- [Configuration](configuration.md)
16+
- [Open-CMSIS-Pack support](open_cmsis_pack_support.md)
1617
- [User scripts](user_scripts.md)
1718
- [Remote probe access](remote_probe_access.md)
1819
- [Configuring logging](configuring_logging.md)

docs/adding_new_targets.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ <h5 class="sidebar-header level-1">User documentation</h5>
126126
<li class="sidebar-item level-1">
127127
<a href="/docs/swo_swv.html" class="sidebar-link ">SWO/SWV</a>
128128
</li>
129+
<li class="sidebar-item level-1">
130+
<a href="/docs/memory_attributes.html" class="sidebar-link ">Memory transfer attributes</a>
131+
</li>
129132
<li class="sidebar-item level-1">
130133
<a href="/docs/target_family_notes.html" class="sidebar-link ">Target family usage notes</a>
131134
</li>
@@ -156,6 +159,9 @@ <h5 class="sidebar-header level-1">Python API</h5>
156159
<li class="sidebar-item level-1">
157160
<a href="/docs/api_examples.html" class="sidebar-link ">Python API examples</a>
158161
</li>
162+
<li class="sidebar-item level-1">
163+
<a href="/docs/api/architecture.html" class="sidebar-link ">Architecture</a>
164+
</li>
159165
<li class="sidebar-item level-1">
160166
<a href="/docs/api/using_session_options.html" class="sidebar-link ">Using session options</a>
161167
</li>

docs/api/architecture.html

Lines changed: 456 additions & 0 deletions
Large diffs are not rendered by default.

docs/api/using_session_options.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ <h5 class="sidebar-header level-1">User documentation</h5>
126126
<li class="sidebar-item level-1">
127127
<a href="/docs/swo_swv.html" class="sidebar-link ">SWO/SWV</a>
128128
</li>
129+
<li class="sidebar-item level-1">
130+
<a href="/docs/memory_attributes.html" class="sidebar-link ">Memory transfer attributes</a>
131+
</li>
129132
<li class="sidebar-item level-1">
130133
<a href="/docs/target_family_notes.html" class="sidebar-link ">Target family usage notes</a>
131134
</li>
@@ -156,6 +159,9 @@ <h5 class="sidebar-header level-1">Python API</h5>
156159
<li class="sidebar-item level-1">
157160
<a href="/docs/api_examples.html" class="sidebar-link ">Python API examples</a>
158161
</li>
162+
<li class="sidebar-item level-1">
163+
<a href="/docs/api/architecture.html" class="sidebar-link ">Architecture</a>
164+
</li>
159165
<li class="sidebar-item level-1">
160166
<p class="sidebar-item-selected">Using session options</p>
161167
</li>
@@ -239,14 +245,16 @@ <h2 id="accessing-options">Accessing options</h2>
239245
<span class="n">session</span><span class="p">.</span><span class="n">options</span><span class="p">.</span><span class="nb">set</span><span class="p">(</span><span class="s">'reset_type'</span><span class="p">)</span> <span class="o">=</span> <span class="s">'system'</span>
240246
</code></pre></div></div>
241247

248+
<p>Note that <code class="highlighter-rouge">.get()</code> does not take an optional second parameter for a default value if the session option is unset. Instead, this default value is determined from the session option’s definition.</p>
249+
242250
<h2 id="priority-layers">Priority layers</h2>
243251

244-
<p>Session options have a priority based on their source. The <code class="highlighter-rouge">OptionsManager</code> class implements these priorities as an ordered sequence of layers from front (high priority) to back (low priority). Each layer is a dict of option name to value. There is also an implicit lowest-priority layer from which default values specified in the option definition are derived.</p>
252+
<p>Session options have a priority based on their source. The <code class="highlighter-rouge">OptionsManager</code> class implements these priorities as an ordered sequence of layers from front (high priority) to back (low priority). Each layer is a dict of option name to value. There is also an implicit lowest-priority layer derived from default values specified in the option definitions.</p>
245253

246254
<p>The priorities of the different sources, from front to back:</p>
247255

248256
<ol>
249-
<li>Keyword arguments to the <code class="highlighter-rouge">Session</code> constructor. Applies to most command-line arguments.</li>
257+
<li>Keyword arguments to the <code class="highlighter-rouge">Session</code> constructor. Applies to most dedicated command-line arguments.</li>
250258
<li><em>options</em> parameter to <code class="highlighter-rouge">Session</code> constructor. Applies to <code class="highlighter-rouge">-O</code> command-line arguments.</li>
251259
<li>Probe-specific options from a config file.</li>
252260
<li>Global options from a config file.</li>

docs/api_examples.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ <h5 class="sidebar-header level-1">User documentation</h5>
126126
<li class="sidebar-item level-1">
127127
<a href="/docs/swo_swv.html" class="sidebar-link ">SWO/SWV</a>
128128
</li>
129+
<li class="sidebar-item level-1">
130+
<a href="/docs/memory_attributes.html" class="sidebar-link ">Memory transfer attributes</a>
131+
</li>
129132
<li class="sidebar-item level-1">
130133
<a href="/docs/target_family_notes.html" class="sidebar-link ">Target family usage notes</a>
131134
</li>
@@ -156,6 +159,9 @@ <h5 class="sidebar-header level-1">Python API</h5>
156159
<li class="sidebar-item level-1">
157160
<p class="sidebar-item-selected">Python API examples</p>
158161
</li>
162+
<li class="sidebar-item level-1">
163+
<a href="/docs/api/architecture.html" class="sidebar-link ">Architecture</a>
164+
</li>
159165
<li class="sidebar-item level-1">
160166
<a href="/docs/api/using_session_options.html" class="sidebar-link ">Using session options</a>
161167
</li>

docs/architecture.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ <h5 class="sidebar-header level-1">User documentation</h5>
126126
<li class="sidebar-item level-1">
127127
<a href="/docs/swo_swv.html" class="sidebar-link ">SWO/SWV</a>
128128
</li>
129+
<li class="sidebar-item level-1">
130+
<a href="/docs/memory_attributes.html" class="sidebar-link ">Memory transfer attributes</a>
131+
</li>
129132
<li class="sidebar-item level-1">
130133
<a href="/docs/target_family_notes.html" class="sidebar-link ">Target family usage notes</a>
131134
</li>
@@ -156,6 +159,9 @@ <h5 class="sidebar-header level-1">Python API</h5>
156159
<li class="sidebar-item level-1">
157160
<a href="/docs/api_examples.html" class="sidebar-link ">Python API examples</a>
158161
</li>
162+
<li class="sidebar-item level-1">
163+
<a href="/docs/api/architecture.html" class="sidebar-link ">Architecture</a>
164+
</li>
159165
<li class="sidebar-item level-1">
160166
<a href="/docs/api/using_session_options.html" class="sidebar-link ">Using session options</a>
161167
</li>

docs/automated_tests.html

Lines changed: 108 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ <h5 class="sidebar-header level-1">User documentation</h5>
126126
<li class="sidebar-item level-1">
127127
<a href="/docs/swo_swv.html" class="sidebar-link ">SWO/SWV</a>
128128
</li>
129+
<li class="sidebar-item level-1">
130+
<a href="/docs/memory_attributes.html" class="sidebar-link ">Memory transfer attributes</a>
131+
</li>
129132
<li class="sidebar-item level-1">
130133
<a href="/docs/target_family_notes.html" class="sidebar-link ">Target family usage notes</a>
131134
</li>
@@ -156,6 +159,9 @@ <h5 class="sidebar-header level-1">Python API</h5>
156159
<li class="sidebar-item level-1">
157160
<a href="/docs/api_examples.html" class="sidebar-link ">Python API examples</a>
158161
</li>
162+
<li class="sidebar-item level-1">
163+
<a href="/docs/api/architecture.html" class="sidebar-link ">Architecture</a>
164+
</li>
159165
<li class="sidebar-item level-1">
160166
<a href="/docs/api/using_session_options.html" class="sidebar-link ">Using session options</a>
161167
</li>
@@ -217,7 +223,12 @@ <h5 class="sidebar-header">On this page</h5>
217223
<ul id="toc" class="section-nav">
218224
<li class="toc-entry toc-h2"><a href="#test-setup">Test Setup</a></li>
219225
<li class="toc-entry toc-h2"><a href="#unit-tests">Unit tests</a></li>
220-
<li class="toc-entry toc-h2"><a href="#functional-tests">Functional tests</a></li>
226+
<li class="toc-entry toc-h2"><a href="#functional-tests">Functional tests</a>
227+
<ul>
228+
<li class="toc-entry toc-h3"><a href="#list-of-functional-tests">List of functional tests</a></li>
229+
</ul>
230+
</li>
231+
<li class="toc-entry toc-h2"><a href="#test-binaries">Test binaries</a></li>
221232
<li class="toc-entry toc-h2"><a href="#azure-pipelines">Azure Pipelines</a></li>
222233
<li class="toc-entry toc-h2"><a href="#testing-with-tox">Testing with tox</a></li>
223234
</ul>
@@ -260,46 +271,115 @@ <h2 id="unit-tests">Unit tests</h2>
260271
pytest, as they rely on the advanced capabilities of this tool.</p>
261272

262273
<p>To run the unit tests, simply invoke <code class="highlighter-rouge">pytest</code> in the root directory of the repo. Read the pytest
263-
usage to see the many options it provides.</p>
274+
help to see the many options it provides.</p>
264275

265276
<p>To get code coverage results, do the following:</p>
266277

267278
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ pytest --cov-report=html --cov=pyocd
268279
$ open htmlcov/index.html
269280
</code></pre></div></div>
270281

282+
<p>Note: The <code class="highlighter-rouge">semihosting.py</code> unit test requires a target connection and test binary. It is currently the only unit that uses a target. When no targets are available the test cases will be skipped.</p>
283+
271284
<h2 id="functional-tests">Functional tests</h2>
272285

273-
<p>A series of quite comprehensive functional tests are provided in the <code class="highlighter-rouge">test/</code> directory. The primary
274-
script for running these tests is <code class="highlighter-rouge">automated_test.py</code>. It will execute all functional tests in
286+
<p>A series of fairly comprehensive functional tests are provided in the <code class="highlighter-rouge">test/</code> directory.</p>
287+
288+
<p>The primary script for running these tests is <code class="highlighter-rouge">automated_test.py</code>. It will execute all functional tests in
275289
sequence for all connected debug probes, then produce a summary and JUnit-style XML report. This
276290
script is used to execute our CI test plan, and we frequently use it on our personal development
277291
systems to test prior to creating pull requests.</p>
278292

279-
<p>Functional tests:</p>
293+
<p>The <code class="highlighter-rouge">automated_test.py</code> script has several command line arguments that can be used to control which test suites are run and on which debug probes. Use <code class="highlighter-rouge">--list-tests</code> to see available test suite names. Comma-separated lists of these names can be passed to the <code class="highlighter-rouge">-x</code> / <code class="highlighter-rouge">--exclude-tests</code> or <code class="highlighter-rouge">-i</code> / <code class="highlighter-rouge">--include-tests</code> arguments to exclude and include tests, respectively. Only one of these two arguments can be used at a time.</p>
280294

281-
<ul>
282-
<li><code class="highlighter-rouge">basic_test.py</code>: a simple test that checks a range of basic functionality, from flash programming to accessing memory and core registers.</li>
283-
<li><code class="highlighter-rouge">blank_test.py</code>: tests ability to connect to devices with with blank flash. (Not run by <code class="highlighter-rouge">automated_test.py</code>.)</li>
284-
<li><code class="highlighter-rouge">commander_test.py</code>: tests the <code class="highlighter-rouge">pyocd commander</code> functionality.</li>
285-
<li><code class="highlighter-rouge">commands_test.py</code>: tests commands supported by commander and gdb monitor commands.</li>
286-
<li><code class="highlighter-rouge">concurrency_test.py</code>: verify multiple threads can simultaneously access a debug probe, specifically for memory
287-
transfers.</li>
288-
<li><code class="highlighter-rouge">connect_test.py</code>: tests all combinations of the halt on connect and disconnect resume options.</li>
289-
<li><code class="highlighter-rouge">cortex_test.py</code>: validates CPU control operations and memory accesses.</li>
290-
<li><code class="highlighter-rouge">debug_context_test.py</code>: tests some <code class="highlighter-rouge">DebugContext</code> classes.</li>
291-
<li><code class="highlighter-rouge">flash_loader_test.py</code>: test the classes in the <code class="highlighter-rouge">pyocd.flash.loader</code> module.</li>
292-
<li><code class="highlighter-rouge">flash_test.py</code>: comprehensive test of flash programming.</li>
293-
<li><code class="highlighter-rouge">import_all.py</code>: imports all pyocd modules. (Not run by <code class="highlighter-rouge">automated_test.py</code>.)</li>
294-
<li><code class="highlighter-rouge">gdb_test.py</code>: tests the gdbserver by running a script in a gdb process. Note that on Windows,
295-
the 32-bit Python 2.7 must be installed for the Python-enabled gdb to work properly and for
296-
this test to pass.</li>
297-
<li><code class="highlighter-rouge">json_lists_test.py</code>: validates the JSON output from <code class="highlighter-rouge">pyocd json</code>.</li>
298-
<li><code class="highlighter-rouge">parallel_test.py</code>: checks for issues with accessing debug probes from multiple processes and threads simultaneously. (Not run by <code class="highlighter-rouge">automated_test.py</code>.)</li>
299-
<li><code class="highlighter-rouge">probeserver_test.py</code>: verify remote probe server and client.</li>
300-
<li><code class="highlighter-rouge">speed_test.py</code>: performance test for memory reads and writes.</li>
301-
<li><code class="highlighter-rouge">user_script_test.py</code>: verify loading of user scripts.</li>
302-
</ul>
295+
<p>The <code class="highlighter-rouge">-b</code> / <code class="highlighter-rouge">--board</code> argument is used to select a debug probe on which tests will be run. By default, tests will run on all available debug probes. Adding any <code class="highlighter-rouge">--board</code> arguments restricts tests to run on only the specified set of debug probes.</p>
296+
297+
<h3 id="list-of-functional-tests">List of functional tests</h3>
298+
299+
<p>Test scripts with an “n/a” for the test name are not run by <code class="highlighter-rouge">automated_test.py</code> (or in CI) and have to be run directly with Python.</p>
300+
301+
<table>
302+
303+
<tr><th width="20%">Test name</th><th width="20%">File</th><th>Description</th></tr>
304+
305+
<tr><td>Basic Test</td><td><tt>basic_test.py</tt></td><td>
306+
Simple test that checks a range of basic functionality, from flash programming to accessing memory and core registers.
307+
</td></tr>
308+
309+
<tr><td>n/a</td><td><tt>blank_test.py</tt></td><td>
310+
Tests ability to connect to devices with with blank flash.
311+
</td></tr>
312+
313+
<tr><td>Commander Test</td><td><tt>commander_test.py</tt></td><td>
314+
Tests the <tt>pyocd commander</tt> functionality.
315+
</td></tr>
316+
317+
<tr><td>Commands Test</td><td><tt>commands_test.py</tt></td><td>
318+
Tests commands supported by commander and gdb monitor commands.
319+
</td></tr>
320+
321+
<tr><td>Concurrency Test</td><td><tt>concurrency_test.py</tt></td><td>
322+
Verify multiple threads can simultaneously access a debug probe, specifically for memory transfers.
323+
</td></tr>
324+
325+
<tr><td>Connect Test</td><td><tt>connect_test.py</tt></td><td>
326+
Tests all combinations of the halt on connect and disconnect resume options.
327+
</td></tr>
328+
329+
<tr><td>Cortex Test</td><td><tt>cortex_test.py</tt></td><td>
330+
Validates CPU control operations and memory accesses.
331+
</td></tr>
332+
333+
<tr><td>Debug Context Test</td><td><tt>debug_context_test.py</tt></td><td>
334+
Tests some <tt>DebugContext</tt> classes.
335+
</td></tr>
336+
337+
<tr><td>Flash Loader Test</td><td><tt>flash_loader_test.py</tt></td><td>
338+
Test the classes in the <tt>pyocd.flash.loader</tt> module.
339+
</td></tr>
340+
341+
<tr><td>Flash Test</td><td><tt>flash_test.py</tt></td><td>
342+
Comprehensive test of flash programming.
343+
</td></tr>
344+
345+
<tr><td>n/a</td><td><tt>import_all_.py</tt></td><td>
346+
Imports all pyocd modules. Run by the GitHub "basic test" workflow.
347+
</td></tr>
348+
349+
<tr><td>Gdb Test</td><td><tt>gdb_test.py</tt></td><td>
350+
Tests the gdbserver by running the <tt>gdb_test_script.py</tt> script in a gdb process.
351+
Note that on Windows, the 32-bit Python 2.7 must be installed for the Python-enabled <tt>arm-none-eabi-gdb</tt> to work properly and for this test to pass.
352+
</td></tr>
353+
354+
<tr><td>Json Lists Test</td><td><tt>json_lists_test.py</tt></td><td>
355+
Validates the JSON output from <tt>pyocd json</tt>.
356+
</td></tr>
357+
358+
<tr><td>n/a</td><td><tt>parallel_test.py</tt></td><td>
359+
Checks for issues with accessing debug probes from multiple processes and threads simultaneously.
360+
</td></tr>
361+
362+
<tr><td>Probeserver Test</td><td><tt>probeserver_test.py</tt></td><td>
363+
Verify remote probe server and client.
364+
</td></tr>
365+
366+
<tr><td>Speed Test</td><td><tt>speed_test.py</tt></td><td>
367+
Performance test for memory reads and writes.
368+
</td></tr>
369+
370+
<tr><td>User Script Test</td><td><tt>user_script_test.py</tt></td><td>
371+
Verify loading of user scripts.
372+
</td></tr>
373+
374+
</table>
375+
376+
<h2 id="test-binaries">Test binaries</h2>
377+
378+
<p>The functional tests and some unit tests (currently only <code class="highlighter-rouge">test/unit/semihosting.py</code>) require a test firmware binary in order to run. This firmware can be extremely simple. The only requirement is that it have a valid vector table and be executable when loaded to the base of the boot memory. Ideally an LED is blinked so there is an easily-identifiable visual signal that the firmware is running.</p>
379+
380+
<p>Built-in targets almost all include a test binary in the pyOCD repository under <code class="highlighter-rouge">test/data/binaries/</code>. If the board has a board ID, e.g., those listed in <code class="highlighter-rouge">pyocd/board/board_ids.py</code>, the test binary is automatically identified.</p>
381+
382+
<p>If the target is not built-in (DFP) or does not have a board ID then, the <code class="highlighter-rouge">test_binary</code> session option must be set to the path of a test firmware binary file relative to the <code class="highlighter-rouge">test/data/binaries</code> directory. This can be conveniently added as probe-specific options in a <code class="highlighter-rouge">pyocd.yaml</code> config file placed under <code class="highlighter-rouge">test/</code>.</p>
303383

304384
<h2 id="azure-pipelines">Azure Pipelines</h2>
305385

@@ -322,7 +402,7 @@ <h2 id="testing-with-tox">Testing with tox</h2>
322402
<p>To run the functional tests via tox, just execute <code class="highlighter-rouge">tox</code> from the root of the pyOCD
323403
repo. It will create new virtual environments for each Python version and run <code class="highlighter-rouge">automated_test.py</code>.</p>
324404

325-
<p>Currently only the functions tests are included in the tox configuration.</p>
405+
<p>Currently only the functional tests are included in the tox configuration.</p>
326406

327407

328408
</div>

docs/builtin-targets.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ <h5 class="sidebar-header level-1">User documentation</h5>
126126
<li class="sidebar-item level-1">
127127
<a href="/docs/swo_swv.html" class="sidebar-link ">SWO/SWV</a>
128128
</li>
129+
<li class="sidebar-item level-1">
130+
<a href="/docs/memory_attributes.html" class="sidebar-link ">Memory transfer attributes</a>
131+
</li>
129132
<li class="sidebar-item level-1">
130133
<a href="/docs/target_family_notes.html" class="sidebar-link ">Target family usage notes</a>
131134
</li>
@@ -156,6 +159,9 @@ <h5 class="sidebar-header level-1">Python API</h5>
156159
<li class="sidebar-item level-1">
157160
<a href="/docs/api_examples.html" class="sidebar-link ">Python API examples</a>
158161
</li>
162+
<li class="sidebar-item level-1">
163+
<a href="/docs/api/architecture.html" class="sidebar-link ">Architecture</a>
164+
</li>
159165
<li class="sidebar-item level-1">
160166
<a href="/docs/api/using_session_options.html" class="sidebar-link ">Using session options</a>
161167
</li>

0 commit comments

Comments
 (0)