Commit graph

7 commits

Author SHA1 Message Date
John Whittington 3f282da22d west: runners: blackmagicprobe: elf_file fallback
Building the HEX file is optional (CONFIG_BUILD_OUTPUT_HEX), so
`bmp_flash` will fallback to elf_file if missing. Additionally, to
maintain section names the HEX is only used if it is signed.

Signed-off-by: John Whittington <git@jbrengineering.co.uk>
2024-01-26 14:24:05 -05:00
John Whittington 10183797a1 west: runners: blackmagicprobe: flash hex_file
The cfg.elf_file is not signed, so `west flash` with a sysbuild will
not run the application if MCUboot image signature checking is on. Using
the cfg.hex_file for `bmp_flash` resolves since as the signed hex is
used when using sysbuild. Symbols are not required for flashing so the
switching from elf to hex is not an issue.

Signed-off-by: John Whittington <git@jbrengineering.co.uk>
2024-01-26 14:24:05 -05:00
Jamie McCrae ec7044437e treewide: Disable automatic argparse argument shortening
Disables allowing the python argparse library from automatically
shortening command line arguments, this prevents issues whereby
a new command is added and code that wrongly uses the shortened
command of an existing argument which is the same as the new
command being added will silently change script behaviour.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-26 20:12:36 +09:00
Fabio Baltieri 79856e7637 west: runners: blackmagicprobe: guess the gdb port based on the OS
Add some logic in blackmagicprobe.py to guess the GDB serial port based
on the OS instead of just trying the flag or /dev/ttyACM0.

The new logic explicitly looks for the well known path for BMP on Linux
(/dev/ttyBmpGdb), so that we can remove it from the board files that
have it set explicitly right now. At the same time it still allows
setting the port from the flag and also checks an environment variable,
so that it can be used for systems with multiple probes.

As a fallback, it looks for a valid serial port, picking the first one
(the probe creates two, the GDB one is the first one), and raise an
exception if nothing is found.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2023-01-19 10:16:00 +01:00
Fabio Baltieri dabfffaf26 west: runners: blackmagicprobe: update reset on connect command
Recently the blackmagicprobe command for "connect under reset" has been
updated from "connect_srst" to "connect_rst". Update the flag name in
the west blackmagicprobe binding, keep the old one as well for
compatibility with out of tree boards, and send both the old and new
commands to GDB so that it works with both the old and new firmware. GDB
is going to get a "command not supported by this target" for one of the
two and proceed with the other one.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2023-01-19 10:16:00 +01:00
Fabio Baltieri d0377d30e3 scripts: runners: add connect_srst support for blackmagicprobe
Black Magic Probe supports a "monitor connect_srst" command [1] to
configure whether to assert reset when connecting to the target. This is
useful to reprogram a target that may be idling in a low power state,
with an otherwise unresponsive debug core.

Adding a --connect-srst runner option for enabling this for "flash" and
"debug" operations to ensure that programming works in that case, but
also explicitly disabling it for "attach", to allow attaching to a
running target without changing its state.

Not turning this on by default since apparently some MCUs disable the
SWD interface while in reset.

[1] https://github.com/blacksphere/blackmagic/wiki/Useful-GDB-commands

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-11-22 22:20:02 -05:00
Marti Bolivar c24e044c6e scripts: runners: check for required programs
Add self.require() checks before running commands. Increase test
coverage, including for this feature, while we are here.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-06-17 15:06:21 +02:00