summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2020-04-24 10:51:11 -0700
committerCommit Bot <commit-bot@chromium.org>2020-05-05 01:59:40 +0000
commit4574908d30b789e049ade2dee80678b8da4f2c6b (patch)
tree009d65d1ef9f26a67e213956d09271e83025a390 /docs
parenta4820cc7079cffc315c04b792429f6392b193b20 (diff)
downloadchrome-ec-4574908d30b789e049ade2dee80678b8da4f2c6b.tar.gz
util: Add support to auto-flash with Segger J-Link gdbserver
Automatically flash the EC binary when running gdb combined with Segger J-Link gdbserver and JTrace. For most code changes, the flashing only takes a 10-20 seconds. Also updated FPMCU debugging docs to mention the gdbinit. BRANCH=none BUG=none TEST=On machine with dragonclaw attached to J-Trace: JLink_Linux_V670e_x86_64/JLinkGDBServerCLExe -select USB -device STM32F412CG -endian little -if SWD -speed auto -noir -noLocalhostOnly BOARD=bloonchipper GDBSERVER=segger gdb --ex "target remote 127.0.0.1:2331" TEST=Same as above, but using CLion for gdb as described in https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/master/docs/fingerprint/fingerprint-debugging.md and setting USING_CLION=FALSE Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I88440c0bc8c9b170b239335a33b3c0a0387447f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2166143 Reviewed-by: Craig Hesling <hesling@chromium.org>
Diffstat (limited to 'docs')
-rw-r--r--docs/fingerprint/fingerprint-debugging.md17
1 files changed, 12 insertions, 5 deletions
diff --git a/docs/fingerprint/fingerprint-debugging.md b/docs/fingerprint/fingerprint-debugging.md
index f5d9760049..84832e38b6 100644
--- a/docs/fingerprint/fingerprint-debugging.md
+++ b/docs/fingerprint/fingerprint-debugging.md
@@ -27,9 +27,9 @@ used for JTAG and SWD for ARM devices.
## Software Required
-* [JLink Software] (when using [J-Trace] or other Segger debug probes).
+* [JLink Software] \(when using [J-Trace] or other Segger debug probes).
* Any tool that supports connecting `gdbserver`. This document will assume
- [CLion].
+ [CLion] and was tested with `JLink_Linux_V670e_x86_64`.
* Alternatively, you can use [Ozone] a standalone debugger from Segger.
## Connecting SWD
@@ -76,7 +76,7 @@ Start the JLink gdbserver for the appropriate MCU type:
* Dragontalon / [Nucleo STM32H743ZI]: `STM32H743ZI`
```bash
-(outside) $ ./JLink_Linux_V660c_x86_64/JLinkGDBServerCLExe -select USB -device STM32F412CG -endian little -if SWD -speed auto -noir -noLocalhostOnly
+(outside) $ ./JLink_Linux_V670e_x86_64/JLinkGDBServerCLExe -select USB -device STM32F412CG -endian little -if SWD -speed auto -noir -noLocalhostOnly
```
You should see the port that gdbserver is running on in the output:
@@ -96,13 +96,18 @@ Connected to target
Waiting for GDB connection...
```
-In your editor, specify the IP address and port for gdbserver:
+Configure your editor to use this [`.gdbinit`], taking care to set the correct
+environment variables for the `BOARD` and `GDBSERVER` being used. For CLion, if
+you want to use a `.gdbinit` outside of your `HOME` directory, you'll need to
+[configure `~/.gdbinit`].
+
+In your editor, specify the IP address and port for `gdbserver`:
```
127.0.0.1:2331
```
-You will also want to provide the symbol file:
+You will also want to provide the symbol files:
* RW image: `build/<board>/RW/ec.RW.elf`
* RO image: `build/<board>/RO.ec.RO.elf`
@@ -155,6 +160,8 @@ STM32F412 package that does not have the synchronous trace pins, but the
[CLion Start Remote Debug]: https://www.jetbrains.com/help/clion/remote-debug.html#start-remote-debug
[Nucleo STM32F412ZG]: https://www.st.com/en/evaluation-tools/nucleo-f412zg.html
[Nucleo STM32H743ZI]: https://www.st.com/en/evaluation-tools/nucleo-h743zi.html
+[`.gdbinit`]: /util/gdbinit
+[configure `~/.gdbinit`]: https://www.jetbrains.com/help/clion/configuring-debugger-options.html#gdbinit-lldbinit
<!-- Images -->