Commit graph

5615 commits

Author SHA1 Message Date
Maciej Perkowski
da1066fa4b twister: Add sysbuild boolean to platform definitions
More complex platforms require sysbuild to use always, even for
such "simple" samples like hello_world. Such platforms can have
`sysbuild: true` entry in their board_name.yaml used by twister.
Using such entry will tell twister, that sysbuild must always be used
on a given platform.
Twister is aligned to have information about need of sysbuild at
instance (platform + suite) level (was only at suite level before).
Instance.sysbuild is true whenever a test suite or a platform requires
sysbuild.
Twister pytest unit tests are aligned with changes.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2024-06-13 16:46:25 -04:00
Jamie McCrae
c0c51a8d40 scripts: west: flash: Fix issue with loading outdated domain file
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>
2024-06-13 17:53:00 +02:00
Juha Kuikka
14c2be6d9d twister: Capture qemu launch stdout and stderr
Currently we launch qemu (well, "ninja run" usually) using Popen and
request stdout and stderr to be redirected into a pipe. However we never
read that pipe so the information is not captured.

Instead log directly into files that can be inspected after a failed
to to find out why qemu run failed.

Note that this is really only useful in cases where qemu either fails to
launch or crashes.

Regular test data is still handled via the qemu fifo.

Signed-off-by: Juha Kuikka <juha.kuikka@gmail.com>
2024-06-13 08:04:07 -04:00
Anas Nashif
eaafd30b56 twister: cleanup how we capture results of handlers
we use reason for a failure to indicate state and then set the status
later and reason for the failure, in case of the failure is taken from
the handler status. Clean this up by setting status and reason coming
from the handler very early, so we do not have to go through replacing
meaning later.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-06-12 21:12:13 -04:00
Félix Piédallu
52c92159cd scripts: More explicit error in west_commands for NRF flashing
Instead of suggesting a python dep is missing, tell the user intelhex is
missing.

Signed-off-by: Félix Piédallu <felix@piedallu.me>
2024-06-12 18:26:29 -04:00
Fin Maaß
fb8b30d8d0 dts: devicetree.h: add DT_REG_HAS_NAME
Add DT_REG_HAS_NAME,
DT_REG_ADDR_BY_NAME_OR,
DT_REG_SIZE_BY_NAME_OR,
DT_INST_REG_HAS_NAME,
DT_INST_REG_SIZE_BY_NAME_OR and
DT_INST_REG_ADDR_BY_NAME_OR.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-06-12 17:12:23 -05:00
Carles Cufi
37ec117386 scripts: west: blobs: Check for existence of modules
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>
2024-06-12 12:50:12 -04:00
Martí Bolívar
74abb2bf95 devicetree: add first-class node label helpers
Add the following new macros:

- DT_FOREACH_NODELABEL
- DT_FOREACH_NODELABEL_VARGS
- DT_INST_FOREACH_NODELABEL
- DT_INST_FOREACH_NODELABEL_VARGS

These are for-each helpers for iterating over the node labels of a
devicetree node. Since node labels are unique in the entire
devicetree, their token representations can be useful as unique IDs in
code as well.

As a first user of these, add:

- DT_NODELABEL_STRING_ARRAY
- DT_INST_NODELABEL_STRING_ARRAY

The motivating use case for these macros is to allow looking up a
struct device by devicetree node label in Zephyr shell utilities.
The work on the shells themselves is deferred to other patches.

To make working with the string array helpers easier, add:

- DT_NUM_NODELABELS
- DT_INST_NUM_NODELABELS

Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
2024-06-12 18:49:54 +02:00
Lothar Felten
3334b55207 scripts: twister: help - change help text to match hwmv2
fix the twister help text, boards are now organized as:
boards/<vendor>/<board_name>

Signed-off-by: Lothar Felten <lothar.felten@gmail.com>
2024-06-11 16:18:15 +02:00
Jordan Yates
b1290cb86c scripts: twisterlib: filter coverage information
When dumping logs from the `--inline-logs` option, remove any coverage
information that may be contained in those logs. Coverage dumps are
unrelated to any test failures and make it harder to find the failing
test information. In extreme cases the relevant information is lost due
to terminal scrollback limits.

