Commit Graph

5035 Commits

Author SHA1 Message Date
Daniel DeGrasse 66577a9d23 tracing: add named event trace
Add support for a "named event" trace. This trace is intentionally not
used by the system. The purpose of this trace is to allow driver or
application developers to quickly add tracing for events for debug
purposes, and to provide an example of how tracing subsystems can be
extended with additional trace identifiers.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-10-17 10:46:52 -04:00
Lukasz Mrugala 82548410bd scripts: twister: NOTRUN status
Adds a new NOTRUN status, which indicates
that a test was successfully built, but
not run on account of being not
runnable in given test instance.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-10-17 09:46:17 +02:00
Pieter De Gendt ca3dc019b7 scripts: Read yaml files using utf-8 encoding
By default Windows does not use utf-8 encoding for reading files,
set is explicitly.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-10-17 09:43:16 +02:00
Phi Bang Nguyen 829c03bcdc runners: jlink: Fix NoneType object error
The commit 221199e15b presents a bug that
makes west flash failed with error.

AttributeError: 'NoneType' object has no attribute 'startswith'

In function is_tunnel(), tunnel may contain None and has no attribute
"startswith". Fix it.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-16 20:53:31 +01:00
Pieter De Gendt f7e130f982 scripts: ci: check_compliance: Order list alphabetically
Print the compliance checks alphabetically by default.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-10-15 19:08:20 -04:00
Joel Hirsbrunner 7454cb984b Devicetree: Devicetree Bindings: Adjust python tests
Adjust existing tests to support the changes and add new tests to test
the newly added feature.

Signed-off-by: Joel Hirsbrunner <jhirsbrunner@baumer.com>
2024-10-15 04:11:36 -04:00
Joel Hirsbrunner 8b02bc9392 Devicetree: Devicetree Bindings: Support enums for array like dt props
It is currently impossible to use enum with any array like type (i.e.
string-array and array, these are the only ones that make sense) in the
devicetree and dt-bindings.
However, there is no such remark in the dt-bindings section of the docs.
Since this is a feature that comes in very handy and is implemented
fairly easily, I adjusted the scripts for this.

It is now possible to do something like this.
```yaml
compatible = "enums"

properties:
  array-enum:
    type: string-array
    enum:
      - bar
      - foo
      - baz
      - zoo
```
```dts
/ {
	enums {
		compatible = "enums";
		array-enum = "foo", "bar";
	};
};
```

Signed-off-by: Joel Hirsbrunner <jhirsbrunner@baumer.com>
2024-10-15 04:11:36 -04:00
Adam Dunkels 221199e15b runners: jlink: add support for J-Link tunnels
This adds support for J-Link tunnels, which run on top of an IP network
and therefore uses the -IP option. J-Link tunnels are identified by a
tunnel: prefix instead of a bare IP address. This change checks for the
presence of such a prefix, and choses the -IP transport option if the
tunnel prefix is found.

This has been tested with J-Link Remote Server v7.98g and the SEGGER
tunnel option.

Signed-off-by: Adam Dunkels <adam@dunkels.com>
2024-10-15 04:10:18 -04:00
Hake Huang 33fe360bfc tests: twister: runner add runner test
add test for platform in extra_args

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-10-15 04:09:16 -04:00
Hake Huang c759068c40 twister: runner: add extra_args supporting platform and soc
like extra_confs, add extr_args filterable by
soc:<arch>:<extra_args> or
platfrom:<platform name>: <extra_args>
simulation:<simulator name>: <extra_args>

which will only apply to given platform or arch

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2024-10-15 04:09:16 -04:00
Marc Herbert 8b859cea2d west: promote config_get*() functions from sign.py to the base class
These two functions have stood the test of the time and they have
absolutely nothing specific to sign.py

This has the benefit of transitioning away from west's global and
deprecated logging interface
(https://github.com/zephyrproject-rtos/west/issues/149) and this
deprecation is what prompted this commit: see #79240.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-10-15 04:06:42 -04:00
Yonatan Schachter 5da7ba55aa west: bindesc: Added get_offset command
Add `west bindesc get_offset` command to print the offset of
the descriptors inside the given image.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-10-11 13:20:49 -04:00
Moritz Geier da87952948 west: runners: stm32cubeprogrammer: Fixed behaivor if programmer is in path
Enabled west commands to use CubeProgrammer installed in custom directory.

Signed-off-by: Moritz Geier <moritz.geier@proton.me>
2024-10-11 13:20:29 -04:00
Ioannis Damigos 7455bf50d2 twister: Fix reported testcase execution time
Testcase execution time doesn't match between twister.xml and
twister.log. Testcase execution time is the sum of the previous
testcases' execution time plus its own execution time in
twister.xml.

This patch fixes the issue above.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2024-10-11 09:27:51 +02:00
Jordan Yates 97db13dc09 scripts: west_commands: runners: propagate arguments
Provide a mechanism to propagate useful arguments from one runner to the
next. The primary use case for this is to propagate a JLink serial
number, so that if it is queried from the terminal the user only needs
to make the choice once.

Implements #76077.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-10 20:24:35 -04:00
Dmitrii Golovanov 27456ed2b5 twister: blackbox: coverage: fix matching pattern
Fix the expected pattern randomly matched to coverage.json contents
ordered differently at test_coverage_basedir().

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2024-10-10 04:19:56 -04:00
Benjamin Cabé acbda31707 west: boards: add full_name support in format string
The recently introduced board.full_name property can now be used as part
of the format string in the `west boards -f ...` command.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-10 10:06:31 +02:00
Jamie McCrae dd7ce12d68 scripts: west_commands: sign: Deprecate imgtool signing
Deprecates signing for imgtool using west sign

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-08 17:00:46 +02:00
Torsten Rasmussen 24ee391231 west: support build info file for west build
For pristine builds 'west build' will now create a build_info.yml file
containing the west build command including arguments.

This is done to help users and external tools to recreate builds.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-08 17:00:30 +02:00
Torsten Rasmussen 5d5c2d4775 cmake: introduce build_info function
The build_info function provides a generic and stable way of dumping
build information to the <build>/build_info.yml file.

The build info file is in YAML format and the keys in the file are
intended to be stable, as to allow external tools to retrieve
information regarding the build.

The main differences to the CMakeCache.txt are:
- Settings in the CMakeCache.txt are user controlled, whereas the
  information in the build info file is intended to be those values
  which are used by the build system regardless if those are specified
  by the developer or picked up automatically.
- Internal build system variables are not present in the CMake cache
  and should not be, because their values are calculated when CMake
  runs.

This also has the benefits of decoupling CMake variable names from
build info keys. Several CMake variables has internal build system
names, and the build system is free to rename those at its own
discretion.

Having dedicated key names ensures a stable API that external tools can
rely upon.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-08 17:00:30 +02:00
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