The following board revision properties can now be used as part
of the format string in the 'west boards -f ...' command.
- board.revisions with format {revisions}
- board.revision_default with format {revision_default}
Signed-off-by: Alex Fabre <alex.fabre@rtone.fr>
Use the --format flag in git rather than parsing the output of
the git log. The inspiration for this change was that the previous
implementation breaks if there's a ~/.gitconfig that changes the
git log format.
Signed-off-by: John Barbero Unenge <git@lsrkttn.com>
If BB tests failed, crashed, etc., log handles
could linger and crash test cleanup.
Adding log closing to a `finally` section
should prevent those issues.
Loggers should not be set up as globals,
as it makes testing much harder.
Running multiple Twisters may cause for the
logfiles to be still "in use".
When exiting main, close all logfiles
and remove their handlers from all loggers.
Do that for conftest as well.
Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
Add a `--dry-run` (or `-d`) option to the posix kconfig
migration script for deprecated POSIX Kconfigs.
Additionally, add a set of skipped options (e.g. `TIMER`).
The `CONFIG_TIMER` option does not exist in the tree anymore
and was way too generically named previously, so the false
positive rate is astronomical, so it makes sense to skip it.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Rename the driver from uart_native_posix to uart_native_pty.
Including renaming the DTS compatible, and kconfig options, deprecating
the old ones.
And refactor the driver, generalizing it, so we can have any number of
instances.
Note that, unfortunately generalizing to N instances cannot be done
without a degree of backwards compatibility breakage: This driver was
born with all its configuration and selection of the instances based on
kconfig.
When the driver was made to use DT, it was done in a way that required
both DT and kconfig needing to manually coherently enable the 2nd UART.
This has now been fixed, which it means only DT is used to decide how
many instances are avaliable, and UART_NATIVE_POSIX_PORT_1_ENABLE is
just ignored.
Including:
* Deprecate UART_NATIVE_WAIT_PTS_READY_ENABLE: the options is always on
now as it has no practical drawbacks.
* Deprecate UART_NATIVE_POSIX_PORT_1_ENABLE: DTS intanciation defines it
being available now.
* Rename a few functions and in general shorten pseudo-tty/pseudo-
terminal to PTY instead of PTTY.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
MD5 and SHA1 are not supposed to be used nowadays on security context.
Some ancillary scripts in tree do use them, but for verification only -
or where externally mandated, such the SPDX tool.
This patch marks those usages as `usedforsecurity=False`, which helps
clarify intent.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Calling `west build --build-opt="-v" --build-opt="-j=<n>"`
passes the build options to `cmake --build ... -- <build-opt>` which
again is passed to the native build tool, such as ninja or make.
However, when ExternalProjects are used in CMake, such as in TF-M or
sysbuild builds then those extra build options are only passed to the
first image build and not those build as external projects.
CMake supports environment variables for those flags, so translate
verbosity and number of jobs to those environment variables and thereby
support those flags for all images when specified by the user.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Align with native_simulator's upstream main
3ccb09ec00e291f699219c0e3f5b14b6b1c7ceb6
Which includes:
3ccb09e nsi_errno: Add new API to get the current host side errno
32eab87 Makefile: Ser a macro to distinguish build in runner context
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Rename the driver files, binding and kconfig options, while deprecating
the old binding and kconfig options.
Uses in tree are replaced.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In order to enable the use case where the underlying flash tool supports
bulk-flashing using multiple device IDs, augment the core runner class
with this new runner capability and implement it in the nrfutil runner,
since the nrfutil tool supports it natively.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This is an extension for indexing the source code in the workspace
with GNU Global. See the command line help for more information about
Global.
Signed-off-by: Martí Bolívar <marti.bolivar@oss.qualcomm.com>
Align with native_simulator's upstream main
20d3b2b76a3bf61d35becbe17928cdf22e885b9f
Which includes:
* 20d3b2b Makefile: Support building C++ files with runner
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Added recently introduced optimizations - generation in string literal form
and faster generation for hexadecimal initializer list form - to gzip path
as well.
Signed-off-by: Irfan Ahmad <irfan.ahmad@siemens.com>
Incremental refactoring.
Fix PEP8 issues to make ruff green for config_parser.py module.
Add __init__.py to twister directory to make it a proper python package,
and make modules importable.
Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Rework of the flashing algorithm broke the STM32N6 dfu flashing.
Add the case of using usb port and download-modifier (new n6 specific
option) as a new case of using the bin file for flashing.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Adds some Kconfigs to the allow list which are used for
demonstration purposes in sysbuild documentation
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Setup logging per process to fix issue on both mac and windows where
handlers are not available to the processes.
Fixes#86237
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This driver was deprecated and must be removed by Zephyr version
4.1 according to lifecycle/release guidelines.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
This change enhances the devicetree library by adding support for tracking
the source filename and line number for nodes and properties.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Fix --download-address to expect a signed.bin file when --download-address
is provided.
To allow testing this case despite the checks put in the runner, add a
patch functions which return that zephyr.bin is actually present
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Aim is to avoid 2 issues:
- Requesting --download-address to flash hex files
- Flashing hex files (non signed) on N6 which works but doesn't allow
persistent firmware
Hence this changes binds --download-address with usage of .bin files.
If --download-address was not provided, default to hex flashing.
File existence done with isfile() will ensure the required file
is available before flashing and report an error if this is not the
case.
Note: In specific N6 case, we're verifying zephyr.signed.bin is
available instead of zephyr.bin. This is ensure since self.cfg.bin_file
matches runners_yaml_props_target configuration (set to
zephyr.signed.bin on STM32N6).
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
native_sim only works and builds on Linux, when running twister on the
Mac, this platform fails to build and reports errors.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Modify the requirements-compliance.txt to exclude python-magic from
windows system installation. On windows, the line:
""python-magic-bin; sys_platform == "win32""" already exists. Adding:
python-magic on windows creates issues where the check_compliance.py
script will either freeze or throw errors related to libmagic.
Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
Introduce a new command-line option `--keep-artifacts` in twister that
allows users to specify which artifacts should be preserved
during test cleanup in addition to the default set.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Co-authored-by: Anas Nashif <anas.nashif@intel.com>
These files can be useful to troubleshoot a test that's failing,
and they're really small, too.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
NOTE: Even though previous commits indicate, that this can only happen on
MacOS, that's actually not true. It happens on Linux as well.
The constructor of `psutil.Process` can throw an exception as well, so we
need to wrap the whole loop in another try, unfortunately.
Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
While it doesn't cause any issues, it's more consistent and makes future
commits which add handling for more exception types more readable.
Based on: 0df8240b49
Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
Problem
-------
Board & SoC extensions are used to define out-of-tree board variants or
SoC qualifiers. When a board is extended, it has multiple directories
associated with it (each with its own `board.yml`), where twister should
be able to find additional platform files to support these qualifiers.
Currently, this doesn't work, because twister only traverses the primary
BOARD_DIR and ignores the rest.
The fix would've been trivial in the case of "legacy" platform files,
i.e. those of the form `<normalized_board_target>.yaml`, but it's less
straightforward for the newly introduced `twister.yaml` format.
A `twister.yaml` file contains platform configuration that can be shared
by multiple board targets and tweaked for specific targets by using the
top-level `variants` key. Normally, there is at most one `twister.yaml`
per board, but the file isn't necessarily unique to one board. Instead,
it's unique to one directory, which may define multiple boards (as is
the case with e.g. `boards/qemu/x86/`).
With extensions in the picture, the goal is to initialize platforms when
given multiple `twister.yaml` per board. The OOT files are expected to
only provide information about OOT board targets, without being able to
override in-tree targets (same principle as in the Zephyr build system).
Solution
--------
The `twister.yaml` handling is broken up into multiple passes - first
loading all the files, then splitting the `variants` keys apart from the
shared configuration, before constructing the Platform instances.
The purpose of the split is to treat the variant information as global,
instead of making unnecessary or faulty assumptions about locality.
Remember that the build system can derive board target names not only
from `board.yml`, but from `soc.yml` too. Considering that any board may
end up using an OOT-extended SoC (and hence multiple `soc.yml` files),
not every board target can be said to belong to some board dir.
Unlike the variant data, the remaining top-level config is still rooted
to the primary BOARD_DIR and inherited by the extension dirs from there.
This is quite intuitive in most imagined cases, but there is a caveat:
if a `twister.yaml` resides in an extension dir, then it is allowed to
have a top-level config of its own, but it will be silently ignored.
This is to support corner cases where, much like how a single board dir
can define multiple boards, a single board dir can also extend multiple
boards, or even do both. In those cases, the primary BOARD_DIR rule
should make it unambiguous which config belongs to which board, even if
it may seem counter-intuitive at first.
For concrete examples of what this means, please see the newly added
platform unit tests.
As part of these functional changes, a good chunk of logic is moved out
of `TestPlan.add_configurations()` into a new function in `platform.py`.
This is because recombining the top-level and variant configs requires
direct manipulation of the loaded YAML contents, which would be improper
to do outside of the module responsible for encapsulating this data.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
Allow user to add shell commands in testcase/sample yaml file
alongside the harness_config like in the console harness.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Fixes using the wrong path for checking if disallowed Kconfigs
are present, to use the zephyr base instead of the git top level
folder which caused issues for downstream manifests
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit adds a test that checks if disconnecting
and restarting the IPC session works correctly. The
test is also focused on the "unbound" callback.
Signed-off-by: Dominik Kilian <Dominik.Kilian@nordicsemi.no>
Co-authored-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
Existing logic is passing elf file as parameter only when fsbl
or bit file parameter is present. This is incorrect, elf file should
be always passed irrespective of other parameters.
Signed-off-by: Mubin Sayyed <mubin.sayyed@amd.com>
One might want to select the symbols to be relocated inside a file or
a library. To do this, one can use the FILTER argument of
zephyr_code_relocate which must contain a regular expression of the
section names to be selected for relocation.
The test_function_in_sram2 test case in
`tests/application_development/code_relocation` has been updated to
verify that only one function `function_in_sram()` is relocated to ram
and that the function `function_not_relocated()` is not being relocated
when using relocation filter.
Signed-off-by: Sylvain Chouleur <sylvain.chouleur@gmail.com>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
With code relocation directives passed to the gen_relocate_app.py script
using generated file, then each directive can be place on individual
line in the file and thus free up the `|` character as separator.
Furthermore, a multi-line file with each directive on separate line is
also more user-readable, making debugging easier.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
After adding more detailed information to the reason field in
Twister report, update twister_report_analyzer.py to group
CMake and Build failures.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Updated test_report_summary to match new string with detailed
reason of build failure.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Extended the reason field in Twister report to include
more detailed information for 'Build failure' and
'CMake build failure'
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
To use openocd rtt shell in a non-Windows environment,
you need to turn off ICANON and ECHO.
Refer to pyocd to enable a temporary terminal and configure
it correctly.
Signed-off-by: Findlay Feng <i@fengch.me>