Commit graph

11 commits

Author SHA1 Message Date
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
Martí Bolívar 374411dfaf west: runners: improve pyocd runner test coverage
Make sure that this runner can handle multiple --tool-opt arguments,
and that the options specified for pyocd are passed to that tool in
order.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-12-29 10:36:02 +01:00
Martí Bolívar 65e3593bf9 west_commands: runners: reserve -O for --tool-opt
The --tool-opt runner option is the recommended practice for allowing
runners to take additional arguments that are passed on to the
underlying tool. It exists because we don't want to add one runner
option for every single tool option that users might want to tweak --
that would be a nightmare.

Enough runners are using this option that it's time to promote it to a
common runner capability with consistent behavior, the same way we did
for the --dev-id option in the past. This removes boilerplate from
individual runner files and ensures consistent argument handling for
this option when it is supported.

Since --tool-opt is a bit long to type, and we've had some complaints
about that, take this as an opportunity to standardize on -O as a
short option equivalent for it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-08-03 05:06:53 +01:00
Carles Cufi 2ccfd22594 runners: pyocd: Convert to -i/--dev-id
Remove the previous pyocd-specific --board-id option and switch to
the common -i/--dev-id one.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-10-11 20:56:27 -04:00
Frank Li 59208ac13b runners: pyocd: add --tool-opt parameter
add --tool-opt to support more pyocd parameter

Signed-off-by: Frank Li <lgl88911@163.com>
2020-02-03 13:32:38 -05:00
Rihards Skuja 6b9f0df7da runners: pyocd: add --telnet-port parameter
With multiple debug probes attached, attempting to launch multiple debug
servers resulted in "OSError: [Errno 98] Address already in use" despite
explicitly setting --gdb-port to unique values.

The issue was caused by the default telnet port: 4444. Adding
--telnet-port parameter allows to explicitly define the address to a
unique value and avoid the socket exception.

Signed-off-by: Rihards Skuja <rihardssk@mikrotik.com>
2019-10-03 19:19:39 -05:00
Marti Bolivar f7a4275328 scripts: west flash: fix --board-id for pyocd
Newer pyocd versions (specifically the 0.21.0 we have in our
requirements.txt) no longer support -b and have moved the same option
to -u. Keep up.

Fixes: #17554
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-19 11:03:03 +02: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
Carles Cufi c5daabe190 west_commands: pyocd: Sector erase by default
Due to issues with the implementation of the default auto-erase in
pyocd, sometimes the chip is mass-erased even when not intended. To
avoid this issue, default to forcing sector erasing unless mass erasure
is explicitly requested by the user with additional flash options.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-03-12 16:52:14 +01:00
Maureen Helm 987313e102 scripts: west: Update pyocd runner to use unified tool subcommands
pyocd 0.14.0 merged its command-line tools into a unified pyocd tool
with subcommands. The separate command-line tools still remain, but are
deprecated. Update the pyocd runner to use the new unified pyocd tool
with subcommands.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-02 10:32:30 -05:00
Marti Bolivar 63841df184 scripts: run_ci.sh: add pytest-based testing for west commands
Incorporate these into run_ci.sh the same way that btsim results were
done. This adds a dependency on pytest.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-01-29 10:15:01 +01:00