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>
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>
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>
`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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Parse common section and append to cmake args if available when using
--test-item option of west build.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Linkserver is a utility for launching and managing GDB servers for NXP
debug probes, which also provides a command-line target flash programming
capabilities. Linkserver can be used with NXP MCUXpresso for Visual Studio
Code.
For more information about LinkServer, please visit the LinkServer web
page (link [1] below).
This commit adds a runner to west, supporting debug and flash commands.
Documentation is also added.
[1] - LinkServer web page:
https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/linkserver-for-microcontrollers:LINKERSERVER
Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
An arg --test-item makes west loading twister's test configurations
form sample/testcase.yaml. It has to mirror twister's behavior.
It was not the case with "extra_args" section. Quotation marks were
not removed in west as they were in twister. The quotation marks
have to be removed from the extra_args section but left in
extra_configs. The commit adds differentiation for those.
fixes: #60297
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
This fixes the following build error:
```
zephyr/zephyr.elf', needed by 'zephyr/zephyr.ri', missing and no known
rule to make it
```
This appears when CONFIG_KERNEL_BIN_NAME is used.
Therefore, do not use zephyr.elf since some samples might be called
based on CONFIG_KERNEL_BIN_NAME.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
De-duplicate the `if target in ('imx8', 'imx8m'):` copy/paste/diverge
before someone updates one and not the other. Also better to define
bootloader always.
Zero functional change.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
If build is used with -T option, sysbuild flag was ignored
neverthelesss being present in sample.yaml/testcase.yaml
file.
Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
Add support for disabling loading of the flasher stub and instead only talk
to the ROM bootloader.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
rimage always requires a key argument even when it does not use it.
Some configurations (IMX) use rimage only for "stitching" the image but
not for signing. These were failing to build directly from west with
pretty cryptic stack trace, see below. This has never been a problem for
the SOF project because it has always worked around this rimage
limitation by providing a bogus -k argument - very much like the one
added by this commit.
```
File "zephyrproject/zephyr/scripts/west_commands/sign.py", in sign
extra_ri_args += [ '-k', str(sof_src_dir / 'keys' / cmake_default_key) ]
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'NoneType'
ninja: build stopped: subcommand failed.
```
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Internal bootloader will only run application image if valid product
header is present on flash. This means product header is required for
application that are not linked to code partition. Other applications
that are linked to code partition are meant to be run by MCUboot and
should not touch product header, with the exception of MCUboot itself
which is also run by internal bootloader so requires product header.
Default flash load offset for applications not linked to code partition
is set to 0x2400 as this is where internal bootloader looks for an
application image to run based on product header written by flasher.
Flash load offset for MCUboot is set from boot partition.
Valid product header is added by ezFlashCLI when using "flash_image"
command.
Co-authored-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Signed-off-by: Niek Ilmer <niek.ilmer.aj@renesas.com>
This significantly improve user experience as 32 bit mdb binary
require to install multiple libraries before it can be used on
modern linux distros.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>