Commit graph

498 commits

Author SHA1 Message Date
Gerard Marull-Paretas 6b987d3192 scripts: west: runners: nrfjprog: add basic support for nRF54H series
Add basic support to flash application and/or radio core for nRF54H
series. Note that features like merged hexes present in nRF53 series is
not supported.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 16:40:11 +01:00
Gerard Marull-Paretas a99b5ca01b scripts: west: runners: nrfjprog: add erasepage op
Add a new operation that allows erasing pages.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 16:40:11 +01:00
Gerard Marull-Paretas b2c8f7680d scripts: west: runners: nrfjprog: add option to not erase
On some new SoCs, the erase option is not required, so introduce a new
option that doesn't set any erase mode.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-02 16:40:11 +01:00
Gerard Marull-Paretas ec9dc5d739 scripts: west: runners: nrf: fix UICR check
uicr_ranges dictionary entries did not contain the `_FAMILY` suffix, now
used by self.family variable, resulting in an always false check.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-31 15:38:06 +01:00
Witold Lukasik 13abdcccb3 scripts: west_commands: runners: nrf_common: add support for nRF54L
Add support for new Nordic family in west commands.

Signed-off-by: Witold Lukasik <witold.lukasik@nordicsemi.no>
2024-01-30 21:00:44 +00:00
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
Michael Arnold 240bd8e16a runners: jlink: Add support for J-Link over IP
Add support for J-Link over IP and J-Link remote server.
If the "--dev-id" is a valid ip, the transport over ip is selected.
Otherwise usb is selected.

Signed-off-by: Michael Arnold <marnold@baumer.com>
2024-01-09 14:49:03 +01:00
Thomas Gagneret 7bde51bccf scripts: zspdx: Include modules as packages in zephyr.spdx
The current zephyr.spdx does not contain the modules included in the build.
This commit split the zephyr-sources package into multiple packages, one
for each modules found by zephyr_module.py.

Signed-off-by: Thomas Gagneret <tgagneret@witekio.com>
2024-01-09 09:59:57 +01:00
Marc Herbert 4aa0e7af68 west: sign.py: add "REM" support to pass comments through cpp
Generated outputs can be difficult to read, preserving comments helps a
lot and they often provide good `git grep` search keywords.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-08 13:20:41 -05:00
Marc Herbert a27e8f9a19 west: sign.py: explain why -P is passed to cpp
Zero-functional change.

Also move it to a separate line so it's more convenient to temporarily
comment it out.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-08 13:20:41 -05:00
Marc Herbert 2ee6c26d15 west: sign.py: rename new generated/platf.toml to rimage_config.toml
CMake-based build systems like Zephyr's use separate build directories;
one for each build configuration. Even Zephyr's multi-build system
"sysbuild" (which is not relevant here) uses separate subdirectories.

So there is only one pre-processed, .toml file generated by build
directory and no need to vary its filename based on the platform name or
any other configuration parameter. It can and should keep the same
filename across build directories as zephyr.elf and all other build
artefacts do.

Moreover, when building a collection of configurations (as for instance
`sof/scripts/xtensa-build-zephyr.py` does), keeping all build
directories consistent with each other simplifies installation,
checksumming and any other post-processing.

