Skip to content

Commit 9cbea6e

Browse files
jreineckearmTeoMahnicRobertRostohar
authored
Docs updates and release preparations v0.1.0 (#138)
* docs updates - debug setup Signed-off-by: Jens Reinecke <jens.reinecke@arm.com> * readme updates Signed-off-by: Jens Reinecke <jens.reinecke@arm.com> * changelog version update Signed-off-by: Jens Reinecke <jens.reinecke@arm.com> * pyocd changelog draft Signed-off-by: Jens Reinecke <jens.reinecke@arm.com> * Apply suggestions from code review (Teo) Co-authored-by: Teo Mahnic <teo.mahnic@arm.com> * Apply suggestions from code review (Robert) Co-authored-by: Robert Rostohar <robert.rostohar@arm.com> * reordering after merging suggestions Signed-off-by: Jens Reinecke <jens.reinecke@arm.com> * bump pyocd version Signed-off-by: Jens Reinecke <jens.reinecke@arm.com> * feedback (Christopher) Signed-off-by: Jens Reinecke <jens.reinecke@arm.com> --------- Signed-off-by: Jens Reinecke <jens.reinecke@arm.com> Co-authored-by: Teo Mahnic <teo.mahnic@arm.com> Co-authored-by: Robert Rostohar <robert.rostohar@arm.com>
1 parent 78576f2 commit 9cbea6e

File tree

3 files changed

+105
-23
lines changed

3 files changed

+105
-23
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# Change Log
22

33
## Unreleased
4+
- Updates included pyOCD distribution
5+
- Fixes [#92](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/issues/92): `monitor reset halt` command fails for LPCXpresso55S69 if using CMSIS Pack support in pyOCD.
6+
- Fixes [#93](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/issues/93): Download to LPC55S69 flash with GDB and pyOCD ends in errors.
7+
- Fixes [#94](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/issues/94): Cannot connect to NXP FRDM-K32L3A6 with pyOCD.
8+
- Fixes support for `<memory>` elements from CMSIS PDSC files.
9+
- Fixes progress bar output during program download.
10+
- Fixes handling of `__ap` variable in debug sequences.
11+
- Improves connection robustness and DP sticky error bits handling for temporary target communication losses and `__errorcontrol` usage (CMSIS debug descriptions). For example in reset scenarios.
12+
- Updates CMSIS-DAP probe detection (filters out Cypress KitProg3 bridge).
13+
- Extends and improves support for `*.cbuild-run.yml` debug configuration files.
14+
15+
## 0.0.3
416
- Fixes [#84](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/issues/84): Cannot use cbuild-run files with pyOCD without CMSIS_PACK_ROOT environment variable.
517
- Implements [#83](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/issues/83): Make built-in pyOCD available in VS Code terminals.
618
- Note that there is a known issue with a pyOCD installation in Python virtual environments taking precedence over the built-in pyOCD variant.

README.md

Lines changed: 92 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,27 @@ We recommend to install the following extensions to simplify the user experience
3131
- [Arm Tools Environment Manager](https://marketplace.visualstudio.com/items?itemName=Arm.environment-manager), an extension that allows to download, install, and manage software development tools using [Microsoft® Vcpkg](https://vcpkg.io/en/index.html) artifacts. Use this extension to for example install the `GCC compiler for ARM CPUs` which comes with a GDB variant for Arm CPUs.
3232
- [Arm CMSIS Solution](https://marketplace.visualstudio.com/items?itemName=Arm.cmsis-csolution), an extension that is a graphical user interface for csolution projects that use the [CMSIS-Toolbox](https://open-cmsis-pack.github.io/cmsis-toolbox/). Use this extension to build your csolution projects, to generate `*.cbuild-run.yml` debug configuration files, and to make use of contributed commands in your debug launch configurations.
3333

34-
## pyOCD Debug Setup
34+
## Debug Setup
3535

36-
- Install `GCC compiler for ARM CPUs` with the `Arm Tools Environment Manager` extension to get access to a GDB (`arm-none-eabi-gdb`).
36+
The debug setup requires a GDB installation supporting the GDB remote protocol and that can connect to a GDB server like pyOCD.
3737

38-
## SEGGER® J-LINK® Debug Setup
38+
We recommend to install the [`Arm GNU Toolchain`](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) using the `Arm Tools Environment Manager` extension. It comes with `arm-none-eabi-gdb` which is used in the Arm CMSIS Debugger default debug configurations.
3939

40-
- Install the latest [J-LINK Software and Documentation Pack](https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPack) from [SEGGER](https://www.segger.com/). Ensure all required drivers and host platform specific settings are done.
41-
- Ensure the installation folder is added to your system's `PATH` environment variable. Alternatively, you can add an absolute path to your installation in the debug launch configuration.
40+
### pyOCD Debug Setup
4241

43-
## Additional Extension Functionality
42+
This extension includes a pyOCD distribution which is used by default.
4443

45-
This extension contributes additional functionality to more seamlessly integrate the included extensions:
44+
If you wish to use a different pyOCD installation, enter the full path to the executable (including the file name) in the `target`>`server` setting.
45+
46+
### SEGGER® J-LINK® Debug Setup
47+
48+
Install the latest [J-LINK Software and Documentation Pack](https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPack) from [SEGGER](https://www.segger.com/). Ensure all required drivers and host platform specific settings are done.
49+
50+
The extension expects the installation folder to be on your system `PATH` environment variable. Alternatively, update your debug configuration's `target`>`server` setting to contain the full path to the J-LINK GDB server executable (including the file name).
51+
52+
## Extension Functionality
53+
54+
This extension contributes additional functionality to work seamlessly with other extensions.
4655

4756
- The pseudo debugger types `cmsis-debug-pyocd` and `cmsis-debug-jlink`. These types allow a more seamless integration into your IDE. However, these are not full debug adapters but generate debug configurations of type `gdbtarget` which comes with the [CDT GDB Debug Adapter Extension](https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.cdt-gdb-vscode).
4857
- A [debug configuration provider](https://code.visualstudio.com/api/references/vscode-api#DebugConfigurationProvider) for the type `gdbtarget` which comes with the [CDT GDB Debug Adapter Extension](https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.cdt-gdb-vscode). This provider automatically fills in default values for known remote GDB servers when launching a debug session.
@@ -54,33 +63,94 @@ This section describes the contributed pseudo debugger types and their support t
5463

5564
#### CMSIS Debugger (pyOCD) - `cmsis-debug-pyocd`
5665

57-
The `cmsis-debug-pyocd` debugger type allows to add default debug configurations to the workspace's `launch.json` file to debug via GDB and pyOCD. The actually used debugger type is `gdbtarget`.
66+
The `cmsis-debug-pyocd` debugger type is used to add a debug configuration in the `launch.json` file for debugging with GDB and pyOCD.<br>
67+
This configuration uses the `gdbtarget` debugger type registered by the CDT GDB Debug Adapter Extension.
5868

59-
In addition this extension contributes a debug configuration resolver which automatically fills the following gaps during debug launch:
69+
Additionaly, the extension contributes a debug configuration resolver which automatically fills the following gaps during debug launch:
6070

61-
- If option `target`.`server` is set to `pyocd`, then it expands this option to the absolute path of the built-in pyOCD distribution.
62-
- Adds/extends the `target`.`serverParameters` list of `pyocd` command line arguments:
71+
- If option `target`>`server` is set to `pyocd`, then it expands to the absolute path of the built-in pyOCD distribution.
72+
- Extends the `target`>`serverParameters` list of `pyocd` command line arguments:
6373
- Prepends `gdbserver` if not present.
64-
- Appends `--port` and the corresponding `port` value if `target`.`port` is set.
65-
- Appends `--cbuild-run` and the corresponding `cbuildRunFile` path if `cmsis`.`cbuildRunFile` is set.
74+
- Appends `--port <gdbserver_port>` if the `target`>`port` setting is set, where `<gdbserver_port>` gets that port setting's value.
75+
- Appends `--cbuild-run` and the corresponding `cbuildRunFile` path if `cmsis`>`cbuildRunFile` is set.
6676

67-
**Note**: The built-in version of pyOCD supports the command line option `--cbuild-run`. However, this is a new option which isn't contained yet in releases outside this extension.
77+
**Note**: The built-in version of pyOCD supports the command line option `--cbuild-run` which isn't available in releases outside this extension.
6878

6979
#### CMSIS Debugger (J-LINK) - `cmsis-debug-jlink`
7080

71-
The `cmsis-debug-jlink` debugger type allows to add default debug configurations to the workspace's `launch.json` file to debug via GDB and the SEGGER J-LINK GDB server. The actually used debugger type is `gdbtarget`.
81+
The `cmsis-debug-jlink` debugger type is used to add a debug configuration in the launch.json file for debug with GDB and the SEGGER J-LINK GDB server.<br>
82+
This configuration uses the `gdbtarget` debugger type registered by the CDT GDB Debug Adapter Extension.
83+
84+
**Note**: The generated default debug configuration uses the value `JLinkGDBServer` as `target`>`server` setting. This executable has differing behavior on supported host platform:
85+
* Linux and macOS: A GUI-less version of the GDB server is launched.
86+
* Windows®: A GDB server with GUI is launched. Update `target`>`server` to `JLinkGDBServerCL` to launch a GUI-less version on Windows, too.
87+
88+
Additionaly, the extension contributes a debug configuration resolver which automatically fills the following gaps during debug launch:
89+
90+
- Extends the `target`>`serverParameters` list of `JLinkGDBServer`/`JLinkGDBServerCL` command line arguments:
91+
- Appends `--port <gdbserver_port>` if the `target`>`port` setting is set, where `<gdbserver_port>` gets that port setting's value.
92+
93+
## Known Limitations and Workarounds
94+
95+
### pyOCD fails to load `*.cbuild-run.yml` in the default configuration
96+
97+
When I use the default debug configuration for pyOCD, I get errors that pyOCD cannot find the solutions `*.cbuild-run.yml` file.
98+
99+
**Possible Reasons**:
100+
101+
1. The application's CMSIS solution was initially built with a CMSIS-Toolbox version prior to v2.8.0 which is the first version to generate `*.cbuild-run.yml` files.
102+
1. You are using an [Arm CMSIS Solution](https://marketplace.visualstudio.com/items?itemName=Arm.cmsis-csolution) extension prior to v1.52.0 which is the first version to fully support the `${command:cmsis-csolution.getCbuildRunFile}` command.
103+
104+
**Workarounds/Solutions**:
105+
106+
1. Update the CMSIS-Toolbox to the latest version. Additionally, you may have to run `cbuild setup --update-rte` in a terminal for a first-time generation of `*.cbuild-run.yml` file in an existing workspace.
107+
1. Update to Arm CMSIS Solution extension v1.52.0. Alternatively, replace `${command:cmsis-csolution.getCbuildRunFile}` with the path to the `*.cbuild-run.yml` in your workspace (`cmsis`>`cbuildRunFile` debug configuration setting).
108+
109+
### AXF files built with Arm Compiler 6 toolchain
110+
111+
When I download an AXF file built with Arm Compiler 6, I see the following warning and my application does not execute correctly. This happens regardless of the selected GDB server.
112+
```
113+
warning: Loadable section "RW_RAM0" outside of ELF segments
114+
in /path/to/my/application.axf
115+
```
116+
117+
**Possible Reason**: `arm-none-eabi-gdb` does not correctly load ELF program segments due to the way that Arm Compiler 6 generates section and program header information when scatterloading is used.
118+
119+
**Workaround**: You can generate a HEX file for the program download, and the ELF file for debug purposes only. The following steps are required if you build a [CSolution](https://open-cmsis-pack.github.io/cmsis-toolbox/build-overview/)-based application with the [CMSIS-Toolbox](https://open-cmsis-pack.github.io/cmsis-toolbox/):
120+
121+
1. Edit the `*.cproject.yml` file(s) of your application.
122+
1. Modify the [`output:type:`](https://open-cmsis-pack.github.io/cmsis-toolbox/YML-Input-Format/#output) node to generate both an `elf` and a `hex` file:
123+
```
124+
output:
125+
type:
126+
- elf
127+
- hex
128+
```
129+
1. Build the solution.
130+
1. Keep the default configuration's `program` setting as is.
131+
```
132+
"program": "${command:cmsis-csolution.getBinaryFile}",
133+
```
134+
1. Modify the default debug configuration's `initCommands` list, so that the `load` command gets the relative path to the generated HEX file.
135+
```
136+
"initCommands": [
137+
"load ./relative/path/to/my/application.hex",
138+
"break main"
139+
],
140+
```
72141

73-
**Note**: The generated default debug configuration uses `JLinkGDBServer` as `target`.`server` setting. The executable with this name has slightly differing behavior depending on your host platform. It launches a GUI-less server on Linux and macOS. Whereas a GDB server with GUI is launched on Windows®. Please change the value to `JLinkGDBServerCL` to suppress the GUI on Windows.
142+
This instructs the debugger to load the debug information from the ELF file and to use the HEX file for program download.
74143

75-
In addition this extension contributes a debug configuration resolver which automatically fills the following gaps during debug launch:
144+
### `arm-none-eabi-gdb` requires DWARF5 debug information
76145

77-
- Adds/extends the `target`.`serverParameters` list of `JLinkGDBServer`/`JLinkGDBServerCL` command line arguments:
78-
- Appends `--port` and the corresponding `port` value if `target`.`port` is set.
146+
`arm-none-eabi-gdb` generates the following warnings when I debug ELF files with [DWARF](https://dwarfstd.org/) debug information of standard version 4 and earlier. And the debug illusion seems to be broken in many places.<br>
147+
```
148+
warning: (Internal error: pc 0x8006a18 in read in CU, but not in symtab.)
149+
```
79150

80-
## Known Limitations
151+
**Possible Reason**: `arm-none-eabi-gdb` works best with DWARF debug information of standard version 5.
81152

82-
- Requires ELF files built with GCC and DWARF5 debug information to operate seamlessly.
83-
- The shipped pyOCD version accepts the new command line option `--cbuild-run`. But only extracts device and DFP names.
153+
**Solution**: Make sure to build your application ELF file with DWARF version 5 debug information. Please refer to your toolchain's user reference manual. This may require updates to all build tools like compiler and assembler. For example use `-gdwarf-5` for `armclang`.
84154

85155
## Trademarks
86156

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,6 @@
251251
"yargs": "^17.7.2"
252252
},
253253
"cmsis": {
254-
"pyocd": "MatthiasHertel80/pyOCD@0.0.0-standalone-cbuild4"
254+
"pyocd": "MatthiasHertel80/pyOCD@0.0.0-standalone-cbuild5"
255255
}
256256
}

0 commit comments

Comments
 (0)