If the raw dump information is required, it is still present in the
original `handler.log` file.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-06-11 16:37:31 +03:00
Tomasz Chyrowicz
f15a2e8ca8 scripts: nrf_common: Handle SUIT artifacts
Handle MPI and root manifest for radio core separately from the main
build system logic.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2024-06-10 17:03:14 +03:00
Declan Snyder
ca6adbba61 scripts: kconfig: Add dt_compat_any_has_prop
Add a kconfig preprocessor function to check if
any node of a certain compatible has a specific property in DT.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-06 20:08:27 -04:00
Dmitrii Golovanov
eebbd5c411 twister: footprint: Add optional detailed JSON report on symbols
New Twister option `--footprint-report` is introduced to collect and
write detailed memory footprint results for symbols as an additional
JSON file. By default, the new option is disabled.

The new option implies and extends `--create-rom-ram-report`, so there
are three choices: 'ROM', 'RAM', and 'all' to select what memory area
symbols to report in `twister_footprint.json`.
In case of the custom report name, or per-platform report, it is always
composed with the rightmost '_footprint.json' suffix.

The memory footprint report has similar structure as `twister.json`
and compelements it having reduced set of test suite properties:
- instead of `testcases` it contains `footprint` object with
  `rom.json` and `ram.json` artifacts embedded there;
- other properites are limited to represent only the essential test
  suite context, thus to allow further data processing consistently
  and independently from the `twister.json`.
- 'filtered' test instances are not included into the footprint report.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-06-06 20:08:11 -04:00
Dmitrii Golovanov
a425db20b1 twister: Add test suite filtering on twister.json compose
When Twister composes resulting twister.json reports, add optional
filtering by a test instance resulting status and/or its individual
properties to be allowed/denied on output to the JSON file.
This internal feature is introduced to facilitate JSON reports with
a custom data schema.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-06-06 20:08:11 -04:00
Martin Jäger
c1a3bfb5f4 scripts: set_assignees.py: Use "size: XS" label for one-liners
Previously, one-line changes were tagged as "Trivial".

The description of the "Trivial" label states:
"Changes that can be reviewed by anyone, i.e. doc changes, minor build
system tweaks, etc.".

Just because a change only affects a single line of code, it does not
mean that it is a trivial change. It may have difficult to understand
implications which require approval of the responsible maintainer.

For this reason, change the label to "size: XS" and let humans judge
if a PR is trivial or not.

Signed-off-by: Martin Jäger <martin@libre.solar>
2024-06-06 20:06:47 -04:00
Henrik Brix Andersen
331b404185 twister: hardwaremap: avoid exceptions when generating hardware map
Avoid exceptions when generating persistent hardware maps on Linux with no
devices available.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-06 07:50:51 -04:00
Anas Nashif
94b9790941 ci: test_plan: fix handling of v2 boards
Handling of board changes was broken and did not support v2 boards, fix
this to optimize CI execution on localized changes of board files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-06-06 07:50:34 -04:00
Grzegorz Swiderski
46572f797f dtlib: Allow deleting the root node
Previously, dtlib would fail to parse the following:

   /delete-node/ &{/};

This is accepted by dtc, so dtlib should be aligned.

The expected behavior is that the contents of the "deleted" root node
are emptied, but the node itself remains in the tree. This means that
it's possible to put that statement at the end of a DTS file and still
get a valid output. A small test case for this scenario is included.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-06-06 00:42:10 -07:00
Dmitrii Golovanov
4dc2a98d0c twister: Ensure serial-pty process termination
Make sure Twster DeviceHandler serial-pty process is terminated
with all its remaining children to avoid Twister hanging on it
infinitely.
The reolved issue occurs sometimes, for example when serial-pty
script is used for serial port tunneling over network.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-06-05 17:38:42 -05:00
Ioannis Damigos
9c8fd3745c kconfigfunctions.py: Fix used-before-assignment error with pylint 3.2
CI reports error:
kconfigfunctions.py:143:11: E0601: Using variable 'edtlib' before
assignment (used-before-assignment)

