Skip to content

Commit 635b0e9

Browse files
Added troubleshooting, minor corrections (#215)
* Added troubleshooting, minor corrections * Renamed filw * Added note about Windows * Update README.md --------- Co-authored-by: Jens Reinecke <[email protected]>
1 parent 65ec747 commit 635b0e9

File tree

8 files changed

+104
-36
lines changed

8 files changed

+104
-36
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
## 0.1.0
1515
- Updates included pyOCD distribution
16-
- 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.
16+
- 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.
1717
- Fixes [#93](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/issues/93): Download to LPC55S69 flash with GDB and pyOCD ends in errors.
1818
- Fixes [#94](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/issues/94): Cannot connect to NXP FRDM-K32L3A6 with pyOCD.
1919
- Fixes support for `<memory>` elements from CMSIS PDSC files.

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@ The Arm CMSIS Debugger extension is an [extension pack](https://code.visualstudi
2121
The following extensions are included in this extension pack:
2222

2323
- [CDT™ GDB Debug Adapter Extension](https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.cdt-gdb-vscode), an Eclipse CDT.cloud extension that supports debugging using GDB and any other debuggers that supports the MI protocol.
24+
2425
- [Memory Inspector](https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.memory-inspector), an Eclipse CDT.cloud extension that provides a powerful and configurable memory viewer that works with debug adapters.
26+
2527
- [Peripheral Inspector](https://marketplace.visualstudio.com/items?itemName=eclipse-cdt.peripheral-inspector), an Eclipse CDT.cloud extension that provides a CMSIS SVD viewer and works with debug adapters.
2628

2729
## Recommended Extensions
2830

2931
We recommend to install the following extensions to simplify the user experience:
3032

31-
- [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.
33+
- [Arm Tools Environment Manager](https://marketplace.visualstudio.com/items?itemName=Arm.environment-manager), an extension that allows you to download, install, and manage software development tools using [Microsoft® Vcpkg](https://vcpkg.io/en/index.html) artifacts. For example, use this extension to install the [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) which comes with a GDB variant for Arm CPUs.
34+
3235
- [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.
3336

3437
## Debug Setup
@@ -70,9 +73,9 @@ Additionaly, the extension contributes a debug configuration resolver which auto
7073

7174
- If option `target`>`server` is set to `pyocd`, then it expands to the absolute path of the built-in pyOCD distribution.
7275
- Extends the `target`>`serverParameters` list of `pyocd` command line arguments:
73-
- Prepends `gdbserver` if not present.
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.
76+
- Prepends `gdbserver` if not present.
77+
- Appends `--port <gdbserver_port>` if the `target`>`port` setting is set, where `<gdbserver_port>` gets that port setting's value.
78+
- Appends `--cbuild-run` and the corresponding `cbuildRunFile` path if `cmsis`>`cbuildRunFile` is set.
7679

7780
**Note**: The built-in version of pyOCD supports the command line option `--cbuild-run` which isn't available in releases outside this extension.
7881

@@ -82,13 +85,14 @@ The `cmsis-debug-jlink` debugger type is used to add a debug configuration in th
8285
This configuration uses the `gdbtarget` debugger type registered by the CDT GDB Debug Adapter Extension.
8386

8487
**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.
88+
89+
- Linux and macOS: A GUI-less version of the GDB server is launched.
90+
- Windows®: A GDB server with GUI is launched. Update `target`>`server` to `JLinkGDBServerCL` to launch a GUI-less version on Windows, too.
8791

8892
Additionaly, the extension contributes a debug configuration resolver which automatically fills the following gaps during debug launch:
8993

9094
- 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.
95+
- Appends `--port <gdbserver_port>` if the `target`>`port` setting is set, where `<gdbserver_port>` gets that port setting's value.
9296

9397
## Known Limitations and Workarounds
9498

docs/configure.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ For debugging with pyOCD, the following is added to the `launch.json` file:
6262

6363
### Single-core (pyOCD)
6464

65-
For a single-core device, you need to add:
66-
67-
- the relative path to the HEX file to `"initCommands"` - `"load"`.
68-
69-
- an absolute `"definitionPath"` to the device's SVD file to be able to use the [Periperals view](./debug.md).
65+
For a single-core device, you need to add the relative path to the HEX file to `"initCommands"` - `"load"`.
7066

7167
**Example**
7268

@@ -91,7 +87,6 @@ For a single-core device, you need to add:
9187
"cmsis": {
9288
"cbuildRunFile": "${command:cmsis-csolution.getCbuildRunFile}"
9389
}
94-
"definitionPath": "/Users/user/.cache/arm/packs/Keil/STM32U5xx_DFP/3.0.0/CMSIS/SVD/STM32U585.svd"
9590
}
9691
]
9792
}
@@ -105,13 +100,7 @@ For a multi-core device, you need to:
105100

106101
- for the secondary core: comment out the `"initCommands"`.
107102

108-
- for each core:
109-
110-
- add an absolute `"definitionPath"` to the device's SVD file to be able to use the
111-
[Periperals view](./debug.md).
112-
113-
- add the relative path to the AXF (ELF) files for each core to `"program"`.
114-
103+
- add for each core the relative path to the AXF (ELF) files for each core to `"program"`.
115104

116105
**Example**
117106

@@ -136,9 +125,8 @@ For a multi-core device, you need to:
136125
"port": "3333"
137126
},
138127
"cmsis": {
139-
"cbuildRunFile": "FRDM-K32L3A6.cbuild-run.yml"
128+
"cbuildRunFile": "${command:cmsis-csolution.getCbuildRunFile}"
140129
},
141-
"definitionPath": "/Users/user/.cache/arm/packs/NXP/K32L3A60_DFP/19.0.0/devices/K32L3A60/K32L3A60_cm4.xml"
142130
},
143131
{
144132
"name": "CM0+: CMSIS Debugger: pyOCD",
@@ -155,7 +143,6 @@ For a multi-core device, you need to:
155143
"server": "pyocd",
156144
"port": "3334"
157145
},
158-
"definitionPath": "/Users/user/.cache/arm/packs/NXP/K32L3A60_DFP/19.0.0/devices/K32L3A60/K32L3A60_cm0plus.xml"
159146
}
160147
]
161148
}
@@ -210,9 +197,6 @@ added to the `launch.json` file:
210197

