Commit graph

5,899 commits

Author SHA1 Message Date
Anas Nashif
dda57865c0 twister: adapt tests for new TestConfiguration class
Adapt test to new test configuration class.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-14 07:11:22 -10:00
Anas Nashif
4d82c48789 twister: make test configuration handling a class
Split test configuration code into own class and do parsing in two steps
to get the right context of platforms and scenarios.

Fixes zephyrproject-rtos/zephyr#89774

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-14 07:11:22 -10:00
Benjamin Cabé
125b23ba02 twister: harness: power: fix amp to milliamp conversion
Fix amp to milliamp conversion where a 10^4 factor was applied instead
of 10^3.
Adjust existing test cases accordingly (including a small change to one
of the expected RMS values in pm.power_states that either changed
since the test was introduced or was set too aggressively back then).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-11 08:16:58 -10:00
Flavio Ceolin
1de500e89f kconfig: hardenconfig: Add support for insecure option
Treat insecure options in Kconfig options.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-07-10 16:00:26 -05:00
Flavio Ceolin
674fd094aa build: kconfig: Add support for warning insecure features
Add a new promptless Kconfig symbol (INSECURE). This symbols must
be selected by any setting which is used to enable an insecure
feature.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-07-10 16:00:26 -05:00
Emilio Benavente
1142c40c5a scripts: west_commands: runners: Update GDB args
Update gdb arguments to enable linkserver
debugging when app does not reset after load.
This is useful for when the app is loading to
ram. In this case if gdb reset after loaded the
ram would be flushed when debugging and there would be
nothing no image in ram to debug.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2025-07-04 14:20:30 -10:00
Benjamin Cabé
f672cb72d4 Revert "doc: ci: Zephyr now requires Python 3.12 or higher"
This reverts commit 043bb58488.

Note that  scripts/requirements-actions.txt might not be 100% the same
as what was pinned prior to the revert due to it being difficult to
restore previous versions while also accounting for the new dependencies
that were added in the meantime.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-04 15:50:06 -05:00
Benjamin Cabé
daf5584c63 Revert "scripts: Bump Python target version for ruff"
This reverts commit e8caaf4137.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-04 15:50:06 -05:00
Fabio Baltieri
42e8837085 scripts: do_not_merge: wait for manifest before checking
Seems like github relabel rerun is susceptible to race conditions and
may not rerun the label check script if the manifest workflow runs at
the same time.

Delay the check to explicitly wait until the currently checked sha had a
successful manifest run.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-03 11:59:56 -05:00
Fabio Baltieri
db18e4c507 scripts: do_not_merge: integrate the empty body check in the python file
No point spreading the logic around, the python file already has the
data, check it there.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-03 11:59:56 -05:00
Fabio Baltieri
5b743871b8 scripts: do_not_merge: add some debug prints
Log the PR link and labels, may come in handy for troubleshooting down
the road.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-03 11:59:56 -05:00
Mirko Covizzi
5b3a48c063 scripts: requirements-base: pin patool to >=2.0.0
This resolves an issue on MacOS where
`west sdk install` would fail when extracting
a `.tar.xz` package due to the command line
options selected by patool.

Signed-off-by: Mirko Covizzi <mrkcvzz@gmail.com>
2025-07-03 11:54:10 -05:00
Katarzyna Giądła
9b428c8e5f twister: Fix tests statuses if quarantine is verified
If test configuration is not quarantined and `--quarantine-verify`
mode is enabled, these should be filtered and not attached
to reports.

Proposed change applies this approach.

Signed-off-by: Katarzyna Giądła <katarzyna.giadla@nordicsemi.no>
2025-07-01 10:17:53 -05:00
Katarzyna Giądła
bec789d364 twister: Enable gathering footprint if test plan exists
If test plan is used, memory usage metrics are overridden.
Result of this operation is missing memory footprint.

This change removes redundand metrics update and fixes
described inconvenience.

