Moves the telnet client into runners/core.py as well, as this is now shared
between openocd and jlink.
Signed-off-by: Tobias Pisani <mail@topisani.dev>
This was non-trivial, as openocd is a bit weird to work with. Using only
commands passed with '-c' arguments, I couldn't get it to reliably resume
(or just not halt) the target when started. I tried using the 'sleep'
command, and various 'configure -event XX { resume }' events, but nothing
panned out, as it seems to always halt after all `-c` commands have been
run.
To avoid that, this waits for the TCL RPC port to be up, and sends a
resume command there. This works reliably.
Signed-off-by: Tobias Pisani <mail@topisani.dev>
This command runs separately from a debug server, instead of attaching
to a running server. This is both the easiest out of the box experience,
and also should be possible to implement consistently for most runners.
This commit includes an initial implementation for pyocd.
Signed-off-by: Tobias Pisani <mail@topisani.dev>
This patch adds bindesc support for the build version values for the
kernel and application - BUILD_VERSION and APP_BUILD_VERSION.
The kernel's BUILD_VERSION can be overridden at build time.
Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
As the .bin & .hex build output is optional
and it can be disabled by CONFIG_BUILD_OUTPUT_BIN/HEX,
add support for the mandatory .elf build output
to the linkserver runner flash command.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
As the .bin & .hex build output is optional
and it can be disabled by CONFIG_BUILD_OUTPUT_BIN/HEX,
add support for the mandatory .elf build output
to the pyocd runner flash command.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
Add minimum support for the `west sdk` command.
This only provides completion for the `sdk` command itself.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
This command can list and install SDK.
Run 'west sdk install' to install the SDK.
Run without any parameter, installing
specified by SDK_VERSION in the source tree.
'west sdk' to show installed SDK information.
This command is just a wrapper for SDK's setup command,
but it simplifies the installation process. It will be a good
improvement for onboarding first-time users.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
The .bin & .hex build output is optional and can be disabled by
CONFIG_BUILD_OUTPUT_BIN/HEX.
Add support for the mandatory .elf build output
to the jlink runner flash command.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
It is safer to base the SUIT artifacts path on the path of the
configuration file than the HEX file that is being flashed.
The latter may be overriden by several scripts that merge/transform the
final firmware image.
Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
probe-rs is a new programming and debugging tool written in Rust, supports
many probes and targets.
This commit introduces initial support for probe-rs to Zephyr.
Signed-off-by: Chen Xingyu <hi@xingrz.me>
Running 'west blobs fetch' does not verify the digest of downloaded files:
1. if the checksum of the previously downloaded file does match
that in the blob metadata (status BLOB_PRESENT), do nothing
2. if the checksum of the previously downloaded file does not match
that in the blob metadata (status BLOB_OUTDATED),
download the "up to date" file
3. if the blob has not yet been downloaded (status BLOB_NOT_PRESENT),
download it
None of the 2) and 3) code paths will verify that the checksum of the file
just downloaded actually matches the digest in the blob's metadata.
In the event that the metadata of a module is incorrect, then the user
will not notice anything, and may rely on an unexpected binary,
e.g. a static library for a different architecture.
According to the Binary Blobs documentation [1], the expected
behavior is to check the blob digest after downloading.
[1] Fetching blobs, Zephyr 3.6.0 (still applies to Zephyr 3.7.0rc3)
docs.zephyrproject.org/3.6.0/contribute/bin_blobs.html#fetching-blobs
Signed-off-by: Christophe Dufaza <chris@openmarl.org>
With the recent change to hwmv2, loading the
boards is extremely slow and can take several
seconds.
To solve that problem this commit add a cache
of the boards. The cache is updated based on:
- when the latest commit of the manifest
file directory is updated or;
- when the manifest file directory is not
a git directory, when the manifest file
content itself is updated.
At the same time:
- update how the board completion is
displayed by including the board vendor to it;
- add missing `--board` and `--board-dir`
options;
- remove `hwmv1` board completion code.
Signed-off-by: Théo Battrel <theo.util@protonmail.ch>
The current option used as an example, --recover, is actually a separate
option in the runner itself. Instead use --clockspeed as an example,
which is applicable to all nrfjprog commands.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Allow for users to provide a --qspiini parameter that is passed directly to
the nrfjprog executable but only in the --program operation. This is
required since e073210ec2 enabled the
-O/--tool-opt for all operations, but --qspiini is only allowed combined
with --program.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
When --erase was specified, esp32 runner was autodetecting serial port to
be used, regardless of --esp-device argument.
Append '--port SERIAL_DEVICE' parameter earlier, so that erase command
invocation uses explicitly specified serial device.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Previous OpenOCD version finding would fail when additional tokens were
prepended to the 'openocd --version' output, as happens with some third-
party OpenOCD repackages (xPack for one).
Fixes: #71955
Signed-off-by: Nick Kraus <nick@nckraus.com>
Fixes#71761
The `west boards` command parses extra BOARD_ROOTs from Zephyr modules,
so that the boards defined in those modules are automatically listed.
In HWMv2, OOT boards can be described in terms of OOT SoCs, which means
that extra SOC_ROOTs must also be provided. Otherwise, an error message
will be displayed when attempting to list all boards. Therefore, every
Zephyr module SOC_ROOT should be included as well.
In HWMv1 (deprecated), OOT boards can be defined in terms of OOT archs,
but module ARCH_ROOTs had never been included automatically. The fix for
this is long overdue, but it's included for symmetry.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Increase the default SDO timeout for the CANopen program download west
runner from 0.3 seconds to 1 second. Depending on the flash size and speed,
a full erase may take slightly longer than 300 ms.
The timeout can be customized by using the --sdo-timeout runner parameter.
Fixes: #73987
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
The current version of scipts do not consider OOT boards use cases and
the tests with robot now are strict to only one robot file, which is
not realistic for real environment. This address those issues and allow
multiple testsuits at command line and lists at tests entries. It add
another test parameter to allow configure robotframework options.
Fixes: #74563
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Adjust error message so that it clearly states runners.yaml is
missing from <build_dir>/zephyr, instead of referencing CMake cache
variable ZEPHYR_RUNNERS_YAML, which is no longer used (since
3124c02987 ).
Also clean up that variable in CMake since it is no longer used
(0 other references in entire tree).
Fixes#70605
Signed-off-by: Louis Feller <louis.feller@st.com>
In order for the --recover option to work properly on the nRF54H20, it
requires executing it for both cores, the radio and the application one.
Extend the recover_target() function so that it does so for both 53 and
54H20.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
`west build` can be invoked without specifying the source directory when
being invoked from the source directory itself.
When using `west build` for incremental builds, then the build command
will examine the CMake cache to determine the application dir by using
the value of CMAKE_HOME_DIRECTORY.
With sysbuild, this leads to the wrong assumption that the sysbuild
itself is the application to build.
Instead, have west build look for APP_DIR which points to the correct
source dir when sysbuild is used. Use APPLICATION_SOURCE_DIR when
APP_DIR is not set, as this indicates a no-sysbuild build.
Keep CMAKE_HOME_DIRECTORY behavior as last fallback mechanism.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Since `writer.py` is the one writting the SPDX file, it should normalize
the name field and not `walker.py` which generates the SBOM components.
Signed-off-by: Thomas Gagneret <thomas.gagneret@hexploy.com>
Improve the SPDX with the current values:
- URL: extracted from `git remote`. If more than one remote, URL is not
set.
- Version: extracted from `git rev-parse` (commit id).
- PURL and CPE for Zephyr: generated from URL and version.
For zephyr, the tag is extracted, if present, and replace the commit id for
the version field.
Since official modules does not have tags, tags are not yet extracted for
modules.
To track vulnerabilities from modules dependencies, a new SBOM,
`modules-deps.spdx` was created. It contains the `external-references`
provided by the modules. It allows to easily track vulnerabilities from
these external dependencies.
Signed-off-by: Thomas Gagneret <thomas.gagneret@hexploy.com>
The gdb-port defines the GDB port and the openocd runner passes
this value to openocd as well as gdb. However, the TI AM62x board
provides multiple ports for each subsystem. For example, systick
appears at 3333, A53 as 3334-3337, R5F as 3338 and M4F as 3339.
If we want to connect to the M4F, we need to add another port which
is different to the to the gdb-port value.
This patch adds an additional argument --gdb-client-port to define
the port which GDB should connect to. It defaults to 3333, identical
to gdb-port.
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Fixes an issue whereby the domains file in sysbuild projects
would be loaded and used with outdated information if sysbuild
configuration was changed then west flash was ran directly after
it
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Instead of blindly using the module names provided by the user via
command-line arguments, check if those actually exist in the current
manifest, and error out if any of them does not.
Fixes#73901.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Handle MPI and root manifest for radio core separately from the main
build system logic.
Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
Make the generated json file match the contents generated with:
* nrfutil device erase --uicr --core Application --x-operation-id 1
--x-family nrf54h --x-append-batch batch.json
* nrfutil device program --firmware uicr_merged.hex
--options chip_erase_mode=ERASE_NONE,verify=VERIFY_READ
--core Application --x-operation-id 2 --x-family nrf54h
--x-append-batch batch.json
* nrfutil device reset --reset-kind RESET_PIN --x-operation-id 3
--x-append-batch batch.json
The erase options are supposed to be placed under "option" subkey.
Without the "option" subkey, nrfutil defaulted to ERASE_ALL.
Remove the firmware file format field because it is auto detected by
nrfutil when executing the batch script.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
The flasher was unconditionally cleaning the UICR area, even when the
application didn't have a new configuration generated. This can happen,
when CONFIG_NRF_REGTOOL_GENERATE_UICR=n. In such case, keep the old UICR
configuration on the device.
A real scenario where we should set CONFIG_NRF_REGTOOL_GENERATE_UICR=n
is when building multiple firmware images that are meant to run one
domain. The primary application build generates the UICR configuration
and secondary images don't. Before this change, the flashing process of
the primary application would write new UICR configuration, but the
flashing process of secondary images would erase it.
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
The nrfutil runner calls "nrfutil --json device list" which outputs
information about all connected serial ports. The list includes not only
actual boards but also any ttyACM instance. If the ttyACM instance does
not have serial number, then the nrfutil runner will fail on matching
serial number regexp on NoneType.
Fix the issue by limiting nrfutil runner board output to only devices
that have trait jlink set.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Introduce `robot` command for running Robot Framework test suites.
Initial implementation consists of one runner dedicated for renode-test,
which is a Renode wrapper for running Robot tests.
Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
Introduce `simulate `command for running samples on a simulator of
choice. Initial implementation consists of one runner, dedicated for
Renode.
Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
Add explicit capabilities to nios2, nsim and openocd runners to prevent
them from having potentially unwanted ones (for example when new
capabilities are added to Zephyr).
Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>
Add capability allowing to suppress the --file parameters that can be
passed to a west command runner.
Signed-off-by: Michał Szprejda <mszprejda@antmicro.com>