|
| 1 | +# pyOCD Debugger |
| 2 | + |
| 3 | +!!! Note |
| 4 | + - This section contains preliminary information and is work-in-progress. |
| 5 | + |
| 6 | +The CMSIS-Toolbox has many features. For debuggers it organizes projects and configuration options. |
| 7 | +This chapter explains the usage of the [pyOCD](https://pyocd.io/) Debugger in combination with these CMSIS-Toolbox features. |
| 8 | + |
| 9 | +Other manual sections describe how to configure debuggers: |
| 10 | + |
| 11 | +- [Run and Debug Configuration](build-overview.md#run-and-debug-configuration) explains overall structure and how projects and images are configured. |
| 12 | +- [Debugger Configuration - pyOCD](YML-Input-Format.md#pyocd) contains details about the options that are specific to pyOCD. |
| 13 | + |
| 14 | +## Command Line Invocation |
| 15 | + |
| 16 | +The CMSIS-Toolbox debugger configuration is provided in the [file `*.cbuild-run.yml`](YML-CBuild-Format.md#file-structure-of-cbuild-runyml). Use the following command line syntax to leverage this information: |
| 17 | + |
| 18 | +```bash |
| 19 | +>pyOCD <command> --cbuild-run <cbuild-run.yml file> [options] |
| 20 | +``` |
| 21 | + |
| 22 | +`<command>` | Description |
| 23 | +:--------------------|:------------------------------------- |
| 24 | +`run` | Execute application. |
| 25 | +`erase` | Erase device |
| 26 | +`load` | Load image to device. |
| 27 | + |
| 28 | +`<options>` | Description |
| 29 | +:--------------------|:------------------------------------- |
| 30 | +`--timelimit sec` | Terminate pyOCD when the timelimit is reached. Applies to `run` command only. |
| 31 | +`--eot` | Terminate when EOT character (`0x04`) is printed via a telnet channel. Applies to `run` command only. |
| 32 | +`--load` | Erase device and flash program the images specified in cbuild-run.yml. Applies to `run` command only. |
| 33 | +`--udi <id>` | Specify an id of a debug probe |
| 34 | + |
| 35 | +**Examples:** |
| 36 | + |
| 37 | +ToDo: command line examples |
| 38 | + |
| 39 | +## Content of `cbuild-run.yml` |
| 40 | + |
| 41 | +This section details the content of `cbuild-run.yml` file and how it is used to configure pyOCD. The `cbuild-run.yml` file is generated by the CMSIS-Toolbox from the information provided in the *csolution project*. |
| 42 | +However, it is possible to create a `*.cbuild-run.yml` file manually and the following section explains the file structure. |
| 43 | + |
| 44 | +**Configuration File Example:** |
| 45 | + |
| 46 | +```yml |
| 47 | +todo |
| 48 | +``` |
| 49 | + |
| 50 | +### `cbuild-run:` |
| 51 | + |
| 52 | +The `cbuild-run:` node is the start of a `*.cbuild-run.yml` file. |
| 53 | + |
| 54 | +`cbuild-run:` | | Content |
| 55 | +:-----------------------------------------------------------|:-----------|:------------------------------------ |
| 56 | + `device:` | Optional | Identifies the device. |
| 57 | + `device-pack:` | Optional | Identifies the device pack used. |
| 58 | + [`output:`](#output) | Optional | Lists the possible compiler selection that this project is tested with. |
| 59 | + [`system-resources:`](#system-resources) | Optional | When specified, the [`cdefault.yml`](build-overview.md#cdefaultyml) file is used to setup compiler specific controls. |
| 60 | + |
| 61 | +### `output:` |
| 62 | + |
| 63 | +`output:` | | Content |
| 64 | +:-----------------------------------------------------------|:-----------|:------------------------------------ |
| 65 | + `device:` | Optional | Identifies the device. |
| 66 | + `device-pack:` | Optional | Identifies the device pack used. |
| 67 | + [`output:`](#output) | Optional | Lists the possible compiler selection that this project is tested with. |
| 68 | + [`system-resources:`](#system-resources) | Optional | When specified, the [`cdefault.yml`](build-overview.md#cdefaultyml) file is used to setup compiler specific controls. |
| 69 | + |
| 70 | +### `system-resources:` |
| 71 | + |
| 72 | +```yml |
| 73 | +cbuild-run: |
| 74 | + device: |
| 75 | + device-pack: ? is the board-pack: not used? |
| 76 | + output: |
| 77 | + - file: |
| 78 | + info: |
| 79 | + type: |
| 80 | + load-offset: |
| 81 | + load: |
| 82 | + pname: |
| 83 | + system-resources: |
| 84 | + memory: |
| 85 | + - name: |
| 86 | + access: |
| 87 | + start: |
| 88 | + size: |
| 89 | + pname: |
| 90 | + alias: |
| 91 | + from-pack: |
| 92 | + system-descriptions: |
| 93 | + - file: |
| 94 | + type: |
| 95 | + pname: |
| 96 | + debugger: |
| 97 | + name: |
| 98 | + clock: |
| 99 | + dbgconf: |
| 100 | + start-pname: |
| 101 | + gdbserver: |
| 102 | + - port: |
| 103 | + pname: |
| 104 | + - port: |
| 105 | + pname: |
| 106 | + debug-vars: |
| 107 | + vars: |
| 108 | + debug-sequences: |
| 109 | + - name: |
| 110 | + info: |
| 111 | + pname: |
| 112 | + blocks: |
| 113 | + - info: |
| 114 | + if: |
| 115 | + while: |
| 116 | + execute: |
| 117 | + timeout: |
| 118 | + atomic: |
| 119 | + blocks: |
| 120 | + programming: |
| 121 | + - algorithm: |
| 122 | + ram-start: |
| 123 | + size: |
| 124 | + ram-start: |
| 125 | + ram-size: |
| 126 | + pname: |
| 127 | + debug-topology: |
| 128 | + debugports: |
| 129 | + - dpid: |
| 130 | + accessports: |
| 131 | + - apid: |
| 132 | + address: |
| 133 | + index: |
| 134 | + processors: |
| 135 | + - pname: |
| 136 | + apid: |
| 137 | + swj: |
| 138 | + dormant: |
| 139 | +``` |
0 commit comments