Commit graph

5,899 commits

Author SHA1 Message Date
Benjamin Cabé
95e91d67e1 scrips: ci: check_compliance: organize imports
organize import and fix associated ruff exlude rule

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-19 12:45:41 -04:00
Fabio Baltieri
7a814345d1 scripts: update the Github auth API
Fixes: /home/runner/work/zephyr/zephyr/scripts/ci/do_not_merge.py:66:
DeprecationWarning: Argument login_or_token is deprecated, please use
auth=github.Auth.Token(...) instead

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-19 16:35:15 +02:00
Gerard Marull-Paretas
6dacc14d2b scripts: west_commands: runners: add sftool runner
So we can flash using sftool.

Ref. https://github.com/OpenSiFli/sftool.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2025-09-19 16:34:15 +02:00
Nicolae Dicu
67b4063a20 scripts: requirements: Use gitlint-core for loose requirements
Gitlint-core has loose requirements and not conflicting
with scancode-toolkit v32.4.1 (click==8.1.3 vs click>=8.2.0).

Signed-off-by: Nicolae Dicu <nicolae.dicu@nordicsemi.no>
2025-09-19 08:35:53 -04:00
Jordan Yates
61298e31c7 scripts: twisterlib: more efficient coverage merging
Use `collections.defaultdict` to simplify code, and use the `bytes`
type internally rather than hex strings.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-19 08:34:32 -04:00
Jordan Yates
aa08e0df20 testsuite: coverage: convert dump method to choice
To support future coverage dump methods (semihosting) move
`COVERAGE_DUMP` inside a choice symbol.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-19 08:34:32 -04:00
Romain Pelletant
732823e0c6 posix: options: replace kconfig for rw lock
- Update Kconfig from CONFIG_POSIX_READER_WRITER_LOCKS to POSIX_RW_LOCKS

Signed-off-by: Romain Pelletant <romainp@kickmaker.net>
2025-09-19 08:27:49 -04:00
Cherniaev Andrei
fceca3b268 doc: Kconfiglib development has moved
Details https://github.com/ulfalizer/Kconfiglib/issues/139

Signed-off-by: Cherniaev Andrei <dungeonlords789@naver.com>
2025-09-18 13:49:22 -04:00
Benjamin Cabé
635e7c7261 sca: add DT diagnostic tool
implemented as an SCA for now but might benefit from being baked into
the build system so that it's always available.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-18 15:42:42 +01:00
Jiafei Pan
77b000faaa requirements: update spsdk version
Update spsdk version to fix dependency confliction with other software.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-09-17 08:48:05 +02:00
Tamás Kiss
14d24b1698 script: logging: fix formatting of dropped messages
Print the actual number instead of a single-element tuple.
For example: "2 messages dropped" instead of "(2,) messages dropped"

Signed-off-by: Tamás Kiss <tmik@demant.com>
2025-09-16 13:06:12 -04:00
Miguel Gazquez
5335b7c424 scripts: west_commands: correct f-string in board mismatch error message
The board mismatch error message in `scripts/west_commands/build.py` was
partially missing f-string formatting. This caused `{self.args.board}`
to be printed literally instead of being replaced with the actual board
value.

Fix the f-string.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2025-09-16 16:05:03 +02:00
Bill Waters
e20c04a320 scripts: west_commands: runners: openocd path fix
There is a fix that is needed for building on Linux and
running on Windows.  Without this fix, the scripts throws
errors and fails because of the '\' instead of '/'.  For
portability, the script should not use literal slashes.

Signed-off-by: Bill Waters <bill.waters@infineon.com>
2025-09-15 19:44:17 -04:00
Thomas Stranger
340c59cc80 scripts: west_commands: zspdx: fix log ref to meta file
The build output meta data is written to the zephyr.meta
file not zephyr_meta.yml.
This name is defined by KERNEL_META_NAME in cmake/modules/kernel.cmake.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2025-09-15 19:44:07 -04:00
Leonardo Bispo
df0cb360fa script: trim RTT log data on dictionary parser
The fact that log data captured with RTT has a header, like the
following, impedes the parser to parse the data properly

```
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
SEGGER J-Link V8.24 - Real time terminal output
SEGGER J-Trace PRO V4.0, SN=XXXX
Process: JLinkExe
```

Signed-off-by: Leonardo Bispo <l.bispo@live.com>
2025-09-15 14:07:11 -04:00
Hake Huang
4c8419b992 twsiter: binary handler: pass verbose setting to west call
pass verbose setting to west call. when the v > 2 west log
will be triggerred

Signed-off-by: Hake Huang <hake.huang@nxp.com>
2025-09-15 14:43:51 +02:00
Grzegorz Chwierut
bf2378e36b twister: scripts: sharing of built applications
This feature enables sharing of built applications between test
scenarios, allowing tests to access build artifacts from other
applications.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2025-09-15 10:29:40 +02:00
Rico van Dongen
8bb976ad12 scripts: west_commands: zspdx: re-naming PACKAGE-MANAGER
According to the SPDX specification
PACKAGE-MANAGER should be spelled with a dash not an underscore

Signed-off-by: Rico van Dongen <rdongen@ziggo.nl>
2025-09-13 18:15:24 -04:00
Rico van Dongen
02da120792 scripts: west_commands: zspdx: updating sbom data based on cpe reference
The PackageName, PackageVersionand and PackageSupplier in the generated
SBOM will be updated based on the information passed in the
external-references in the module.yml.
This way packages are better recognized by vulnerability scanning tools
like cve-bin-tool.

Signed-off-by: Rico van Dongen <rdongen@ziggo.nl>
2025-09-13 18:15:24 -04:00
Hake Huang
504fb0158f doc: scripts: display_harness: update document on installation
add Installation Guide section

Signed-off-by: Hake Huang <hake.huang@nxp.com>
2025-09-13 11:21:53 -04:00
Hake Huang
2d8a6d23f8 tests: display: support headless mode
for test machine without display, need support open-cv-headless mode.

1. support headless mode
2. add parser for environment path

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2025-09-13 11:21:53 -04:00
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