Commit graph

5778 commits

Author SHA1 Message Date
Benjamin Cabé
ced0cc307d ci: manifest: SHA pin west in manifest.yml workflow
Ensure we install a fully pinned west version, including requiring
hashes for all dependencies.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-12 19:24:27 -04:00
Anas Nashif
eace70cce6 scripts: set_assigner: fix python lint issues
Fix various issues detected by ruff and remove exclusion of file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-12 14:23:25 -04:00
Anas Nashif
0c715dde08 scripts/set_assignees.py: set assignee on manifest changes
Parse manifest for changes and set assignees for any manifest entries
that have changed.

Other changes:
- Do not assign to meta area when additional areas are being changed
- Cleanup of unused code
- Comment where comments are needed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-12 14:23:25 -04:00
Anas Nashif
06f29aabc9 scripts/get_maintainer.py: find area by name
Find an area by name.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-12 14:23:25 -04:00
Benjamin Cabé
b1c7f9c126 scripts: do not install/recommend vulnerable python packages
requests < 2.32.4 is subject to GHSA-9hjg-9r4m-mvj7
pyyaml < 5.4 is subject to GHSA-8q59-q68h-6hv4
pyyaml < 5.1 is subject to GHSA-rprw-h62v-c2w7
protobuf < 5.29.5 is subject to GHSA-8qvm-5x2c-j2w7

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-12 14:23:18 -04:00
Miguel Gazquez
915b34e4ae scripts: west_commands: fix typo in west sdk install help message
The help message for the option '-d'/'--instal-dir' of 'west sdk
install' incorrectly use '-b' in its help message.
Fix the typo by using '-d'.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2025-09-12 14:22:20 -04:00
Jamie McCrae
f624525f30 kconfig: Load Kconfig env file better
Loads this file in a better way that means samples and modules
should not have to source the file before referencing Kconfig
module path variables

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-09-12 13:19:56 +02:00
Jamie McCrae
7e6013c400 scripts: requirements: Add python-dotenv
This is needed for any Kconfig processing

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-09-12 13:19:56 +02:00
Flavio Ceolin
902a9269b4 sw_isr_table: Remove unused macro parameter
irq is not used by _Z_ISR_TABLE_ENTRY and
_Z_ISR_DIRECT_TABLE_ENTRY. Just remove it.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-09-12 08:19:36 +01:00
Daniel DeGrasse
1866e00fb6 scripts: west_commands: openocd: run gdb in batch mode for RTT
Run GDB in batch mode when using RTT, so that pagination is never
enabled. This fixes RTT support when using terminals with a very small
row count.

Fixes #92417

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-09-12 08:19:05 +01:00
Benjamin Cabé
a1621ac7ec scripts: west_command: patch.py: fix sha256 bug on windows
Fix SHA256 verification failures on Windows by ensuring consistent
line ending handling in patch files. Replace inline hash calculation
with existing get_file_sha256sum() function and modify it to read
files as text with normalized line endings before encoding to UTF-8
for hashing.

This ensures cross-platform compatibility and prevents patch
integrity check failures due to CRLF/LF differences between
operating systems.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-10 18:37:33 +02:00
Fabio Baltieri
88f8d85754 do_not_merge: count all completed workflows as completed
Drop the success check for completed workflow so that the job does not
wait forever for workflows that have failed.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-10 08:27:46 +02:00
Stephanos Ioannidis
3c1f7f1c71 scripts: requirements-action: Require PyGithub >= 2.7.0
PyGithub >= 2.7.0 is required for the
`Repository.get_collaborator_role_name` function used by the maintainer
check script.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2025-09-09 10:00:29 -04:00
Stephanos Ioannidis
5a4b0ac4d7 scripts: check_maintainer_changes: Fix GitHub user access check
The PyGithub `Repository.get_collaborator_permission` function invokes the
GitHub REST API `/repos/{owner}/{repo}/collaborators/{username}/permission`
and returns the value of the `permission` attribute in the response.

As per the GitHub documentation [1], the `permission` attribute "provides
the legacy base roles of admin, write, read and none, where the maintain
role is mapped to write and the triage role is mapped to read", and this
caused the users with `triage` permission level (i.e. the users in the
`contributors` team) to be incorrectly flagged by the script.

This commit updates the script to use the `get_collaborator_role_name`
function, which correctly returns the up-to-date user permission/role name,
including `maintain` and `triage`.

Note that the `get_collaborator_role_name` function is only available in
PyGithub>=2.7.0.

[1] https://docs.github.com/en/rest/collaborators/collaborators?apiVersion=2022-11-28#get-repository-permissions-for-a-user

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2025-09-09 10:00:29 -04:00
Fabio Baltieri
c0c757d892 twister: use csv to split extra argument arguments for west flags
Use csv instead of a plain split to split extra arguments for extra west
flags, this allows correct passing of arguments that are internally
escaped in quotes, such as arugments containing commas.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-09 11:44:54 +02:00
Omri Sarig
f55dcc91df scripts/logging: Add support to RTT reading from JLink
Update the live logger to be able to read the logs from JLink, over the RTT
protocol.
The support for the jlink-rtt mode is done similarly to the currently
existing support for files and serials.