Initialize edtlib to none when there is no edt.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-05 13:49:09 -05:00
Ioannis Damigos
285969c98c scripts/kconfig: Introduce dt_node_ph_prop_path function
Introduce dt_node_ph_prop_path function.
It  takes a node 'path' and a phandle property name
and returns the path to the pointed-to node.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-05 13:49:09 -05:00
Lukasz Mrugala
5f4d330db6 scripts: twister: Do not report filtered test instances by default
Filtered testcases are removed by default from Twister tests.
Older functionality is preserved via a new Twister flag:
--report-filtered.
Old tests were adjusted and a new test for that flag added.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-06-05 01:38:47 -07:00
Henrik Brix Andersen
3eb3c33096 scripts: twister: allow fixtures to contain extra configuration
Allow twister fixtures to contain extra information, which can be used for
test suite configuration. The extra information can be appended to existing
fixtures separated by a colon (i.e. <fixture>:<configuration>).

This is especially useful for the pytest harness, where a fixture of a
given type may need to refer to an instance of a particular piece of host
hardware needed by the pytest suite (e.g. a network interface, a UART, or a
CAN interface connected to the device under test).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-04 21:27:35 -05:00
Henrik Brix Andersen
a7d55cfa13 twister: harness: pytest: list available fixtures in device config
Pass the list of supported twister fixtures for a given platform to pytest
via DeviceConfig. This allows for the pytest suites to use knowledge of the
fixtures for test suite configuration.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-04 21:27:35 -05:00
Chris Friedt
fe1e7f8d37 doc: release: posix: deprecate non-normative POSIX Kconfig
Add release notes for the deprecation of a number of POSIX
Kconfig options. These have been deprecated so that we can
use more normative Kconfig variable identifiers, based on
the Options and Option Groups of IEEE 1003.1-2017.

To simplify migration, use

python $ZEPHYR_BASE/scripts/utils/migrate_posix_kconfigs.py \
    -r root_path

Additionally, document the removal of PTHREAD_BARRIER_DEFINE(),
EFD_IN_USE, EFD_FLAGS_SET, which were previously deprecated
>= 2 release cycles before.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Yong Cong Sin
3998e18ec4 arch: rename all esf struct to struct arch_esf
Rename every architecture's esf struct to `struct esf`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-04 14:02:51 -05:00
Anas Nashif
d877d29913 twister: abort on execution and retun 0 on exceptions
When something goes wrong with execution, due to twister issues and
bugs, do not continue with execution and abort the process and report
and return an error code.

Fixes #72807

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-06-04 07:58:31 +02:00
Mathieu Choplain
8aa6ae43ce llext: add support for SLID-based linking
This commit introduces support for an alternate linking method in the
LLEXT subsystem, called "SLID" (short for Symbol Link Identifier),
enabled by the CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID Kconfig option.