Signed-off-by: Katarzyna Giądła <katarzyna.giadla@nordicsemi.no>
2025-07-01 10:16:32 -05:00
Vignesh Pandian
810536251d scripts: checkpatch: False alarm warning for macros.
Remove false alarm warning of
`braces {} are required around if/while/for/else`
for macro definitions with if/while/for/else.

Signed-off-by: Vignesh Pandian <vignesh@aerlync.com>
2025-06-30 15:20:28 -05:00
Daniel DeGrasse
0b0af06da5 scripts: pylib: fix twister report handling for junitparser >= 4.0.2
With junitparser 4.0.2, the JunitXml.fromfile() now returns a JUnitXml
instance. In order to access the junit.TestSuite instance, we must use
TestSuite.fromelem() to convert it back.

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-06-27 18:28:50 -05:00
Henrik Brix Andersen
08175f816a scripts: kconfig: functions: add dt_compat_enabled_num function
Add dt_compat_enabled_num Kconfig helper function for counting the number
of compatible nodes with status okay.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2025-06-27 10:07:01 -05:00
Jérôme Pouiller
ca9650134f soc: silabs: siwx91x: Clean output names
The siwx91x need a specific firmware image format. These image end with
.rps extension. The current name of the image is zephyr.bin.rps. However,
the .bin suffix is not relevant. It makes even more sense if we consider
the output of west sign: zephyr.signed.bin.rps. We can simplify these name
by remove the .bin suffix.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-27 10:06:16 -05:00
Jérôme Pouiller
00b3c53704 soc: silabs: siwx91x: Support "west sign"
Silabs siwx91x support signed and encrypted firmwares. This PR includes
support for these features in "west sign"

Co-developed-by: Aasim Shaik <aasim.shaik@silabs.com>
Signed-off-by: Aasim Shaik <aasim.shaik@silabs.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-06-27 10:06:16 -05:00
Tomasz Bursztyka
653f1bf123 scripts: Removing init function pointer from check_init_priorities.py
As the pointer has been removed from struct init_entry, there is no point
to look for it nor to display any information about it (obviously).

Fixing the test script as well.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-06-27 14:13:58 +02:00
Grzegorz Chwierut
c6b3b9342c twister: pytest: Add support for mcumgr go tool with BLE
Added basic support to run upgrade with mcumgr tool
using BLE transport.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2025-06-27 12:21:56 +02:00
Andrey VOLKOV
957f10c3a0 edtlib: add new tests for 'interrupt-map'
Add tests to check the correctness of '#address-cells' usage.
The missing tests have allowed bug #77890 to persist for years.

Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
2025-06-27 10:57:38 +02:00
Ioannis Damigos
871afee41c edtlib: fix _raw_unit_addr() function
The '_raw_unit_addr()' function was incorrectly written a long time ago.
It tries to look up and use the '#address-cells' of the node containing
the 'interrupts' property itself, instead of using the '#address-cells' of
the interrupt controller's node (or its parent).

As a result, the mapping is successful only if the '#address-cells' value
is the same in both the node and the interrupt controller, all other cases
lead to random errors being generated by the 'gen_defines.py' script.

Also, the function was trying to use the '#address-cells' value as a
little-endian one, which led to unpredictable results as well.
This problem has been fixed too.

Fixes #77890, and probably #78020

Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2025-06-27 10:57:38 +02:00
Ioannis Damigos
1b1bfc9cc8 edtlib: Improve _interrupt_parent() function
According to the following comment on github
https://github.com/zephyrproject-rtos/zephyr/pull/77900/files#r1750393745
edtlib implementation is partially correct and it is missing two things:

1. If an ancestor has an interrupt-controller or interrupt-map property,
   the walk must terminate.
2. If an interrupt-parent property is found, the linked node must be a
   valid interrupt controller or nexus.