211198
For a single-core device, the configuration template contains all the information that is required to start debugging.
212199

213-
!!! Attention
214-
**Check if the above statement is true!**
215-
216200
### Multi-core (J-Link)
217201

218202
For a multi-core device, you need to:

docs/debug_views.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ following aspects:
1515

1616
- [BREAKPOINTS section](#breakpoints-section) is available.
1717

18-
- [Peripheral Inspector](#peripherals-inspector) is available (requires configuration).
18+
- [Peripheral Inspector](#peripheral-inspector) is available (requires configuration).
1919

2020
- [Memory Inspector](#memory-inspector) can be opened.
2121

docs/images/remote_comms_err.png

42.1 KB
Loading

docs/index.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The following extensions are included in this extension pack:
1616

1717
We recommend installing the following extensions to simplify the user experience:
1818

19-
- [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.
19+
- [Arm Tools Environment Manager](https://marketplace.visualstudio.com/items?itemName=Arm.environment-manager), an extension that allows you to download, install, and manage software development tools using [Microsoft® Vcpkg](https://vcpkg.io/en/index.html) artifacts. For example, use this extension to install the [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain) which comes with a GDB variant for Arm CPUs.
2020

2121
- [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.
2222

@@ -26,17 +26,18 @@ The **Arm CMSIS Debugger** extension pack supports a wide range of debug probes:
2626

2727
- [CMSIS-DAP v2.x](https://arm-software.github.io/CMSIS-DAP/latest/).
2828

29-
- [STMicroeletronics ST-LINK/V2/V3](https://www.st.com/en/development-tools/hardware-debugger-and-programmer-tools-for-stm32/products.html).
29+
- [STMicroelectronics ST-LINK/V2/V3](https://www.st.com/en/development-tools/hardware-debugger-and-programmer-tools-for-stm32/products.html).
3030

3131
- [Segger J-Link](https://www.segger.com/products/debug-probes/j-link/).
3232

33-
- any debug probe that comes with a GDB Server.
33+
- debug probes with a compatible GDB server interface.
3434

3535
## Multi-core debugging
3636

37-
The Arm CMSIS Debugger is capable of multi-core debugging. For every core that you wish to connect to, you need to
38-
[create a debug configuration](./configure.md#create-a-launch-configuration). Using the same debug adapter, you can connect
39-
to the different target cores within one instance of VS Code.
37+
The Arm CMSIS Debugger is capable of multi-core debugging. You can
38+
[create a debug configuration](./configure.md#create-a-launch-configuration) for multiple target cores to be debugged within
39+
a single VS Code session using the same debug adapter, provided the adapter and target support concurrent multi-core
40+
debugging.
4041

4142
## Contents
4243

@@ -46,10 +47,11 @@ to the different target cores within one instance of VS Code.
4647

4748
- [**Start debugging**](./debug.md) demonstrates how to enter the VS Code debugger.
4849

49-
- [**Debug views**](./debug_views.md) give you access to the code execution and device peripherals.
50+
- [**Debug views**](./debug_views.md) provide access to code execution and device peripherals.
5051

5152
## Revision history
5253

5354
Version | Description
5455
:------------------|:-------------------------
55-
0.1.0 | Initial release for the CMSIS Debugger extension version 0.1.0
56+
0.1.1 | Release for the Arm CMSIS Debugger extension version 0.1.1
57+
0.1.0 | Initial release for the Arm CMSIS Debugger extension version 0.1.0

docs/troubleshooting.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Troubleshooting
2+
3+
This chapter describes problems that might occur during debugging and how to solve them.
4+
5+
## Loadable section outside of ELF segments
6+
7+
When downloading an AXF file built with [Arm Compiler for Embedded](https://developer.arm.com/Tools%20and%20Software/Arm%20Compiler%20for%20Embedded),
8+
the following warning might appear and the application does not execute correctly. This happens regardless of the selected GDB server.
9+
10+
```txt
11+
warning: Loadable section "RW_RAM0" outside of ELF segments
12+
in /path/to/my/application.axf
13+
```
14+
15+
### Possible Reason: scatterloading issues
16+
17+
`arm-none-eabi-gdb` does not correctly load ELF program segments due to the way that Arm Compiler for Embedded generates
18+
section and program header information when scatterloading is used.
19+
20+
### Workaround: Generate a HEX file
21+
22+
Generate a HEX file for the program download, and the ELF file for debug purposes only.
23+
24+
Refer to the [Project setup](./setup.md#project-setup) section for further details.
25+
26+
## Broken debug illusion
27+
28+
When debugging ELF files with [DWARF](https://dwarfstd.org/) debug information of standard version 4 and earlier, `arm-none-eabi-gdb` generates the following warnings:
29+
30+
```txt
31+
warning: (Internal error: pc 0x8006a18 in read in CU, but not in symtab.)
32+
```
33+
34+
The debug illusion will be broken in many places.
35+
36+
### Possible Reason: Missing DWARF5 debug information
37+
38+
`arm-none-eabi-gdb` works best with DWARF debug information of standard version 5.
39+
40+
### Solution: Build the ELF file using DWARF5
41+
42+
Make sure to build your application ELF file with DWARF version 5 debug information.
43+
44+
Follow the steps explained in [Project setup](./setup.md#project-setup).
45+
46+
## pyOCD port not available
47+
48+
When starting a debug session, you might see this error:
49+
50+
![Remote communication error](./images/remote_comms_err.png)
51+
52+
### Possible reason: A running instance of pyOCD
53+
54+
This error might occur if a previous debug session has ended prematuerly and pyOCD has not exited. The orphaned instance
55+
will still keep the port open (usually 3333) and thus you won't be able to open the port again in the new session.
56+
57+
### Solution: Check open files and kill pyOCD
58+
59+
On Linux and macOS you can check the running open files using the [`lsof`](https://de.wikipedia.org/wiki/Lsof) command:
60+
61+
```sh
62+
sudo lsof -i -n -P | grep 3333
63+
64+
Python 41836 user01 3u IPv4 0xa6ef66ad5be49a4f 0t0 TCP *:3333 (LISTEN)
65+
pyocd 41842 user01 8u IPv4 0x9d09900145f3ca41
66+
```
67+
68+
To kill the running pyOCD process, use:
69+
70+
```sh
71+
sudo killall pyocd
72+
```
73+
74+
On Windows systems, use the
75+
[Windows Task Manager](https://learn.microsoft.com/en-us/troubleshoot/windows-server/support-tools/support-tools-task-manager)
76+
or the [Process Explorer](https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer) to find orphaned
77+
processes.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ nav:
88
- Create launch configuration: configure.md
99
- Start debugging: debug.md
1010
- Debug views: debug_views.md
11+
- Troubleshooting: troubleshooting.md
1112
theme:
1213
name: readthedocs
1314
markdown_extensions:

0 commit comments

Comments
 (0)