GDB¶
The gdb boot method loads and starts a binary on the DUT using gdb, usually
through a debug probe driven by OpenOCD. It is used for
microcontroller (MCU) boards.
- deploy:
to: tmpfs
images:
zephyr:
url: https://example.com/zephyr.elf
openocd_script:
url: https://example.com/cc3220_xds110.cfg
- boot:
method: gdb
commands: openocd
timeout:
minutes: 2
LAVA:
- resets the device, if a
hard_reset_commandis defined - waits for the USB serial device and connects to it
- starts
gdbwith theargumentsdefined for thesecommands - sends each gdb command
- sends
continueto start the binary
When the boot action ends, LAVA stops gdb.
commands¶
Required. The name of a set of gdb commands defined in the device-type template,
for example openocd.
The downloaded files can be used in the arguments and commands with an upper
case placeholder named after the image key. For example, images.zephyr is
available as {ZEPHYR} and images.openocd_script as {OPENOCD_SCRIPT}.
container¶
Optional. The docker image in which gdb is run. It overrides the container
defined in the device-type template.
This is only allowed when docker is enabled for these commands in the
device configuration (docker_use).
- boot:
method: gdb
commands: openocd
container: ti-openocd-small
The directories of the downloaded files are mounted in the container at the same path.
Device configuration¶
The gdb binary and the commands are defined in the device-type template:
actions:
boot:
methods:
gdb:
parameters:
command: gdb-multiarch
wait_before_continue: 5
openocd:
arguments:
- "{ZEPHYR}"
commands:
- target remote | openocd -c "gdb_port pipe" -f {OPENOCD_SCRIPT}
- monitor reset halt
- load
- set remotetimeout 10000
docker:
use: false
container: ti-openocd
devices: []
command: the gdb binary to runwait_before_continue: seconds to wait before sendingcontinuearguments: the list of arguments passed to gdbcommands: the list of commands sent to gdbdocker: run gdb in a docker container (use), with the given defaultcontainerand thedevicesto share with the container
See cc3220SF.jinja2 for an example. In this template, the following
variables can be set in the device dictionary:
| Variable | Default |
|---|---|
wait_before_continue |
5 |
docker_use |
False |
docker_container |
ti-openocd |
docker_devices |
[] |