This commit add these checks.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2025-06-27 10:57:38 +02:00
Marco Widmer
07b4f30b2d pytest twister harness: increase timeout when stopping subprocess
When running pytest tests with coverage enabled, the test process starts
to write the coverage data when it receives the SIGTERM signal. On slow
machines, this can take longer than 0.5s. Increase the timeout and only
attempt to kill the process if it is still running after the timeout.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2025-06-26 10:59:12 -05:00
Keith Packard
a8eed43491 scripts/logging: Add RX config detection
The RX arch uses the CONFIG_RX kconfig symbol

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-06-26 14:07:03 +02:00
Keith Packard
209c723b3f scripts/logging: Skip log symbols of zero size
I'm not sure why this was necessary, but analyzing RX
executables was crashing with a divide by zero error on a
symbol which appeared to be duplicated in this list.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-06-26 14:07:03 +02:00
Keith Packard
296d81ad58 scripts/logging: Allow targets that prefix global symbols with '_'
RX adds an underscore to all global symbols, so when we look for
log_const_ globals, we need to allow for that.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-06-26 14:07:03 +02:00
Dmitrii Golovanov
208a8b3ac7 twister: Enable 'flash-before' mode on serial-pty
Enable `flash-before` mode for devices connected via serial-pty
the same way, as for physical serial.

This mode allows Twister to start reading from the DUT's serial
connection only after the flashing stage has been completed,
thus excluding an early part of the log stream not directly
related to the current test.

It can help in situations, when the device is connected via some
serial-over-network harness which is still transferring device
logs or keeping in its buffer a tail with different RunID etc.
from the previous test image run.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2025-06-24 20:05:46 -10:00
Chris Friedt
e363fdd16b scripts: ci: check_compliance: allow CONFIG_BOARD_UNIT_TESTING
Previously, code like the snippet below would not pass compliance checks.
With this change, we add `CONFIG_BOARD_UNIT_TESTING` to the Kconfig allow
list, so that code like the snippet below is not incorrectly reported as
a compliance failure.

```
if defined(CONFIG_BOARD_UNIT_TESTING)
/* unit-testing only */
endif
```

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-06-24 14:18:52 +02:00
Benjamin Cabé
b315a77808 scripts: dts: edtilb: inclusive language fix
replace "grandfathered-in" by the more inclusive "legacy"

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-23 16:31:16 -05:00
Pieter De Gendt
e8caaf4137 scripts: Bump Python target version for ruff
Now that Python 3.12 is the minimum required version for Zephyr, ruff
should target that instead of 3.10.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-23 15:48:57 +01:00
Mathieu Choplain
19fe604aef scripts: west_commands: runners: add ST-LINK GDB server
Add the ST-Link GDB server (part of the STM32CubeCLT) as west runner.

The STM32CubeCLT is an all-in-one multi-OS command-line toolset, which is
part of the STM32Cube ecosystem, and notably includes a GDB server for
debugging using ST-Link probes.

This runner supports the "attach", "debug" and "debugserver" commands.

Documentation: https://www.st.com/en/development-tools/stm32cubeclt.html
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2025-06-23 15:47:17 +01:00
Benjamin Cabé
8031f338dd scripts: west: spdx: extract copyright info
use REUSE to extract copyright text from source files and include in

SBOM documents
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-23 13:42:35 +02:00
Anas Nashif
bd8597c9d7 x86: rename DEBUG_INFO to X86_DEBUG_INFO
This is an X86 specific option and should not appear as generic debug
option.

Fixes zephyrproject-rtos/zephyr#52929

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-20 14:43:42 -05:00
Jamie McCrae
6d73a9c45a scripts: ci: check_compliance: Add support for modules for Kconfig
Adds support for checking modules for disallow Kconfig's in boards
and SoCs, which have been defined in a Zephyr module file

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-06-20 14:41:20 -05:00
Pieter De Gendt
e454aaa6b6 scripts: ci: check_compliance: Pass path representation to magic
On windows the Magic.from_file method fails to convert a PathLike to its
representation.
Pass using os.fspath.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-20 13:25:45 -04:00
Benjamin Cabé
ba56cd1020 scripts: ci: disable trailing-whitespace check in SphinxLint
SphinxLint doesn't need to report trailing whitespace errors as it's
already checked by checkpatch.pl.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-20 13:21:13 -04:00
Anas Nashif
c1229e308f ci: remove pylint checks covered by ruff
Few rules are duplicate and are reported multiple times, so disable
those from pylint and rely on ruff reporting them.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-20 08:52:22 +02:00
Anas Nashif
91dc04d5d0 twister: adapt ctest results for twister
When we have skips in ctest, the overall result should not be marked as
a SKIP unless all tests have been skipped. If we have passing tests,
mark the test as PASS. Any failures/errors obviously will fail the
tests.

