You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+82-18Lines changed: 82 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,23 +33,25 @@ We recommend to install the following extensions to simplify the user experience
33
33
34
34
## Debug Setup
35
35
36
-
All debug setups require a GDB installation which supports the GDB remote protocol and can establish the connection to a GDB server like pyOCD.
36
+
All debug setups require a GDB installation that supports the GDB remote protocol and can connect to a GDB server like pyOCD.
37
37
38
-
We recommend to install the `GCC compiler for ARM CPUs` with the `Arm Tools Environment Manager` extension to get access to such a GDB variant. It comes with `arm-none-eabi-gdb` which is used in this extension's default debug configurations.
38
+
We recommend to install the `GCC compiler for ARM CPUs` using the `Arm Tools Environment Manager` extension.<br>
39
+
It comes with `arm-none-eabi-gdb` which is used in the Arm CMSIS Debugger default debug configurations.
39
40
40
41
### pyOCD Debug Setup
41
42
42
43
This extension includes a pyOCD distribution which is used by default.
43
44
44
-
If you would like to use a different pyOCD installation, then update the `target`.`server`item of your debug launch configuration with the path to its `pyocd` executable.
45
+
Update your debug configuration's `target`>`server`setting to use a different pyOCD installation. Enter the full path to its `pyocd` executable (including the file name).
45
46
46
47
### SEGGER® J-LINK® Debug Setup
47
48
48
49
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
50
-
Ensure the installation folder is added to your system's `PATH` environment variable to use default debug configurations provided by this extension. Alternatively, update the `target`.`server` item of your debug launch configuration with the path to the J-LINK GDB server executable to use.
51
+
The extension expects the installation folder to be on your system `PATH` environment variable.<br>
52
+
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
53
52
-
## Additional Extension Functionality
54
+
## Extension Functionality
53
55
54
56
This extension contributes additional functionality to more seamlessly integrate the included extensions:
55
57
@@ -63,32 +65,94 @@ This section describes the contributed pseudo debugger types and their support t
63
65
64
66
#### CMSIS Debugger (pyOCD) - `cmsis-debug-pyocd`
65
67
66
-
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`.
68
+
The `cmsis-debug-pyocd` debugger type allows to add default debug configurations to the workspace's `launch.json` file for debug with GDB and pyOCD.<br>
69
+
Those configurations then use the `gdbtarget` debugger type registered by the CDT GDB Debug Adapter Extension.
67
70
68
-
In addition this extension contributes a debug configuration resolver which automatically fills the following gaps during debug launch:
71
+
Additionaly, the extension contributes a debug configuration resolver which automatically fills the following gaps during debug launch:
69
72
70
-
- If option `target`.`server` is set to `pyocd`, then it expands this option to the absolute path of the built-in pyOCD distribution.
71
-
-Adds/extends the `target`.`serverParameters` list of `pyocd` command line arguments:
73
+
- If option `target`>`server` is set to `pyocd`, then it expands to the absolute path of the built-in pyOCD distribution.
74
+
-Extends the `target`>`serverParameters` list of `pyocd` command line arguments:
72
75
- Prepends `gdbserver` if not present.
73
-
- Appends `--port` and the corresponding `port`value if `target`.`port` is set.
74
-
- Appends `--cbuild-run` and the corresponding `cbuildRunFile` path if `cmsis`.`cbuildRunFile` is set.
76
+
- Appends `--port <gdbserver_port>` if the `target`>`port`setting is set, where `<gdbserver_port>` gets that port setting's value.
77
+
- Appends `--cbuild-run` and the corresponding `cbuildRunFile` path if `cmsis`>`cbuildRunFile` is set.
75
78
76
79
**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.
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`.
83
+
The `cmsis-debug-jlink` debugger type allows to add default debug configurations to the workspace's `launch.json` file for debug with GDB and the SEGGER J-LINK GDB server.<br>
84
+
Those configurations then use the `gdbtarget` debugger type registered by the CDT GDB Debug Adapter Extension.
81
85
82
-
**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.
86
+
**Note**: The generated default debug configuration uses the value `JLinkGDBServer` as `target`>`server` setting. This executable has differing behavior on supported host platform:
87
+
* Linux and macOS: A GUI-less version of the GDB server is launched.
88
+
* Windows®: A GDB server with GUI is launched. Update `target`>`server` to `JLinkGDBServerCL` to launch a GUI-less version on Windows, too.
83
89
84
-
In addition this extension contributes a debug configuration resolver which automatically fills the following gaps during debug launch:
90
+
Additionaly, the extension contributes a debug configuration resolver which automatically fills the following gaps during debug launch:
85
91
86
-
-Adds/extends the `target`.`serverParameters` list of `JLinkGDBServer`/`JLinkGDBServerCL` command line arguments:
87
-
- Appends `--port` and the corresponding `port`value if `target`.`port` is set.
92
+
-Extends the `target`>`serverParameters` list of `JLinkGDBServer`/`JLinkGDBServerCL` command line arguments:
93
+
- Appends `--port <gdbserver_port>` if the `target`>`port`setting is set, where `<gdbserver_port>` gets that port setting's value.
88
94
89
-
## Known Limitations
95
+
## Known Limitations and Workarounds
90
96
91
-
- Requires ELF files built with GCC and DWARF5 debug information to operate seamlessly.
97
+
### pyOCD fails to load `*.cbuild-run.yml` in the default configuration
98
+
99
+
When I use the default debug configuration for pyOCD, I get errors that pyOCD cannot find the solutions `*.cbuild-run.yml` file.
100
+
101
+
**Possible Reasons**:
102
+
103
+
1. The application's CSolution was initially built with a CMSIS-Toolbox version prior to v2.8.0 which is the first version to generate `*.cbuild-run.yml` files.
104
+
1. You are using an [Arm CMSIS Solution](https://marketplace.visualstudio.com/items?itemName=Arm.cmsis-csolution) prior to v1.52.0 which is the first version to fully support the `${command:cmsis-csolution.getCbuildRunFile}` command.
105
+
106
+
**Workarounds/Solutions**:
107
+
108
+
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.
109
+
1. Update to Arm CMSIS Solution 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).
110
+
111
+
### AXF files built with Arm Compiler 6 toolchain
112
+
113
+
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.
114
+
```
115
+
warning: Loadable section "RW_RAM0" outside of ELF segments
116
+
in /path/to/my/application.axf
117
+
```
118
+
119
+
**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.
120
+
121
+
**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/):
122
+
123
+
1. Edit the `*.cproject.yml` file(s) of your application.
124
+
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:
125
+
```
126
+
output:
127
+
type:
128
+
- elf
129
+
- hex
130
+
```
131
+
1. Build the solution.
132
+
1. Keep the default configuration's `program` setting as is.
1. Modify the default debug configuration's `initCommands` list, so that the `load` command gets the relative path to the generated HEX file.
137
+
```
138
+
"initCommands": [
139
+
"load ./relative/path/to/my/application.hex",
140
+
"break main"
141
+
],
142
+
```
143
+
144
+
The debugger then loads the debug information from the ELF file. But uses the HEX file instead of the ELF file for program download.
145
+
146
+
### `arm-none-eabi-gdb` requires DWARF5 debug information
147
+
148
+
`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>
149
+
```
150
+
warning: (Internal error: pc 0x8006a18 in read in CU, but not in symtab.)
151
+
```
152
+
153
+
**Possible Reason**: `arm-none-eabi-gdb` works best with DWARF debug information of standard version 5.
154
+
155
+
**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, assembler, and linker.
0 commit comments