"Fixes" recent commit 15336045af ("west: sign.py: generate platf.toml
from platf.toml.h with cc -E")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-01-08 13:20:41 -05:00
Marc Herbert 15336045af west: sign.py: generate platf.toml from platf.toml.h with cc -E
Allow using the C pre-processor to generate a
`rimage/config/platform.toml` file from a "source"
`rimage/config/platform.toml.h` file.

This is optional and fully backwards compatible.

To use, do not use `-c` and point west sign at a configuration directory
instead or let it use the default `rimage/config/` directory and change
the files there.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-15 14:41:36 +01:00
Marc Herbert a65b8d40fb west: sign.py: always log the rimage command
rimage is very verbose by default and has no -q(uiet) option, so saving
one line out of more than 100 lines is pointless.

RimageSigner.sign() was already very complex and suffering from
combinatorial explosion of parameters. With .toml
pre-processing (#65411) it's getting worse, so we really need all build
logs to show the complete rimage command.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-15 14:41:36 +01:00
Marc Herbert c13cf99f2a west: sign.py: recommend separator -- tool_args always
In the following command, the first argument `for_rimage` is passed to
`rimage` whereas `--for west` goes to west.

```
west sign  for_rimage --for west
```

This is somehow valid but we really don't want anyone to do that.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-15 14:41:36 +01:00
Marc Herbert dbc4b2ed4e west: sign.py: extract new method RimageSigner.rimage_config_dir()
Zero functional change, preparation for the .toml modularization.

RimageSigner.sign() is also way too long and too complex and this helps.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-15 14:41:36 +01:00
Marc Herbert 039e5ef1b8 intel_adsp: remove rimage sign() from west flash
`west sign` has been invoked by `west build` (through CMake) since
commit fad2da39aa, almost one year ago. During that time, this new
workflow has been refined and successfully used by at least two vendors,
multiple CIs across both SOF and Zephyr and many developers.

At the time, the ability to sign from `west flash` was preserved for
backwards compatibility. This means rimage parameters can come from many
different places at once and that rimage can be invoked twice during a
single `west flash` invocation!

Now that Zephyr 3.5 has been released, we need to reduce the number of
rimage use cases and the corresponding validation complexity and
maintenance workload to simplify and accelerate new features like
splitting rimage configuration files (#65411)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-12-15 14:41:36 +01:00
Zhang Peng a47aa23129 west: sign: add support for NXP i.MX8ULP board
Add support for signing i.MX8ULP SOF with Zephyr images with rimage.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2023-12-04 16:41:00 +00:00
Yves Vandervennet 28c5b1d76d west: linkserver: update to reflect logging changes in 1.3.15
NXP released the linkserver update 1.3.15, which corrects an issue
with logging that by default went out to stderr when flashing.

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2023-11-13 09:47:27 +01:00
Mateusz Junkier 8bccb645aa boards: intel_adsp: fix board flashing
add missing declarations to work with ace15 board

Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>
2023-11-03 09:56:08 +01:00
Henrik Brix Andersen bf598848b1 scripts: west: commands: tests: dfu_util: fix test under Python 3.12
Use "call_args_list" from unittest.mock instead of "called_with" for
verifying the arguments supplied to the dfu-util west runner.

This aligns the assert with the rest of the test case and fixes the
dfu-util west runner test when running under Python 3.12.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-10-26 07:17:10 +02:00
Daniel Leung 4201978f34 manifest: sof: update to commit e7cb489d4
This updates SOF modules to commit
e7cb489d430dc2181e4a5f7f953ed1eaeec6668d. This includes
a change where rimage is pulled into the tree and is no
longer a submodule. So update the rimage config path so
signing still works.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-25 21:44:14 -04:00
Daniel Leung 3be5732a68 west: sign/rimage: skip extended manifest when !SOF
Non-SOF build does not have extended manifest data for
rimage to process, which might result in rimage error.
So do not do extended manifest during signing when not
doing SOF builds.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-25 21:44:14 -04:00
Manuel Argüelles 52e9671fa8 west: add tests for NXP S32 Debug Probe
Add minimal set of tests to verify behavior of supported commands.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Manuel Argüelles e938a5a31a west: add NXP S32 Debug Probe runner
The NXP S32 Debug Probe is a JTAG-based probe that enables debugging on
NXP S32 devices. This probe is designed to work in conjunction with NXP
S32 Design Studio and this runner offers a wrapper to launch a debug
session from cli.

`flash` command is not implemented at the moment because presently there
are no zephyr boards that can make use of it and test it.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Manuel Argüelles 1bc53ff84d west: core: allow to pass keywords args to server and client
Allow the runners to pass extra keywords arguments to both the server
and client subprocesses calls, as can be useful for instance to set
a specific execution environment.
ZephyrBinaryRunner.check_call() already supports passing kwargs to
the inner subprocess call but this is currently not possible when
starting server/client processes. So pass through the kwargs to each of
the client/server subprocess calls.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Manuel Argüelles c35d024b8d west: core: add search path argument to require()
Allow the runners to override the default search path, e.g. when
provided through command line. The default is to search for the program
binary on the system PATH.

This is useful when the runner allows to optionally override the search
path of the tool, in the case there are multiple versions or
installations, and not necessarily the tools path are present in the
system PATH environment variable. For example:
`tool = self.require(tool_name, path=args.tool_path_override)`

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
2023-10-25 18:14:51 -07:00
Benjamin Cabé 4773f42c27 west: bossac: handle stty from coreutils on macOS
There might be situations where people are running the coreutils version
of stty on macOS, hence the need for being smarter at detecting when
that might be the case

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-11 11:05:48 +01:00
Alberto Escolar Piedras 07e88a9fba west native_gdb runner: Fix to use exe instead of elf
The runnable output from the build system is the
exe file. In native_posix the elf happend to also be
runnable, but this is not the case in general,
and not for native_sim or the nrf5*bsim boards.

So lets use the exe instead.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-10 15:26:09 +02:00
Alberto Escolar Piedras f8455b410e west runner: Add exe file to configuration
Add the exe fle to the runnerconfiguration class,
so we can use it from runners which will need it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-10 15:26:09 +02:00
Grzegorz Swiderski 652b0a8a98 scripts: domains: Support initialization only from YAML
By requiring a full-on YAML fragment, the Domains class can rely on
pykwalify to do the heavy lifting with validating types and structure.
Remove support for loading domains from a dictionary, so that we don't
ever have to replicate the same checks on the input, and we can instead
have a single entry point.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-10-04 18:04:18 +02:00
Carles Cufi 2332a1db39 west: runners: nrf: Document why the network core is recovered first
The network core needs to be recovered first due to the fact that
recovering it erases both the network and application cores' flash
memory. This means that the little flash image that is programmed during
the recover operation would be lost for the app core if we inverted the
order.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-10-03 15:11:55 +01:00
Martí Bolívar 23ed21c0a0 scripts: runners: rework RunnerCaps implementation
This provides miscellaneous quality of life improvements:

- We couldn't use dataclasses when this class was originally written.
  We can now, so move to dataclass to avoid having to write
  __repr__().

- Add missing validation for the advertised commands

- Add missing documentation for the 'file' capability

Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
2023-09-29 16:30:07 +02:00
Yonatan Schachter 66c4cef240 west_commands: bindesc: Fixed crash when no sub-command is given
The west bindesc command currently crashes when no subcommand is
given. This is because the subcommand was not marked as required.
This commit fixes the issue.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-09-28 23:04:47 +03:00
Carles Cufi 2d38c095a6 west: runners: Add support for a common --reset argument
Some of the runners in the tree have been adding their own,
class-specific versions of a switch to instruct the runner to reset or
not the device after flashing.

In order to better support multi-image builds that require more than one
flash operation, introduce a new --reset,--no-reset command-line
parameter that is part of the RunnerCaps so taht this functionality can
be accessed in a standardized manner.

Implementations for the new parameter are provided for the runner
classes that were already configurable in this regard.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-09-28 11:08:25 -07:00
Yonatan Schachter c42a7dff4d west: commands: Add bindesc command
Added the bindesc command to west, for working with binary
descriptors. Currently it supports dump, list and search
subcommands, for bin, hex, elf and uf2 file types.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-09-28 07:39:09 -04:00
Grzegorz Swiderski 05d7769073 sysbuild: Do not exclude images from domains.yaml
The recent support for BUILD_ONLY images was implemented by excluding
them from `domains.yaml`, in order to crudely prevent them from being
picked up by `west flash`. Arguably, this is incorrect or unexpected,
because the sysbuild documentation defines a "domain" as:

   Every Zephyr CMake build system managed by sysbuild.

Another consequence is that, given a build-only `<image>`, this makes it
impossible to pass `--domain <image>` to `west flash`, `west debug`, and
ironically `west build`.

To fix that, `domains.yaml` should again represent all domains, and the
build-only ones should be indicated in another way. Enter `flash_order`:
a new top-level key in the domains YAML schema. It contains the default
sequence of images used by `west flash`, where the build-only images are
excluded, and the order is influenced by `sysbuild_add_dependencies()`.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-09-27 17:49:12 +02:00
Evgeniy Paltsev 06b28fc4ea ARC: west: mdb runner: support 12 cores targets
Bump number of cores limit in mdb west runner.
As we are here - adjust core number in runner test closer to
the limit.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-09-25 09:49:50 +02:00
Théo Battrel e5de0b6824 west: fix wrong zsh completion
The subcommand 'spdx' was suggesting '-d' for SPDX output directory
instead of '-s'.

Signed-off-by: Théo Battrel <theo.util@protonmail.ch>
2023-09-15 09:27:20 +02:00
Théo Battrel 4dc648642f west: Fix a typo in the fish completion script
In the `help` command, 'status' was written 'statue'.

Signed-off-by: Théo Battrel <theo.util@protonmail.ch>
2023-09-15 09:27:20 +02:00
Théo Battrel 45e66de58f west: Add fish shell completion
Add west completion for fish shell.

Update others files to include the support for fish shell.

Signed-off-by: Théo Battrel <theo.util@protonmail.ch>
2023-09-13 12:51:22 -07:00
Chaitanya Tata 6b05af6e43 twister: handle quotes for configuration options
Add support handling quotes for configuration options in extra args by
escaping them properly instead of removing the quotes altogether. For
other options in extra_args quotes are removes as usual.

Add similar support in west build command also.

Add a unit test to check this functionality.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-09-08 06:04:48 -04:00
Jamie McCrae bc97d8fb1e twister: Add support for required snippets
Adds support for twister to require using snippets on tests

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-09-06 16:40:53 +02:00
Yuchao Guo 9fb6c9ddd7 west: runners: uf2: Add more fstype check for is_uf2_partition
During testing it was found that if the partition type was displayed as
msdos it could not be detected correctly, so this partition type
determination was added.

Signed-off-by: Yuchao Guo <yuchao.guo@hoorii.io>
2023-09-06 14:16:58 +02:00
Yves Vandervennet ab9da956b0 nxp: mimxrt1170: add support for NXP's LinkServer
LinkServer is NXP's tool to flash and debug on MCU's.
This patch expands support for LinkServer to MIMXRT1170.

There is one limitation with flashing and debugging the SoC's seciond
core (COrtex M4) that will be addressed with a future submission.

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2023-09-06 09:35:24 +02:00
Maciej Perkowski fb9a6af700 scripts: west_commands: Allow passing source dir when looking for test
Before, only following way of getting test-item build was supported:
`west build -b <BOARD> -T <PATH_TO_SOURCE/TEST_NAME>`
This commit allows to also call it by:
`west build -b <BOARD> <PATH_TO_SOURCE> -T <TEST_NAME>`

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-08-31 12:06:18 -07:00
Anas Nashif d4b0c48892 west: build: fail early if path to test item is not valid
Fail early in case the path to the test item (--test-item) is not valid
or does not exist.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-08-28 09:17:42 -07:00
Iuliana Prodan 4cf9d67432 west: sign: do not make rimage configuration and platform name mandatory
Now, if the rimage target (meaning rimage configuration and platform name)
is not defined in board.cmake the sign script returns fatal error.
Change this to a warning since there are configurations that are
not using 'west sign' or is used just to glue the headers of the
final image.

Also, update the documentation accordingly.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-08-28 09:17:02 -07:00
Bruno Mendes 7da7742c66 west debugserver: openocd: configure rtos
This enables thread awareness in the spawned OpenOCD server.

Signed-off-by: Bruno Mendes <bd_mendes@outlook.com>
2023-07-27 15:08:15 -05:00
Anas Nashif 47102de474 west: build: support additional configuration with --test-item
Also support extra_conf_files, extra_overlay_confs, extra_dtc_overlay_files

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-07-24 11:09:12 -04:00