Also pass the skip reason from ctest to twister to give a hint about
what is going on in case of skips.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-19 14:04:18 +02:00
Anas Nashif
c511b16fca twister: remove useless . at end of message
No need to have a period here.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-19 14:04:18 +02:00
Benjamin Cabé
043bb58488 doc: ci: Zephyr now requires Python 3.12 or higher
Update getting started guide, release notes, CI actions and
Python version compliance check to use Python 3.12 as
minimum supported version.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-19 13:56:59 +02:00
Anas Nashif
43971ea0d5 ci: add member check
Verify that collaborators/maintainers added to the MAINTAINERS.yml file
actually have access to the project and are members.
Only those who already gained access following the process shall be
added to the file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-18 17:47:54 -04:00
Benjamin Cabé
14ea8b087b tests: cmake: actually test SBOM files generation
The current test was just a basic sanity check.
This adds actual validation of the SPDX files being generated as
being spec-compliant.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-18 17:45:16 -04:00
Fabio Baltieri
a626d865c0 scripts: do_not_merge: print the API limit stats
This information is useful for troubleshooting and not available
anywhere else, does not quite belong to this script but this runs for
every PR so it's not a bad place to have it.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-06-18 09:54:12 -04:00
Camille BAUD
d03b7ffdbb scripts: gen_edt.py: add ability to get properties from /cpus
Adds ability to get properties from the /cpus group,
in the goal of retrieving timebase-frequency for CPU groups.

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-06-18 09:12:26 -04:00
Fin Maaß
0d8f41b594 scripts: Fix bindings style migration script
the script is in the utils subdir, which it didn't knew.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-06-18 09:08:05 -04:00
Joel Holdsworth
56e5121d39 code_relocation: Handle relocation of noinit sections
The code relocation feature allows code and data section to be located
inside a designated RAM region.

Currently, this feature supports relocation of code (text) and data
including mutable data (data), read-only data (rodata), and
zero-initialized data (bss).

However, relocation of non-initialized data sections was not previously
supported, meaning that any data annotated with the __noinit attribute
could not be relocated into the desired RAM region.

This patch adds a NOINIT memory-type which can be used implicitly or
explictly in the zephyr_code_relocate() CMake function. This causes the
build system to generate additional linker-script section-matching rules.

By the nature of noinit data, no action is required by Zephyr at boot.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-06-18 11:16:37 +01:00
Grzegorz Swiderski
64bb8b6796 scripts: kconfig: Add hex variants of arithmetic functions
Functions like `add` and `sub` can only return base 10 integers, which
means they can't really be used to define Kconfig symbols of type `hex`.

For the same reason, there already exist pairs of devicetree functions
named e.g., `dt_node_reg_addr_(int|hex)` after different return types.

Introduce `add_hex`, `sub_hex`, and friends.

To avoid confusion, it should be possible for those new functions to
accept arguments in base 16 as well. It's actually easier to let all
arithmetic functions take their inputs in "any" base, by leveraging
Python's built-in: `int(..., base=0)`.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-06-17 16:09:41 +02:00
James Roy
4240853a06 scripts: ci: Add CI bindings style checker
Implement a check in the CI pipeline to enforce
that property names in device tree bindings do
not contain underscores.

Signed-off-by: James Roy <rruuaanng@outlook.com>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2025-06-17 16:03:54 +02:00