Commit graph

5615 commits

Author SHA1 Message Date
Luca Burelli
11c350e2e6 llext: fix handling of unimplemented syscalls
When building an LLEXT-enabled kernel, 62b19ef65c added weak aliases
of all syscall implementation functions to a pointer to NULL, with the
assumption that LLEXT would check the required symbols at link time and
fail if any of them were found.

This check, however, is ineffective in the current implementation: the
actual address that is exported is the rather normal-looking location of
the variable containing the NULL pointer. This defeats the NULL symbol
validity checks in llext_link.c and causes the extension to crash at
runtime by jumping to a location containing a few zeroes in read-only
data memory.

This commit makes sure the alias target is actually placed at address 0
using the llext-sections.ld linker fragment, so that undefined syscall
implementations are exported as NULLs and as such properly flagged at
link time.

The test for this functionality is also updated to reflect the change.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-10-08 16:59:50 +02:00
Anas Nashif
50ffc771bf boards: add board full_name field
Full name or description of a board is something we are missing in
HWVv2. It is right now being added to yaml files parsed by twister. This
should be generically available to tooling and documentation
independently from twister.

As we rework how twister parses board meta-data (#77250) and how we
generate board documentation (#79160), this becomes neceassry.

Moving the board full name/description from the twister yaml files to
the board.yaml is something we can automate once the schema is agreed
upon.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-10-08 16:57:34 +02:00
TOKITA Hiroshi
767d1ce5f6 devicetree: Adding UNQUOTED, TOKEN, and UPPERTOKEN variants of FULL_NAME
Like some other string properties, I will add a derived form
to FULL_NAME to make it easier to reference from macros.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2024-10-08 06:01:10 -04:00
Gerard Marull-Paretas
091e38b3f2 scripts: west_commands: runners: nrf: add support for nRF54H20 EngB
Make sure cpuapp/cpurad cores are detected correctly when using nRF54H20
EngB.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-10-07 18:42:14 +02:00
Gerard Marull-Paretas
c39ad845f3 scripts: ci: check_compliance: add BOARD_REVISION in Kconfig.board.v2
This is required if boards make use of such definition in their Kconfig
files. In Kconfig.board.v2, only `boards/Kconfig.v2` is loaded, but
BOARD_REVISION is part of `boards/Kconfig`, which can't be loaded in this
context.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-10-07 18:42:14 +02:00
Joel Spadin
6edefd8f50 scripts: dts: properly escape string properties
Fixed escaping of double quotes, backslashes, and new line characters
so they can be used in string properties.

Previously, double quotes and backslashes were escaped in gen_defines.py
but not in gen_dts_cmake.py, and new lines were not escaped in either,
so using any of these characters would break the build.

Signed-off-by: Joel Spadin <joelspadin@gmail.com>
2024-10-04 13:26:51 -05:00
Jukka Rissanen
eb7b3f67d4 ci: tags: Add wifi tag to hostap and other wifi related files
Make sure we run wifi tests for all hostap related files
that are changed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-10-04 16:35:44 +01:00
Georges Oates_Larsen
a4599219b7 logging: dictionary: Support unsigned integers
Add unsigned integer support to the log parser.

This does not change the underlying log format,
it only allows the log parser to more accurately
read the log format.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2024-10-03 11:40:41 +01:00
Laurentiu Mihalcea
155f3f3ba6 west_commands: sign: add imx95 to target list
Add imx95 to target list to allow signing images for
imx95.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-02 13:46:06 -05:00
Florian Grandel
41533a2eea scripts: build: check_init_priorities: remove obsolete code
Removes a snippet of dead code.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-10-02 09:49:53 +02:00
Helmut Lord
aac15846fa west_commands: build: add extra file arguments
Adds an argument to include additional .conf or .overlay files

Example use:

```
west build -b nrf52840dk/nrf52840 -p --extra-conf foo.conf
```

```
west build -b nrf52840dk/nrf52840 -p --extra-dtc-overlay foo.overlay
```

Or:

```
west build -b nrf52840dk/nrf52840 -p --extra-conf foo.conf
--extra-conf bar.conf
```

```
west build -b nrf52840dk/nrf52840 -p --extra-dtc-overlay foo.overlay
--extra-dtc-overlay bar.overlay
```

Signed-off-by: Helmut Lord <kellyhlord@gmail.com>
2024-09-30 16:55:26 -05:00
Dmitrii Golovanov
2ddab56bfd scripts: twister: Fix trailing CR/LF at BinaryHandler logs
Fix trailing `\\r\\n` (escaped CR/LF) didn't cut off because of rstrip()
removed by #58338, so the CR/LF suffix was never found as the actual line
end was `\\r\\n\n`.

Add ANSI code sequence to `test_handlers` Twister unit test.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-09-27 14:30:26 +01:00
Dmitrii Golovanov
883d9e3a6c ci: elasticsearch: Upload script index map examples
Add several examples for `upload_test_results_es.py` script usage
with ElasticSearch index map files for the following use cases:

 * Twister test results.

 * Twister test results with recordings.

 * Memory Footprint data (`twister-footprint.json`).

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-09-26 17:44:01 -04:00
Anas Nashif
b45992159d ci: compliance: remove dropped pylint rules
new pylint dropped few rules.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-26 13:30:12 -05:00
Peter van der Perk
dd15aff5fe west: linkserver: Fix version detect for ihex support
version detect never occured correctly and always yielded true

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2024-09-26 03:34:53 -04:00
Benedikt Schmidt
e7bf414f15 scripts: dts: devicetree: edtlib: Use insertion sort for compat2nodes
Sort the elements in the lists of compat2nodes already during insertion.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-09-25 13:46:32 -05:00
Benedikt Schmidt
fe3287a9ac scripts: dts: extract pickled EDT generation
Separate the pickled EDT generation from the C-Macro header
generation in gen_defines.py to have a more clear responsibility
of the scripts in the DTS parsing process.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-09-25 13:46:32 -05:00
Florian Grandel
a575c769f8 scripts: dts: gen_defines/edtlib: improve encapsulation
Moves node sorting concern into EDT.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-09-25 13:46:32 -05:00
Florian Grandel
945925bd8b scripts: dts: gen_defines: redundant sorting
Removes redundant sorting of nodes.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-09-25 13:46:32 -05:00
Florian Grandel
de846c7afa scripts: dts: gen_defines: type hints
Introduces type hints to all functions for improved static type checking
and IDE support.

Also equalizes spacing between functions as the lines are being touched
anyway.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2024-09-25 13:46:32 -05:00
Kumar Siddaramayya
a899deda2b scripts: logging: dictionary: Add uart support
This commit adds support to dictionary logging to parse binary
data directly from input serial and generate the ascii logs.

Signed-off-by: Kumar Siddaramayya <harish.kumar@nordicsemi.no>
2024-09-25 12:00:13 +01:00
Alberto Escolar Piedras
833f7da7ee scripts/tests/twister_blackbox: Don't test on native_posix
native_posix is now deprecated.
Building this sample in both native_sim and native_posix does not
improve coverage for the sample or subsystem but doubles CI time.
As anyhow native_posix will be removed all together in
2 releases, let's remove it already for this sample.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-25 04:04:36 -04:00
Henrik Brix Andersen
16b39e8a03 scripts: west: commands: completion: add twister --log-level completion
Add bash tab-completion for for the newly introduced "west twister
--log-level" arguments.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-09-24 14:27:03 -05:00
Fabian Blatz
11c83c80fc west: commands: runners: canopen: add download-buffer-size option
Adds a --download-buffer-size option to the canopen runner to allow
specifying the buffer size of the SDO download.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-09-23 13:21:52 -05:00
Lukasz Mrugala
cbe5d9833b scripts: Remove wrong bz package
Package in the requirements-run-test.txt file, bz,
is not package enabling bz2 support.
It is a security concern and must be removed.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-09-23 09:59:56 +02:00
Dmitrii Golovanov
4cc3134aa1 scripts: twister: Don't use match/case statements
Don't use match/case syntax to allow twister to run with
python3 versions < 3.10.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-09-21 12:24:05 +01:00
Lukasz Mrugala
558c74be04 scripts: twister: decouple debug and verbosity
Currently, debug logging in the console and verbosity
are tightly coupled - verbosity of level 2 and higher
enables logging at the debug level.

This change introduces a separate Twister flag
responsible for controlling the debug logging,
while leaving the rest of verbosity unchanged.

This allows for controlling the verbosity on
both logging levels, according to one's needs.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-09-20 11:07:48 +02:00
Piotr Kosycarz
ca770dbeb7 scripts: pylib: twister: twisterlib: prevent empty gcda files
In case of problem with parsing hex data from coverage dump,
do not create empty gcda file.
Such empty file will break gcovr parsing.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-09-19 15:14:33 +02:00
Kamil Piszczek
8c0bc54ab0 mgmt: mcumgr: transport: bluetooth: add all gatt permission levels
Added new Kconfigs for defining permission level of GATT
characteristics that are part of the Bluetooth SMP service in the
MCUmgr subsys.

Removed the CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN as the new Kconfig
options are mutually exclusive and need to be groupa as the Kconfig
choice option.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2024-09-19 15:13:19 +02:00
Dmitrii Golovanov
c5f2df49cc scripts: footprint: Add converter to twister_footprint.json
Add new script `pack_as_twister.py` to convert memory footprint
data prepared by `./footprint/scripts/track.py` into JSON files
compatible with Twister report schema. Next, the data can be
transformed and uploaded to ElasticSearch data storage the same
way as memory footprint (and other) reports executed by Twister.

Add to `plan.txt` an optional column with the corresponding
test suite names for 'footprints' as an example for test instance
name composing with `--test-name` command argumnent.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-09-19 03:28:52 -04:00
Grzegorz Swiderski
eadc3d08c2 twister: Fix inconsistency among DT compat filters
This small change concerns the following filter functions:

   1. `dt_compat_enabled(C)`:
      There's a node with compatible `C` and status "okay".

   2. `dt_enabled_alias_with_parent_compat(A, C)`:
      There's a node with alias `A` and status "okay", and its parent
      has compatible `C`.

   3. `dt_label_with_parent_compat_enabled(L, C)`:
      There's a node with label `L`, and its parent has compatible `C`
      and status "okay".

All three functions involve checking whether some node or its parent has
a given compatible, but the way this has been checked is inconsistent.
Function (1) has done it with this Python conditional:

   compat in node.compats

while (2) and (3) have used:

   parent.matching_compat == compat

The first check works well with nodes that have multiple compatibles,
and it is more aligned with the notion of "has_compat" as seen in the
devicetree macros for C, CMake, and Kconfig.

Arguably, `matching_compat` shouldn't have been used here, because it is
actually a property of a node's binding, moreso than of the node itself.
In practice, it's usually equal to the first compatible for which edtlib
has found a binding, which at first glance is just more constrained than
the `node.compats` check. However, there also exist obscure cases where
the `node.compats` are empty, while the `node.matching_compat` is not.

For now, the three functions can use a combined check, to improve
consistency and utility while avoiding breakage:

   node.matching_compat == compat or compat in node.compats

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-09-18 19:56:06 +01:00
Grzegorz Swiderski
89bf698d90 twister: Remove dt_compat_enabled_with_alias filter
It has been deprecated since Zephyr v2.6.0.

The filter that replaced it - `dt_enabled_alias_with_parent_compat` -
had shared code with it, which can now be inlined into `ast_expr()` to
match the parser's overall code structure.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-09-18 19:56:06 +01:00
Johan Hedberg
db88324f26 scripts: check_compliance: Fix incorrect soc root lookup
The script was only looking at the Zephyr base repository and failing to
look for soc roots e.g. in other modules.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-09-18 15:29:32 +02:00
Torsten Rasmussen
fc741d5344 compliance: Revert "scripts: handle auto defined ZEPHYR_<name>_MODULE"
With the requirement in #78316 for Zephyr modules to always define
ZEPHYR_<name>_MODULE Kconfig setting then there is no longer a need
for this commit. Simplify check_compliance by reverting ths commit.

This reverts commit 35e28e6315.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-09-18 15:29:06 +02:00
Lukasz Mrugala
418b1e0e21 scripts: twister: Add TestCase status printing
When at verbosity 1, we print out the status of TestInstances.
This makes it harder to notice changes at TestCase level,
which require perusing the logs.

This adds TestCase status and reason printing
if verbosity level is 2 or more.
Reason printing is suppressed if the reason is empty or None.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-09-17 15:04:04 -04:00
Reto Schneider
371a48ac16 edtlib: Remove unreachable code
This fixes the following error reported by
./scripts/ci/check_compliance.py:

> 1 checks failed
> ERROR   : Test Pylint failed:
> W0101:Unreachable code (unreachable)
> File:scripts/dts/python-devicetree/src/devicetree/edtlib.py
> Line:2271
> Column:16
>
> Complete results in compliance.xml

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-09-17 14:58:25 -04:00
Wilfried Chauveau
6194159608 scripts: twister: handlers: Enable BinaryHandler to run sysbuilt tests
Running sysbuilt tests fails because of missing "run" target.

This adds the default domain context to the command.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-09-17 09:13:26 -05:00
Lukasz Mrugala
14a72b5158 scripts: Plug TwisterStatus type gaps
Some dict.get() calls did not use a TwisterStatus
as a default value, thus using a NoneType where
TwisterStatus should appear.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-09-16 20:18:09 +02:00
Anas Nashif
02bca9f6f6 twister: abort on unrecognised platforms
identify misnamed platforms and abort.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-16 10:07:51 +02:00
Hake Huang
7f63faa4f5 twister: hwmap: add script parameter support
for pre/post/post_flash script, add timeout as param

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-09-16 10:03:53 +02:00
Benjamin Cabé
fd4f3ce246 scripts: compliance: add sphinx-lint linter
ReStructuredText can sometimes be tricky to get right, especially for
folks that might be more familiar with Markdown.

This adds a Sphinx/RST linter to the compliance check script to help
catch common issues that can easily go unnoticed and cause rendering
issues.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-13 11:43:04 -05:00
Benjamin Cabé
df294e34e1 doc: sphinx-lint: fix bad usage of "default role"
Fixes bad usage of single backticks in lieu of double backticks for
rendering inline literals, or simple '*' for italics.

When appropriate, a better construct than double backticks has been
selected (ex. :file:, :kconfig:option:, :c:func:, ...), or proper :ref:
have been used if the original intention was to have a link.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-13 11:42:51 -05:00
Lukasz Mrugala
f78949b18c scripts: twister: Process KeyboardInterrupt Hardening
If you interrupt process() operation, we want Twister
to exit as gracefully as it can. This avoids the
UnboundLocalError that could appear e.g.
when interrupting the operation via SIGINT.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-09-13 13:42:05 +02:00
Guennadi Liakhovetski
dc5f1bfb3f west: fix for Python prior to 3.10
"type | None" syntax is only available with Python from version 3.10,
fix building with earlier 3.x Python versions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-12 14:51:03 +02:00
Anas Nashif
a053f1ae05 twister: add simics as supported simulator
Enable simics as a support simulation platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-12 14:49:21 +02:00
Alberto Escolar Piedras
9d5a09668b native_simulator: Get latest from upstream
Align with native_simulator's upstream main
b4b9791ac822ae300363dc3ebbc7b7ac200632ce

Which includes:
* b4b9791 NATIVE_SIMULATOR_IF macros: Provide version with explicit
          section names

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-09-12 14:47:57 +02:00
Pieter De Gendt
d2bae91803 scripts: pylib: twister: Pass testsuite name to cmake
Add a CMake argument with the current testsuite name.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-09-12 10:04:05 +02:00
Wilfried Chauveau
a55bb955af scripts: twister: add type hint to twister_main.py
Twister main expects an instance of TwisterEnv. Let's the linter know
about this.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-09-12 10:03:44 +02:00
Wilfried Chauveau
30dc833cab scripts: twister: Use args rather than injecting members
This changes how some arguments are set in the `Handler`s.
`options`, `generator_cmd` and `suite_name_check` are now passed as
arguments to the constructor rather than injected from an other module.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-09-12 10:03:44 +02:00
Wilfried Chauveau
6d9e5df401 scripts: twister: TwisterEnv is always used with an options parameter
Adjusting the type hints and code accordingly.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-09-12 10:03:44 +02:00