SLID-based linking uses a unique identifier (integer) to identify
exported symbols, instead of using the symbol name as done currently.
This approach provides several benefits:
 * linking is faster because the comparison operation to determine
   whether we found the correct symbol in the export table is now an
   integer compare, instead of a string compare
 * binary size is reduced as symbol names can be dropped from the binary
 * confidentiality is improved as a side-effect, as symbol names are no
   longer present in the binary

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-06-03 15:29:34 -04:00
Henrik Brix Andersen
beb5b676f3 scripts: requirements: run-tests: add python-can
Add python-can dependency for the newly introduced tests/drivers/can/host
test suite.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-03 15:37:49 +02:00
Tomasz Moń
88dc03618b scripts: west_commands: runners: nrf_common: adjust json output
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>
2024-06-03 04:45:59 -07:00
Ioannis Damigos
90974248ec west/ezflashcli: add dev_id capability
Add dev_id capability

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-03 03:02:11 -07:00
Ioannis Damigos
5ad5ac6414 west/ezflashcli: add tool_opt capability
Add tool_opt capability

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-06-03 03:02:11 -07:00
Grzegorz Chwierut
f52f08f877 twister: pytest: Sysbuild support in pytest-twister-harness
Read default domain from domains.yaml file and update
paths to proper build directory. It fixes native and qemu
pytest scenarios, when application is build with sysbuild.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-06-02 00:42:54 +02:00
Emil Gydesen
1bcc3d8efa samples: Bluetooth: Audio: Change names to <profile>_<role>
Modify the BAP and PBP samples to start with the profile name
(BAP or PBP) and the role of the sample.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-05-31 09:56:11 -05:00
Yong Cong Sin
13a5c8aad7 debug: symtab: fix linking issue due to variable redefinition
Employs the same linkonce magic of sw_isr_table to fix the
multiple definition of the symtab variables issue that I
get in my application build that doesn't use `west`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-30 16:52:01 -05:00
Yong Cong Sin
043f595279 debug: symtab: rename start_addr to first_addr
`start_addr` is the address of the first symbol, rename it to
`first_addr` instead as it seems more intuitive and relatable
to the comments.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-30 16:52:01 -05:00
Yong Cong Sin
29423eb17e build: symtab: prevent entries with the same address
Append new entry to the symtab list only if it has unique
address.

Added a bit more comments and move the debug print to after
the list is sorted.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-30 16:52:01 -05:00
Yong Cong Sin
f5934de8e5 build: symtab: Add a dummy entry at the end for the binary search
The `symtab_find_symbol_name()` is using an adapted binary
search function to get the entry between 2 addresses, we need
to add a dummy entry at the end so that the search function
can remain simple and straightforward without doing
out-of-bound checks:

   20  \
       |
       |
   50  x
       |
       |
   90  x
    .  |
    .  |
    .  |
dummy  /

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-30 16:52:01 -05:00
Yong Cong Sin
408d0be89f build: symtab: sanitize function name
Sanitize the function name and only store the valid part.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-30 16:52:01 -05:00
Rafał Kuźnia
64bf17daad scripts: west_commands: runners: nrf_common: optional UICR cleanup
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>
2024-05-30 11:55:11 +01:00
Guennadi Liakhovetski
024bd41efb llext: xtensa: add support for the xt-clang toolchain
To build LLEXT images using the xt-clang toolchain from Cadence
linker flags have to be set similar to other toolchains. Add the
missing cmake files.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-29 10:49:40 -07:00
Bjarki Arge Andreasen
79640aea09 drivers: console: remove uart_mux and gsm_mux
Remove the deprecated uart_mux and gsm_mux modules and all of
their configurations/dependencies across zephyr.

Optimally uart_mux and gsm_mux would be removed in their own
respective PRs, but the two modules are directly coupled, so
to preserve bisectability, they must be removed together.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-05-29 10:49:08 -07:00
Tomasz Moń
e136f02ea6 scripts: west_commands: runners: nrfutil: Only flash with J-Links
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>
2024-05-29 08:31:01 -07:00
Arkadiusz Cholewinski
5cfb4bd3f5 CI: Fix Coverage Analysis
The coverage_analysis.py while generating report, duplicates
files and functions of components.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2024-05-29 07:33:45 +02:00
Yong Cong Sin
0dac6c132b build: namespace autoconf.h with zephyr/
Namespace the generated `autoconf.h` file with `zephyr/`.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Yong Cong Sin
bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Michał Szprejda
7c084b6649 West: Add west robot command
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>
2024-05-28 12:54:52 +02:00
Michał Szprejda
80900cbc3b West: Add west simulate command
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>
2024-05-28 12:54:52 +02:00
Michał Szprejda
f155ff596c West: runners: Add explicit capabilities
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>
2024-05-28 12:54:52 +02:00
Michał Szprejda
73b73c91f4 West: Add option to supress elf/bin/hex file params
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>
2024-05-28 12:54:52 +02:00