The implementation for opening the jlink for reading was inspired by the
available example from the pylink python implementation here:
https://github.com/square/pylink/blob/master/examples/pylink-rtt

In contrast to the other readers, the jlink-rtt does not support being
polled from 'select'.
To make it possible to work with such readers, the code was updated to
allow for busy-waits, instead of smart polling.
This change does not affect the current readers, but support the new
reader, and allows for future readers which does not support smart polling.

Signed-off-by: Omri Sarig <omsi@demant.com>
2025-09-09 10:31:03 +02:00
Sebastian Bøe
3648cd87d4 soc: nordic: gen_uicr: Support secondary firmware
Add support for secondary firmware in gen_uicr.py.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2025-09-08 15:52:20 -04:00
Anas Nashif
d98184c8cb arch: boot: rename z_early_memcpy -> arch_early_memcpy
Do not use private API prefix and move to architecture interface as
those functions are primarily used across arches and can be defined by
the architecture.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-08 15:51:07 -04:00
Anas Nashif
641fc4a018 arch: init: rename z_early_memset -> arch_early_memset
Do not use private API prefix and move to architecture interface as
those functions are primarily used across arches and can be defined by
the architecture.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-08 15:51:07 -04:00
Anas Nashif
53a51b9287 kernel/arch: Move early init/boot code out of init/kernel headers
Cleanup init.c code and move early boot code into arch/ and make it
accessible outside of the boot process/kernel.

All of this code is not related to the 'kernel' and is mostly used
within the architecture boot / setup process.

The way it was done, some soc code was including kernel_internal.h
directly, which shouldn't be done.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-08 15:51:07 -04:00
Fabio Baltieri
9b7c4c85c8 list_backports: fix typo
Fix typo, organisation -> organization.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-06 06:35:37 -04:00
Fabio Baltieri
102be7bbf0 scripts: do_not_merge: take a repo and org argument
Take a repo and org argument to the do_not_merge.py script so it can be
used in the testing repository.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-06 06:35:37 -04:00
Marc Herbert
8ad23f8313 twister: add space in custom_flash_scripts example and test
This makes sure parsers don't trip over whitespace (as many do).

