| 1 | --- |
| 2 | title: Session options list |
| 3 | --- |
| 4 | |
| 5 | _**Note:** The names of these options are expected to change with the 1.0 release of pyOCD, so |
| 6 | they will be better normalized and grouped._ |
| 7 | |
| 8 | ## General options |
| 9 | |
| 10 | Note that the `project_dir`, `no_config`, and `config` options must come from either a keyword |
| 11 | argument or the _options_ parameter passed to the `Session` constructor due to how early they are |
| 12 | processed. The consequence of this is that these options cannot be set in a YAML config file. |
| 13 | |
| 14 | <table class="docs-table"> |
| 15 | |
| 16 | <tr><th>Option Name</th><th>Type</th><th>Default</th><th>Description</th></tr> |
| 17 | |
| 18 | <tr><td>adi.v5.max_invalid_ap_count</td> |
| 19 | <td>int</td> |
| 20 | <td>3</td> |
| 21 | <td> |
| 22 | If this number of invalid APs is found in a row, then AP scanning will stop. The 'scan_all_aps' option |
| 23 | takes precedence over this option if set. |
| 24 | </td></tr> |
| 25 | |
| 26 | <tr><td>allow_no_cores</td> |
| 27 | <td>bool</td> |
| 28 | <td>False</td> |
| 29 | <td> |
| 30 | Prevents raising an error if no cores were found after CoreSight discovery. |
| 31 | </td></tr> |
| 32 | |
| 33 | <tr><td>auto_unlock</td> |
| 34 | <td>bool</td> |
| 35 | <td>True</td> |
| 36 | <td> |
| 37 | If the target is locked, it will by default be automatically mass erased in order to gain debug |
| 38 | access. Set this option to False to disable auto unlock. |
| 39 | </td></tr> |
| 40 | |
| 41 | <tr><td>cache.enable_memory</td> |
| 42 | <td>bool</td> |
| 43 | <td>True</td> |
| 44 | <td> |
| 45 | Enable the memory read cache. Affects memory accesses made through the target debug context, including the |
| 46 | gdbserver. |
| 47 | </td></tr> |
| 48 | |
| 49 | <tr><td>cache.enable_register</td> |
| 50 | <td>bool</td> |
| 51 | <td>True</td> |
| 52 | <td> |
| 53 | Enable the core register cache. Affects core register accesses made through the target debug context, |
| 54 | including the gdbserver. |
| 55 | </td></tr> |
| 56 | |
| 57 | <tr><td>cache.read_code_from_elf</td> |
| 58 | <td>bool</td> |
| 59 | <td>True</td> |
| 60 | <td> |
| 61 | Controls whether reads of code sections will be taken from an attached ELF file instead of the target memory. |
| 62 | This can improve performance, especially over slow target connections. Requires an ELF file to be set. |
| 63 | </td></tr> |
| 64 | |
| 65 | <tr><td>chip_erase</td> |
| 66 | <td>str</td> |
| 67 | <td>'sector'</td> |
| 68 | <td> |
| 69 | Whether to perform a chip erase or sector erases when programming flash. The value must be one of |
| 70 | 'auto', 'sector', or 'chip'. |
| 71 | </td></tr> |
| 72 | |
| 73 | <tr><td>cmsis_dap.prefer_v1</td> |
| 74 | <td>bool</td> |
| 75 | <td>False</td> |
| 76 | <td> |
| 77 | If a device provides both CMSIS-DAP v1 and v2 interfaces, use the v1 interface in preference of v2. |
| 78 | Normal behaviour is to prefer the v2 interface. This option is primarily intended for testing. |
| 79 | </td></tr> |
| 80 | |
| 81 | <tr><td>commander.history_length</td> |
| 82 | <td>int</td> |
| 83 | <td>1000</td> |
| 84 | <td> |
| 85 | Number of entries in the pyOCD Commander command history. Set to -1 for unlimited. |
| 86 | </td></tr> |
| 87 | |
| 88 | <tr><td>config_file</td> |
| 89 | <td>str</td> |
| 90 | <td><i>See description</i></td> |
| 91 | <td> |
| 92 | Relative path to a YAML config file that lets you specify session options either globally or per probe. |
| 93 | The format of the file is documented above. The default is a <tt>pyocd.yaml</tt> or <tt>pyocd.yml</tt> file in the |
| 94 | working directory. |
| 95 | </td></tr> |
| 96 | |
| 97 | <tr><td>connect_mode</td> |
| 98 | <td>str</td> |
| 99 | <td>'halt'</td> |
| 100 | <td> |
| 101 | Controls how pyOCD connects to the target. One of 'halt', 'pre-reset', 'under-reset', 'attach'. |
| 102 | <ul> |
| 103 | <li>'halt': immediately halt all accessible cores upon connect.</li> |
| 104 | <li>'pre-reset': perform a hardware reset prior to connect and halt.</li> |
| 105 | <li>'under-reset': assert hardware reset during the connect sequence, then deassert after the cores are halted. |
| 106 | This connect mode is often necessary to gain control of a target that is in a deep low power mode.</li> |
| 107 | <li>'attach': connect to a running target without halting cores.</li> |
| 108 | </ul> |
| 109 | </td></tr> |
| 110 | |
| 111 | <tr><td>cpu.step.instruction.timeout</td> |
| 112 | <td>float</td> |
| 113 | <td>0.0</td> |
| 114 | <td> |
| 115 | <p>Timeout in seconds for instruction step operations. The default of 0 means no timeout.</p> |
| 116 | <p>Note that stepping may take a very long time for to return in cases such as stepping over a branch |
| 117 | into the Secure world where the debugger doesn't have secure debug access, or similar for Privileged |
| 118 | code in the case of UDE.</p> |
| 119 | </td></tr> |
| 120 | |
| 121 | <tr><td>dap_protocol</td> |
| 122 | <td>str</td> |
| 123 | <td>'default'</td> |
| 124 | <td> |
| 125 | Wire protocol, either 'swd', 'jtag', or 'default'. |
| 126 | </td></tr> |
| 127 | |
| 128 | <tr><td>dap_swj_enable</td> |
| 129 | <td>bool</td> |
| 130 | <td>True</td> |
| 131 | <td> |
| 132 | Send SWJ transition sequence to switch between SWD and JTAG. |
| 133 | </td></tr> |
| 134 | |
| 135 | <tr><td>dap_swj_use_dormant</td> |
| 136 | <td>bool</td> |
| 137 | <td>False</td> |
| 138 | <td> |
| 139 | When switching between SWD and JTAG, use the SWJ sequence added in ADIv5.2 that transitions through |
| 140 | a new dormant state. Requires a SWJ-DPv2. Note that if the connection attempt fails using the |
| 141 | deprecated sequence (when this option is disabled), then pyOCD will automatically attempt to use the |
| 142 | new sequence. This option simply skips the deprecated sequence in case it causes problems or it is |
| 143 | known that dormant state is required for the target. |
| 144 | </td></tr> |
| 145 | |
| 146 | <tr><td>debug.log_flm_info</td> |
| 147 | <td>bool</td> |
| 148 | <td>False</td> |
| 149 | <td> |
| 150 | Log details of loaded .FLM flash algos. |
| 151 | </td></tr> |
| 152 | |
| 153 | <tr><td>debug.traceback</td> |
| 154 | <td>bool</td> |
| 155 | <td>False</td> |
| 156 | <td> |
| 157 | Print tracebacks for exceptions, including errors that are only logged as well as critical errors that cause pyocd to terminate. |
| 158 | |
| 159 | Disabled by default, unless the log level is raised to Debug. |
| 160 | </td></tr> |
| 161 | |
| 162 | <tr><td>enable_multicore_debug</td> |
| 163 | <td>bool</td> |
| 164 | <td>False</td> |
| 165 | <td> |
| 166 | Whether to put pyOCD into multicore debug mode. The primary effect is to modify the default software |
| 167 | reset type for secondary cores to use VECTRESET, which will fall back to emulated reset for |
| 168 | secondary cores that are not v7-M architecture (VECTRESET is only supported on v7-M). The core that is |
| 169 | considered the primary core is selected by the `primary_core` option. |
| 170 | </td></tr> |
| 171 | |
| 172 | <tr><td>fast_program</td> |
| 173 | <td>bool</td> |
| 174 | <td>False</td> |
| 175 | <td> |
| 176 | Setting this option to True will use CRC checks of existing flash sector |
| 177 | contents to determine whether pages need to be programmed. |
| 178 | </td></tr> |
| 179 | |
| 180 | <tr><td>flash.timeout.init</td> |
| 181 | <td>float</td> |
| 182 | <td>5.0</td> |
| 183 | <td> |
| 184 | Flash algorithm init and uninit timeout in seconds. |
| 185 | </td></tr> |
| 186 | |
| 187 | <tr><td>flash.timeout.analyzer</td> |
| 188 | <td>float</td> |
| 189 | <td>30.0</td> |
| 190 | <td> |
| 191 | Flash CRC analyzer timeout in seconds. |
| 192 | </td></tr> |
| 193 | |
| 194 | <tr><td>flash.timeout.erase_all</td> |
| 195 | <td>float</td> |
| 196 | <td>240.0</td> |
| 197 | <td> |
| 198 | Flash algorithm erase all timeout in seconds. |
| 199 | </td></tr> |
| 200 | |
| 201 | <tr><td>flash.timeout.erase_sector</td> |
| 202 | <td>float</td> |
| 203 | <td>10.0</td> |
| 204 | <td> |
| 205 | Flash algorithm sector erase timeout in seconds. |
| 206 | </td></tr> |
| 207 | |
| 208 | <tr><td>flash.timeout.program</td> |
| 209 | <td>float</td> |
| 210 | <td>10.0</td> |
| 211 | <td> |
| 212 | Flash algorithm programming timeout in seconds. |
| 213 | </td></tr> |
| 214 | |
| 215 | <tr><td>frequency</td> |
| 216 | <td>int</td> |
| 217 | <td>1000000 (1 MHz)</td> |
| 218 | <td> |
| 219 | SWD/JTAG frequency in Hertz. |
| 220 | </td></tr> |
| 221 | |
| 222 | <tr><td>hide_programming_progress</td> |
| 223 | <td>bool</td> |
| 224 | <td>False</td> |
| 225 | <td> |
| 226 | Disables flash programming progress bar when True. |
| 227 | </td></tr> |
| 228 | |
| 229 | <tr><td>keep_unwritten</td> |
| 230 | <td>bool</td> |
| 231 | <td>False</td> |
| 232 | <td> |
| 233 | Whether to preserve existing flash content for ranges of sectors that will be erased but not written |
| 234 | with new data. |
| 235 | </td></tr> |
| 236 | |
| 237 | <tr><td>load.pre_reset</td> |
| 238 | <td>str</td> |
| 239 | <td><i>No default</i></td> |
| 240 | <td> |
| 241 | Specify the type of reset to perform before programming. The value must be one of |
| 242 | 'off', 'default', 'hardware', 'system', 'core', 'n_srst', 'sysresetreq', 'vectreset' or 'emulated'. |
| 243 | </td></tr> |
| 244 | |
| 245 | <tr><td>load.post_reset</td> |
| 246 | <td>str</td> |
| 247 | <td><i>No default</i></td> |
| 248 | <td> |
| 249 | Specify the type of reset to perform after programming. The value must be one of |
| 250 | 'off', 'default', 'hardware', 'system', 'core', 'n_srst', 'sysresetreq', 'vectreset' or 'emulated'. |
| 251 | </td></tr> |
| 252 | |
| 253 | <tr><td>logging</td> |
| 254 | <td>str, dict</td> |
| 255 | <td><i>No default</i></td> |
| 256 | <td> |
| 257 | Either a dictionary with logging configuration, or a path to a separate yaml logging configuration |
| 258 | file. See the <a href="{% link _docs/configuring_logging.md %}">logging configuration documentation</a> for details of how to |
| 259 | use this option. |
| 260 | </td></tr> |
| 261 | |
| 262 | <tr><td>no_config</td> |
| 263 | <td>bool</td> |
| 264 | <td>False</td> |
| 265 | <td> |
| 266 | Do not use default config file. |
| 267 | </td></tr> |
| 268 | |
| 269 | <tr><td>pack</td> |
| 270 | <td>str, list of str</td> |
| 271 | <td><i>No default</i></td> |
| 272 | <td> |
| 273 | Path or list of paths to CMSIS Device Family Packs. Devices defined in the pack(s) are added to the |
| 274 | list of available targets. |
| 275 | </td></tr> |
| 276 | |
| 277 | <tr><td>pack.debug_sequences.debugvars</td> |
| 278 | <td>str</td> |
| 279 | <td><i>No default</i></td> |
| 280 | <td> |
| 281 | Variable definition statements to change configurable variables defined by and used in the target's debug sequences. |
| 282 | Should be set to a string containing C-style variable assignment statements. C-compatible integer expressions |
| 283 | are allowed, and can refer to previously defined variables. Only those debug variables whose value is being |
| 284 | changed need to be assigned a value; others will retain their default value. |
| 285 | </td></tr> |
| 286 | |
| 287 | <tr><td>pack.debug_sequences.disabled_sequences</td> |
| 288 | <td>str, list of str</td> |
| 289 | <td><i>No default</i></td> |
| 290 | <td> |
| 291 | Comma-separated list of names of debug sequences to disable for a CMSIS-Pack based target. |
| 292 | Disabled sequences can be restricted to a given core by appending a colon and processor |
| 293 | name to the sequence's name. If set in a YAML config file, the value must be a list of sequence |
| 294 | names instead of using a single comma-separated value. |
| 295 | |
| 296 | Only top-level sequences can be disabled. If a sequence is called from another sequence it will |
| 297 | always be executed even if listed in this option. |
| 298 | |
| 299 | Ignored for builtin targets. |
| 300 | </td></tr> |
| 301 | |
| 302 | <tr><td>pack.debug_sequences.enable</td> |
| 303 | <td>bool</td> |
| 304 | <td><i>True</i></td> |
| 305 | <td> |
| 306 | Global enable for debug sequences for CMSIS-Pack based targets. Ignored for builtin targets. |
| 307 | </td></tr> |
| 308 | |
| 309 | <tr><td>primary_core</td> |
| 310 | <td>int</td> |
| 311 | <td>0</td> |
| 312 | <td> |
| 313 | Core number for the primary/boot core of an asymmetric multicore target. Becomes the default selected |
| 314 | core in the commander and the `SoCTarget` class. Also the core that will control system reset when |
| 315 | `enable_multicore_debug` is set. |
| 316 | </td></tr> |
| 317 | |
| 318 | <tr><td>probeserver.port</td> |
| 319 | <td>int</td> |
| 320 | <td>5555</td> |
| 321 | <td> |
| 322 | TCP port for the debug probe server. |
| 323 | </td></tr> |
| 324 | |
| 325 | <tr><td>project_dir</td> |
| 326 | <td>str</td> |
| 327 | <td><i>See description</i></td> |
| 328 | <td> |
| 329 | Path to the session's project directory. Defaults to the working directory when the pyocd tool was |
| 330 | executed. |
| 331 | </td></tr> |
| 332 | |
| 333 | <tr><td>reset_type</td> |
| 334 | <td>str</td> |
| 335 | <td>'default'</td> |
| 336 | <td> |
| 337 | Which type of reset to use. Must be one of 'default', 'hardware', 'system', 'core', 'n_srst', |
| 338 | 'sysresetreq', 'vectreset' or 'emulated'. The 'default' option causes the target type's |
| 339 | default reset type to be used; this is usually `system`. If `enable_multicore_debug` is |
| 340 | set to true, then secondary cores will default to `core`. |
| 341 | </td></tr> |
| 342 | |
| 343 | <tr><td>reset.hold_time</td> |
| 344 | <td>float</td> |
| 345 | <td>0.1</td> |
| 346 | <td> |
| 347 | Number of seconds to hold hardware reset asserted. |
| 348 | </td></tr> |
| 349 | |
| 350 | <tr><td>reset.post_delay</td> |
| 351 | <td>float</td> |
| 352 | <td>0.1</td> |
| 353 | <td> |
| 354 | Number of seconds to delay after a reset is issued. |
| 355 | </td></tr> |
| 356 | |
| 357 | <tr><td>reset.dap_recover.timeout</td> |
| 358 | <td>float</td> |
| 359 | <td>5.0</td> |
| 360 | <td> |
| 361 | Timeout for waiting for the DAP to be accessible after reset, in seconds. If the timeout lapses, an attempt |
| 362 | will be made to reconnect the DP and retry. |
| 363 | </td></tr> |
| 364 | |
| 365 | <tr><td>reset.core_recover.timeout</td> |
| 366 | <td>float</td> |
| 367 | <td>2.0</td> |
| 368 | <td> |
| 369 | Timeout in seconds for waiting for a core to be accessible after reset. A warning is printed if the timeout |
| 370 | lapses. Set to 0 to disable the core accessibility test. For halting reset, this is also the timeout for waiting |
| 371 | for the core to halt. |
| 372 | </td></tr> |
| 373 | |
| 374 | <tr><td>reset.halt_timeout</td> |
| 375 | <td>float</td> |
| 376 | <td>2.0</td> |
| 377 | <td> |
| 378 | Timeout in seconds for waiting for the core to halt after a reset and halt. |
| 379 | </td></tr> |
| 380 | |
| 381 | <tr><td>resume_on_disconnect</td> |
| 382 | <td>bool</td> |
| 383 | <td>True</td> |
| 384 | <td> |
| 385 | Whether to disable debug control and resume the target when disconnecting. |
| 386 | |
| 387 | When True, then upon disconnect all CPUs are resumed, and DWT and other trace related blocks are disabled (`DEMCR` system register is cleared). |
| 388 | If False, the target CPU states are left unchanged and any enabled debug hardware (DWT, ITM) remains enabled. |
| 389 | In all cases, breakpoints and watchpoints are removed prior to disconnect. |
| 390 | </td></tr> |
| 391 | |
| 392 | <tr><td>scan_all_aps</td> |
| 393 | <td>bool</td> |
| 394 | <td>False</td> |
| 395 | <td> |
| 396 | Controls whether all 256 ADIv5 AP addresses will be probed. |
| 397 | </td></tr> |
| 398 | |
| 399 | <tr><td>serve_local_only</td> |
| 400 | <td>bool</td> |
| 401 | <td>True</td> |
| 402 | <td> |
| 403 | When this option is True, the GDB server, probe server, stdio server, rtt server, and raw SWV server are only served |
| 404 | on localhost, making them inaccessible across the network. Set to False to enable connecting to these ports |
| 405 | from any machine on the network. |
| 406 | </td></tr> |
| 407 | |
| 408 | <tr><td>smart_flash</td> |
| 409 | <td>bool</td> |
| 410 | <td>True</td> |
| 411 | <td> |
| 412 | If set to True, the flash loader will attempt to not program pages whose contents are not going to |
| 413 | change by scanning target flash memory. A value of False will force all pages to be erased and |
| 414 | programmed. |
| 415 | </td></tr> |
| 416 | |
| 417 | <tr><td>target_override</td> |
| 418 | <td>str</td> |
| 419 | <td><i>No default</i></td> |
| 420 | <td> |
| 421 | Target type name to use instead of default board target or default <tt>cortex_m</tt>. |
| 422 | </td></tr> |
| 423 | |
| 424 | <tr><td>test_binary</td> |
| 425 | <td>str</td> |
| 426 | <td><i>No default</i></td> |
| 427 | <td> |
| 428 | Specify the test binary file name used by the functional test suite (in the <tt>test/</tt> directory). The |
| 429 | binary must be in the <tt>binaries/</tt> directory. This option is most useful when set in a board config |
| 430 | file for running the functional tests on boards that cannot be automatically detected. |
| 431 | </td></tr> |
| 432 | |
| 433 | <tr><td>user_script</td> |
| 434 | <td>str</td> |
| 435 | <td><i>No default</i></td> |
| 436 | <td> |
| 437 | Path of the user script file. |
| 438 | </td></tr> |
| 439 | |
| 440 | <tr><td>warning.cortex_m_default</td> |
| 441 | <td>bool</td> |
| 442 | <td><i>True</i></td> |
| 443 | <td>Whether to show the warning when no target type is selected and the default cortex_m target |
| 444 | type is used. The warning is never shown if the cortex_m target type is explicitly specified. |
| 445 | </td></tr> |
| 446 | |
| 447 | </table> |
| 448 | |
| 449 | ## Extended options with multicore support |
| 450 | |
| 451 | These session options offer extended configuration using either a single setting or a per-core setting, |
| 452 | using a list with an entry for each core. When one of the following options is set using a comma separated list |
| 453 | inside square brackets [], the per-core assignment is encoded by the index (position) of the value in |
| 454 | that list. When using a list, all cores must have a corresponding entry. |
| 455 | |
| 456 | <table> |
| 457 | |
| 458 | <tr><th>Option Name</th><th>Type</th><th>Default</th><th>Description</th></tr> |
| 459 | |
| 460 | <tr><td>gdbserver_port</td> |
| 461 | <td>int, list of int</td> |
| 462 | <td>3333</td> |
| 463 | <td>Base TCP port for the GDB Server. For multicore targets the zero-based core number will be added to |
| 464 | the value unless a list is specified. |
| 465 | |
| 466 | Examples: |
| 467 | <ul> |
| 468 | <li><tt>3343</tt>, where in case of a multicore target, TCP port 3343 is assigned to |
| 469 | <tt>core0</tt>, TCP port 3344 is assigned to <tt>core1</tt>, and so on.</li> |
| 470 | <li><tt>[3343, 3334]</tt>, where TCP port 3343 is assigned to <tt>core0</tt> and TCP port |
| 471 | 3334 is assigned to <tt>core1</tt>.</li> |
| 472 | </ul> |
| 473 | </td></tr> |
| 474 | |
| 475 | <tr><td>stdio_mode</td> |
| 476 | <td>str, list of str</td> |
| 477 | <td>'server'</td> |
| 478 | <td>Controls connection to standard I/O. Must be one of 'off', 'console', 'server', or 'file'. For multicore devices |
| 479 | the mode applies to all cores unless it is specified as a list. This session option is preferred over the |
| 480 | <tt>semihost_console_type</tt> option. |
| 481 | |
| 482 | Examples: |
| 483 | <ul> |
| 484 | <li><tt>console</tt>, where the standard I/O for all cores is routed to the console.</li> |
| 485 | <li><tt>[console, server]</tt>, where the standard I/O for <tt>core0</tt> is routed to the |
| 486 | console and the standard I/O for <tt>core1</tt> is routed to the Telnet Server.</li> |
| 487 | </ul> |
| 488 | </td></tr> |
| 489 | |
| 490 | <tr><td>stdio_port</td> |
| 491 | <td>int, list of int</td> |
| 492 | <td>4444</td> |
| 493 | <td>The option applies only when <tt>stdio_mode</tt> is set to 'server'. Base TCP port for the Telnet Server. |
| 494 | For multicore targets the zero-based core number will be added to the value unless a list is specified. |
| 495 | |
| 496 | Examples: |
| 497 | <ul> |
| 498 | <li><tt>4434</tt>, where in case of a multicore target, TCP port 4434 is assigned to |
| 499 | <tt>core0</tt>, TCP port 4435 is assigned to <tt>core1</tt>, and so on.</li> |
| 500 | <li><tt>[4434, 4443]</tt>, where TCP port 4434 is assigned to <tt>core0</tt> and TCP port |
| 501 | 4443 is assigned to <tt>core1</tt>.</li> |
| 502 | </ul> |
| 503 | </td></tr> |
| 504 | |
| 505 | <tr><td>stdio_file_in</td> |
| 506 | <td>str, list of str</td> |
| 507 | <td><i><target>.in</i></td> |
| 508 | <td>The option applies only when <tt>stdio_mode</tt> is set to 'file'. Input filename to use as <i>stdin</i>. |
| 509 | When a single string is used, the core number (_<core>) will be appended to the filename |
| 510 | in case of multicore targets. |
| 511 | |
| 512 | Examples: |
| 513 | <ul> |
| 514 | <li><tt>mytarget.in</tt>, where in case of a multicore target, the filenames will be |
| 515 | <tt>mytarget_0.in</tt> assigned to <tt>core0</tt>, <tt>mytarget_1.in</tt> assigned to <tt>core1</tt>, |
| 516 | and so on.</li> |
| 517 | <li><tt>[mytarget_cm4.in, mytarget_cm0.in]</tt>, where <tt>mytarget_cm4.in</tt> is |
| 518 | assigned to <tt>core0</tt> and <tt>mytarget_cm0.in</tt> is assigned to <tt>core1</tt>.</li> |
| 519 | </ul> |
| 520 | </td></tr> |
| 521 | |
| 522 | <tr><td>stdio_file_out</td> |
| 523 | <td>str, list of str</td> |
| 524 | <td><i><target>.out</i></td> |
| 525 | <td>The option applies only when <tt>stdio_mode</tt> is set to 'file'. Output filename to use as <i>stdout</i>. |
| 526 | When a single string is used, the core number (_<core>) will be appended to the filename |
| 527 | in case of multicore targets. |
| 528 | |
| 529 | Examples: |
| 530 | <ul> |
| 531 | <li><tt>mytarget.out</tt>, where in case of a multicore target, the filenames will be |
| 532 | <tt>mytarget_0.out</tt> assigned to <tt>core0</tt>, <tt>mytarget_1.out</tt> assigned to <tt>core1</tt>, |
| 533 | and so on.</li> |
| 534 | <li><tt>[mytarget_cm4.out, mytarget_cm0.out]</tt>, where <tt>mytarget_cm4.out</tt> is |
| 535 | assigned to <tt>core0</tt> and <tt>mytarget_cm0.out</tt> is assigned to <tt>core1</tt>.</li> |
| 536 | </ul> |
| 537 | </td></tr> |
| 538 | |
| 539 | </table> |
| 540 | |
| 541 | ## RTT and SystemView options |
| 542 | |
| 543 | <table> |
| 544 | |
| 545 | <tr><th>Option Name</th><th>Type</th><th>Default</th><th>Description</th></tr> |
| 546 | |
| 547 | <tr><td>rtt</td> |
| 548 | <td>YAML Node</td> |
| 549 | <td><i>No default</i></td> |
| 550 | <td><p>Configuration for <a href="https://www.segger.com/products/debug-probes/j-link/technology/about-real-time-transfer/">SEGGER RTT</a></p> |
| 551 | <pre> |
| 552 | rtt: |
| 553 | - pname: # [optional] Processor identifier (required for multicore devices). |
| 554 | control-block: # [required] RTT control block discovery in target memory. |
| 555 | address: # [optional] Explicit address or start of scan range when size is provided. |
| 556 | size: # [optional] Size of the memory range to scan. |
| 557 | auto-detect: # [optional] Scan default RAM regions. Default=false |
| 558 | channel: # [required] List of RTT channel configurations. |
| 559 | - number: # [required] Channel number. |
| 560 | mode: # [required] Channel mode: |
| 561 | # stdio - Connects channel to standard input/output. |
| 562 | # server - Exposes channel over a TCP server. |
| 563 | # systemview - Saves channel data to *.SVDat file for SEGGER SystemView. |
| 564 | # systemview-server - Streams live data to SEGGER SystemView. |
| 565 | # file - Routes channel data to and from files. |
| 566 | port: # [optional] TCP port number (required for 'server' and 'systemview-server'). |
| 567 | file-out: # [optional] Output file path (only for 'file' mode; default: <target>_core<X>_ch<Y>.out") |
| 568 | file-in: # [optional] Input file path (only for 'file' mode; default: <target>_core<X>_ch<Y>.in") |
| 569 | </pre> |
| 570 | <p>Example:</p> |
| 571 | <ul> |
| 572 | <li>Command line:<br/> |
| 573 | <tt>-O rtt="[{control-block: {address: 0x20000000, size: 0x00020000}, channel: [{number: 0, mode: stdio}, {number: 1, mode: systemview}]}]"</tt></li> |
| 574 | <li>Config file:<br/> |
| 575 | <pre>rtt: |
| 576 | - control-block: |
| 577 | address: 0x20000000 |
| 578 | size: 0x00020000 |
| 579 | channel: |
| 580 | - number: 0 |
| 581 | mode: stdio |
| 582 | - number: 1 |
| 583 | mode: systemview |
| 584 | </pre></li></ul></td></tr> |
| 585 | |
| 586 | <tr><td>systemview_file</td> |
| 587 | <td>str</td> |
| 588 | <td><i><target>.SVDat</i></td> |
| 589 | <td>Output filename to capture SystemView data.</td></tr> |
| 590 | |
| 591 | <tr><td>systemview_auto_start</td> |
| 592 | <td>bool</td> |
| 593 | <td>True</td> |
| 594 | <td>Whether to automatically start SystemView recording.</td></tr> |
| 595 | |
| 596 | <tr><td>systemview_auto_stop</td> |
| 597 | <td>bool</td> |
| 598 | <td>True</td> |
| 599 | <td>Whether to automatically stop SystemView recording.</td></tr> |
| 600 | |
| 601 | </table> |
| 602 | |
| 603 | ## GDB server options |
| 604 | |
| 605 | These session options are currently only applied when running the GDB server. |
| 606 | |
| 607 | <table> |
| 608 | |
| 609 | <tr><th>Option Name</th><th>Type</th><th>Default</th><th>Description</th></tr> |
| 610 | |
| 611 | <tr><td>enable_semihosting</td> |
| 612 | <td>bool</td> |
| 613 | <td>False</td> |
| 614 | <td> |
| 615 | Set to True to handle semihosting requests. Also see the <tt>semihost_console_type</tt> option. |
| 616 | </td></tr> |
| 617 | |
| 618 | <tr><td>enable_swv</td> |
| 619 | <td>bool</td> |
| 620 | <td>False</td> |
| 621 | <td> |
| 622 | Whether to enable SWV printf output over the semihosting console. Requires the <tt>swv_system_clock</tt> |
| 623 | option to be set. The SWO baud rate can be controlled with the <tt>swv_clock</tt> option. |
| 624 | </td></tr> |
| 625 | |
| 626 | <tr><td>debug.status_fault_retry_timeout</td> |
| 627 | <td>float</td> |
| 628 | <td>1</td> |
| 629 | <td> |
| 630 | Duration in seconds that a failed target status check will be retried before an error is raised. Only |
| 631 | applies while the target is running after a resume operation in the debugger and pyOCD is waiting for |
| 632 | it to halt again. |
| 633 | </td></tr> |
| 634 | |
| 635 | <tr><td>gdbserver_port</td> |
| 636 | <td>int</td> |
| 637 | <td>3333</td> |
| 638 | <td> |
| 639 | Base TCP port for the gdbserver. The core number, which is 0 for the primary core, will be added to |
| 640 | this value. |
| 641 | </td></tr> |
| 642 | |
| 643 | <tr><td>persist</td> |
| 644 | <td>bool</td> |
| 645 | <td>False</td> |
| 646 | <td> |
| 647 | If True, the GDB server will not exit after GDB disconnects. |
| 648 | </td></tr> |
| 649 | |
| 650 | <tr><td>report_core_number</td> |
| 651 | <td>bool</td> |
| 652 | <td>False</td> |
| 653 | <td> |
| 654 | Whether gdb server should report core number as part of the per-thread information. |
| 655 | </td></tr> |
| 656 | |
| 657 | <tr><td>rtos.enable</td> |
| 658 | <td>bool</td> |
| 659 | <td>True</td> |
| 660 | <td> |
| 661 | Overall enable flag for RTOS aware debugging. By default it's enabled but can be switched off |
| 662 | if necessary. |
| 663 | </td></tr> |
| 664 | |
| 665 | <tr><td>rtos.name</td> |
| 666 | <td>str</td> |
| 667 | <td><i>No default</i></td> |
| 668 | <td> |
| 669 | Name of the RTOS plugin to use. If not set, all RTOS plugins are given a chance to load. |
| 670 | </td></tr> |
| 671 | |
| 672 | <tr><td>semihost_console_type</td> |
| 673 | <td>str</td> |
| 674 | <td>'telnet'</td> |
| 675 | <td> |
| 676 | If set to 'telnet' then the semihosting telnet server will be started. If set to 'console' then |
| 677 | semihosting will print to the console. |
| 678 | </td></tr> |
| 679 | |
| 680 | <tr><td>semihost_use_syscalls</td> |
| 681 | <td>bool</td> |
| 682 | <td>False</td> |
| 683 | <td> |
| 684 | Whether to use GDB syscalls for semihosting file access operations, or to have pyOCD perform the |
| 685 | operations. This is most useful if GDB is running on a remote system. |
| 686 | </td></tr> |
| 687 | |
| 688 | <tr><td>semihost.commandline</td> |
| 689 | <td>str</td> |
| 690 | <td><i>Empty</i></td> |
| 691 | <td> |
| 692 | Program command line string, used for the SYS_GET_CMDLINE semihosting request. |
| 693 | </td></tr> |
| 694 | |
| 695 | <tr><td>step_into_interrupt</td> |
| 696 | <td>bool</td> |
| 697 | <td>False</td> |
| 698 | <td> |
| 699 | Set this option to True to enable interrupts when performing step operations. Otherwise |
| 700 | interrupts will be disabled and step operations cannot be interrupted. |
| 701 | </td></tr> |
| 702 | |
| 703 | <tr><td>swv_clock</td> |
| 704 | <td>int</td> |
| 705 | <td>1000000 (1 MHz)</td> |
| 706 | <td> |
| 707 | Frequency in Hertz of the SWO baud rate. |
| 708 | </td></tr> |
| 709 | |
| 710 | <tr><td>swv_system_clock</td> |
| 711 | <td>int</td> |
| 712 | <td><i>No default</i></td> |
| 713 | <td> |
| 714 | Frequency in Hertz of the target's system clock. Used to compute the SWO baud rate |
| 715 | divider. |
| 716 | </td></tr> |
| 717 | |
| 718 | <tr><td>swv_raw_enable</td> |
| 719 | <td>bool</td> |
| 720 | <td>True</td> |
| 721 | <td> |
| 722 | Enable flag for the raw SWV stream server. |
| 723 | </td></tr> |
| 724 | |
| 725 | <tr><td>swv_raw_port</td> |
| 726 | <td>int</td> |
| 727 | <td>3443</td> |
| 728 | <td> |
| 729 | TCP port number for the raw SWV stream server. |
| 730 | </td></tr> |
| 731 | |
| 732 | <tr><td>swv_raw_file</td> |
| 733 | <td>str</td> |
| 734 | <td>No default</td> |
| 735 | <td> |
| 736 | File path for the raw SWV stream output. |
| 737 | </td></tr> |
| 738 | |
| 739 | <tr><td>telnet_port</td> |
| 740 | <td>int</td> |
| 741 | <td>4444</td> |
| 742 | <td> |
| 743 | Base TCP port number for the semihosting telnet server. The core number, which will be 0 for the |
| 744 | primary core, is added to this value. |
| 745 | </td></tr> |
| 746 | |
| 747 | <tr><td>vector_catch</td> |
| 748 | <td>str</td> |
| 749 | <td>'h'</td> |
| 750 | <td> |
| 751 | Enable vector catch sources, one letter per enabled source in any order, or |
| 752 | <tt>all</tt> or <tt>none</tt>. |
| 753 | |
| 754 | The source letters are: |
| 755 | - <tt>h</tt>=hard fault |
| 756 | - <tt>b</tt>=bus fault |
| 757 | - <tt>m</tt>=mem fault |
| 758 | - <tt>e</tt>=secure fault |
| 759 | - <tt>i</tt>=irq err |
| 760 | - <tt>s</tt>=state err |
| 761 | - <tt>c</tt>=check err |
| 762 | - <tt>p</tt>=nocp |
| 763 | - <tt>r</tt>=reset |
| 764 | - <tt>a</tt>=all |
| 765 | - <tt>n</tt>=none |
| 766 | </td></tr> |
| 767 | |
| 768 | <tr><td>register_fields</td> |
| 769 | <td>bool</td> |
| 770 | <td>True</td> |
| 771 | <td> |
| 772 | When set to True, registers with bitfields will have their respective bitfields defined for |
| 773 | presentation in gdb. |
| 774 | </td></tr> |
| 775 | |
| 776 | </table> |
| 777 | |
| 778 | ## CMSIS-DAP probe options |
| 779 | |
| 780 | These session options are available when the CMSIS-DAP debug probe plugin is active. |
| 781 | |
| 782 | <table> |
| 783 | |
| 784 | <tr><th>Option Name</th><th>Type</th><th>Default</th><th>Description</th></tr> |
| 785 | |
| 786 | <tr><td>cmsis_dap.deferred_transfers</td> |
| 787 | <td>bool</td> |
| 788 | <td>True</td> |
| 789 | <td> |
| 790 | Whether to use deferred transfers in the CMSIS-DAP probe backend. By disabling deferred transfers, |
| 791 | all writes take effect immediately. However, performance is negatively affected. |
| 792 | </td></tr> |
| 793 | |
| 794 | <tr><td>cmsis_dap.limit_packets</td> |
| 795 | <td>bool</td> |
| 796 | <td>False</td> |
| 797 | <td> |
| 798 | Restrict CMSIS-DAP backend to using a single in-flight command at a time. This is useful on some systems |
| 799 | where USB is problematic, in particular virtual machines. |
| 800 | </td></tr> |
| 801 | |
| 802 | </table> |
| 803 | |
| 804 | ## J-Link probe options |
| 805 | |
| 806 | These session options are available when the SEGGER J-Link debug probe plugin is active. |
| 807 | |
| 808 | <table> |
| 809 | |
| 810 | <tr><th>Option Name</th><th>Type</th><th>Default</th><th>Description</th></tr> |
| 811 | |
| 812 | <tr><td>jlink.device</td> |
| 813 | <td>str</td> |
| 814 | <td><i>No default</i></td> |
| 815 | <td> |
| 816 | If this option is set to a supported J-Link device name, then the J-Link will be asked connect |
| 817 | using this name. Otherwise, when unset, the J-Link is configured for only the low-level CoreSight operations |
| 818 | required by pyOCD. Ordinarily, it does not need to be set. |
| 819 | </td></tr> |
| 820 | |
| 821 | <tr><td>jlink.non_interactive</td> |
| 822 | <td>bool</td> |
| 823 | <td>True</td> |
| 824 | <td> |
| 825 | Controls whether the J-Link DLL is allowed to present UI dialog boxes and its control |
| 826 | panel. Note that dialog boxes will actually still be visible, but the default option |
| 827 | will be chosen automatically after 5 seconds. |
| 828 | |
| 829 | Note: This has the effect of also silencing dialog boxes that appear when |
| 830 | updating firmware / to confirm updating firmware. |
| 831 | </td></tr> |
| 832 | |
| 833 | <tr><td>jlink.power</td> |
| 834 | <td>bool</td> |
| 835 | <td>True</td> |
| 836 | <td> |
| 837 | Enable target power when connecting via a JLink probe, and disable power when disconnecting. |
| 838 | Default is True. |
| 839 | </td></tr> |
| 840 | |
| 841 | </table> |
| 842 | |
| 843 | ## Picoprobe options |
| 844 | |
| 845 | These session options are available when the Picoprobe debug probe plugin is active. |
| 846 | |
| 847 | <table> |
| 848 | |
| 849 | <tr><th>Option Name</th><th>Type</th><th>Default</th><th>Description</th></tr> |
| 850 | |
| 851 | <tr><td>picoprobe.safeswd</td> |
| 852 | <td>bool</td> |
| 853 | <td>False</td> |
| 854 | <td> |
| 855 | Use safer but slower SWD transfer function with Picoprobe. |
| 856 | Default is False, so possible WAIT or FAULT SWD acknowledges and protocol errors will not be caught immediately. |
| 857 | </td></tr> |
| 858 | |
| 859 | </table> |
| 860 | |
| 861 | ## STLink options |
| 862 | |
| 863 | These session options are available when the STLink debug probe plugin is active. |
| 864 | |
| 865 | <table> |
| 866 | |
| 867 | <tr><th>Option Name</th><th>Type</th><th>Default</th><th>Description</th></tr> |
| 868 | |
| 869 | <tr><td>stlink.v3_prescaler</td> |
| 870 | <td>int</td> |
| 871 | <td>1</td> |
| 872 | <td> |
| 873 | Sets the HCLK prescaler of an STLinkV3, changing performance versus power tradeoff. |
| 874 | The value must be one of 1=high performance (default), 2=normal, or 4=low power. |
| 875 | </td></tr> |
| 876 | |
| 877 | </table> |