I suggested this late in #93944

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2025-09-05 17:11:51 +02:00
Krzysztof Chruściński
9f4bd38ef7 scripts: west_commands: build: Fix warning during rebuild
5718af02c5 introduced a regression where a warning was printed
about unknown BOARD when rebuilding. Commit moved _find_board()
to an earlier stage and that was failing during the rebuild. Instead
of moving board finding earlier we can move parsing of the test_item
to the later stage as it is needed only just before running cmake.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-09-05 12:28:01 +02:00
Pieter De Gendt
1e737d7a5f scripts: west_commands: twister_cmd: Fix twister wrapper
Commit 4f637258ef reworked the twister main
function. Update the west wrapper to align with that change.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-09-05 09:31:33 +02:00
Benjamin Cabé
198147a49b scripts: kconfig: use tabulate for printing hardenconfig results
Make use of `tabulate` to pretty print the results of the hardening tool
instead of custom formatting.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-04 21:03:57 +02:00
Benjamin Cabé
5e032d7f84 scripts: kconfig: apply ruff fixes to hardenconfig.py
Wrap long lines so that there is no need to exclude this file from ruff
anymore.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-04 21:03:57 +02:00
Lukasz Fundakowski
4f637258ef twister: refactor twister_main to simplify the system tests
Refactored twister_main.py module to simplify the code and system tests.
Removed the need to patch `sys.argv` in blackbox tests.

Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
2025-09-04 16:45:42 +02:00
Noah Pendleton
6169269da8 west: blobs: fetch --allow-regex filter
When building in CI for specific SOCs, it's useful to only have `west blobs
fetch` pull a selected set of blob objects. This is especially helpful on
`hal_espressif`, which currently has 78 blob objects.

Add a `--allow-regex` arg to the `west blobs fetch` subcommand to filter
only specified blobs, for example:

```bash
# only download esp32 blobs, skip the other variants
❯ west blobs fetch hal_espressif --allow-regex 'lib/esp32/.*'
```

Also, replace all `str.format()` invocations with f-strings per review
feedback.

Signed-off-by: Noah Pendleton <noah.pendleton@gmail.com>
2025-09-04 16:44:52 +02:00
Declan Snyder
7e92b70437 include: devicetree: Add more PHA macros
Add more macros for interacting with controller/data type of
relationships (phandle arrays / cells)

Add macros for arbitrarily iterating cells of phandle specifiers

Add tests for the new macros

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-09-04 14:43:13 +02:00
Pieter De Gendt
b42d89c67f scripts: footprint: Add a plot script for size reports
Add a helper script that can take in a size report in json and render it in
a sunburst chart.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-09-04 14:42:52 +02:00
Benjamin Cabé
0132ea07fb doc: fix spelling errors tree-wide
fix some spelling errors in code comments and Kconfig helps

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Lukasz Fundakowski
6fcb3ff219 twister: refactoring: Improve error message when test failed
Modified the assertion statements to raise informative exceptions
that indicate which lines did not pass the assertions.
Added unit tests using pytest to validate the functionality of
the modified functions.

Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
2025-09-03 11:03:47 +02:00
Jamie McCrae
4977c5cef9 scripts/kconfig/cmake: Generate/use env file for zephyr module paths
Adds a output env file that lists the paths of zephyr modules
which can be used in Kconfig files and uses this in Kconfig. Also
updates Kconfig doc output to generate and use this

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-09-03 11:03:40 +02:00
Sylvio Alves
4651a02ff4 twister: reset ESP32 via RTS/DTR to capture early boot logs
When testing ESP32-based platforms in CI, early boot logs can be missed
if the serial connection isn't reset properly. This patch applies the
standard RTS/DTR toggle sequence to reset the ESP32 after flashing,
ensuring consistent log capture from the very beginning.

The logic is applied conditionally when the runner is "esp32".

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-09-03 11:03:20 +02:00
Henrik Brix Andersen
36f78b52b7 scripts: valgrind: suppress missing clean-up in nct_new_thread()
Suppress memory leaks detected by valgrind originating from
nct_new_thread(), part of the native_sim CPU thread emulation.

This covers calls to posix_new_thread() as well, since this function simply
calls nct_new_thread (but may be optimized out by the compiler).

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-09-03 06:10:49 +02:00
Fabio Baltieri
867676c906 twister: pass flash_command to the harness
Add the necessary logic to pass the custom flash_command to the pytest
harness.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-03 06:10:37 +02:00
Fabio Baltieri
a31f784e95 twister: add a --flash-command flag
Currently twister requires west to flash a board, either directly using
west-flash or indirectly through the cmake flash target.

Add an option to specify a custom flash script, this is passed a
build-dir and board-id flags so it can be used to implement custom
flashing scripts in a system that does not use west.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-03 06:10:37 +02:00
Fabrice DJIATSA
7ff93d7454 scripts: twister: pylib: not needed board id with BOOT-SERIAL mode
STM32CubeProgrammer does not support flashing in BOOT-SERIAL mode
using the device's serial number.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-09-02 15:54:07 +02:00
Anas Nashif
232db11f0d twister: tests: fix test output parsing
Fix test output parsing and update to what twister produces.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-02 10:00:24 +02:00
Anas Nashif
8d0a6b59c6 twister: do not use twister internals for reason field
Do not use twister internals for reason field.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-02 10:00:24 +02:00
Anas Nashif
a6277ddaef twister: remove stray debug message
Remove leftover debug message.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-09-02 10:00:24 +02:00
Sebastian Bøe
aa2a439299 west: runners: nrf_common: Delete deprecated suit handling
Delete deprecated suit handling.

SUIT is no longer supported.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2025-09-01 16:56:02 +01:00
Torsten Rasmussen
795445535d scripts: parse module.yml for dts bindings
Change BoardYml compliance check from using get_module_setting_root()
to load and parse module.yml directly.

get_module_setting_root cannot be used directly with module.yml.
Instead adjust the code so that the module.yml file is loaded locally
and the dts_root setting is extracted from the dictionary.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-09-01 12:00:42 +02:00
Anas Nashif
f42dc20073 twister: deal with status/reason setting in handler in one place
Multiple handlers were setting status/reason in slightly different ways,
but the code was mostly trying to do the same. Put this code in the
handler class and implement in one place.

This fixes an issue where in some cases qemu failures were not handled
correctly and status of cases was not updated, leading to multiple
failures.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-31 06:17:16 -04:00
Tim Pambor
375d51452e scripts: twister: Fix --flash-before with serial-pty script
Honor the --flash-before option when using a serial-pty script with
--device-serial-pty <script> and start the script only after
flashing the device.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-08-30 18:00:32 +01:00
Anas Nashif
de8914ddc0 twister: coverage: --gcov-object-directory works with >= gcovr 7.0
This command line option is not available in older versions of gcovr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-30 18:00:09 +01:00
Anas Nashif
d175b5005d twister: tests: resolve warning about function being uncallable
Get rid of warnings about uncallable functions due to variable names
having test prefix.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-30 18:00:09 +01:00
Anas Nashif
d0675936da twister: tests: fix failing blackbox tests
Few tests failing and were not caught due to CI not running.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-30 18:00:09 +01:00
Lukasz Fundakowski
71a5f29150 twister: Add configuration reader to pytest-twister-harness
Added a class that helps to read Kconfigs from a configuration file.

Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
2025-08-30 12:30:26 +02:00