Commit graph

6,360 commits

Author SHA1 Message Date
Thorsten Klein
b9516025ce scripts: west_commands: fix default build directory fallback
fixed fallback to default build directory (build) in case that no other
build directory could be determined.

Signed-off-by: Thorsten Klein <Thorsten.Klein@bshg.com>
2025-09-26 09:09:56 +02:00
Fabio Baltieri
9384cc5b96 Revert "posix: switch to using posix_time.h and posix_signal.h"
This reverts commit 1eb5c97bd6.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-25 14:15:57 -04:00
Chris Friedt
1eb5c97bd6 posix: switch to using posix_time.h and posix_signal.h
To avoid conflicts between the C library's `time.h` and signal.h use an
"override" header (when necessary) for C libraries that do not themselves
provide POSIX definitions in `time.h` or `signal.h`.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-25 12:01:23 +01:00
Grzegorz Chwierut
51cba9d11f twister: Add unit tests for required applications
Added tests for sharing of build application feature
added in #94167

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2025-09-24 19:20:15 -04:00
Jared Wolff
3c7d9732e8 west: runners: probe-rs: Add enhanced functionality
Add comprehensive enhancements to the probe-rs runner:

- New parameters: --reset, --protocol, --speed, --verify, etc
- RTT logging support via 'attach' command
- Smart binary format detection with FileType support
- Enhanced debug/debugserver with improved GDB integration
- Conditional reset after flashing instead of always resetting

Maintains upstream compatibility while significantly expanding
probe-rs capabilities for embedded development workflows.

Signed-off-by: Jared Wolff <hello@jaredwolff.com>
2025-09-24 11:27:40 +01:00
Vladislav Pejic
1d02d57413 driver: adc: Added stream APIs for ADC
Introduce a streaming APIs for ADC devices.
Two new APIs are added to the adc_driver_api: submit and get_decoder.
Added decoder following APIs: get_frame_count, get_size_info, decode,
has_trigger.

Supported triggers are:
- ADC_TRIG_DATA_READY
- ADC_TRIG_FIFO_WATERMARK
- ADC_TRIG_FIFO_FULL
Supported operations to be done on trigger:
- include - whatever data is associated with the trigger
- nop - do nothing with data associated with the trigger
- drop - clear data associated with the trigger

Some changes to the linker scripts were needed to add decoder APIs.

Signed-off-by: Vladislav Pejic <vladislav.pejic@orioninc.com>
2025-09-23 17:50:25 -04:00
Benjamin Cabé
8f4b253ac8 scripts: replace pykwalify with jsonschema
Converted `arch-schema.yml`, `board-schema.yml`, and `soc-schema.yml`
from PyYAML format to JSON Schema format, including baking in some of
the validation rules that were deferred to ad hoc Python right into the
schemas (e.g. mutual exclusivity of certain fields).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-22 17:49:08 -04:00
Thorsten Klein
64723f6b4f scripts: west_commands: list sdk from env variable ZEPHYR_SDK_INSTALL_DIR
Users can specify a Zephyr SDK installation directory using the
`ZEPHYR_SDK_INSTALL_DIR` environment variable. This variable must be
taken into account when listing all installed SDKs, such as with the
`west sdk list` command.

Signed-off-by: Thorsten Klein <thorsten.klein@bshg.com>
2025-09-22 13:33:01 -04:00
Sebastian Bøe
38a0f713a6 soc: nordic: uicr: Add support for SECURESTORAGE
Add UICR.SECURESTORAGE configuration based on device tree partitions.
Validates partition layout and populates size fields in 1KB units.
Handles missing partitions gracefully.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2025-09-22 13:28:55 -04:00
Benjamin Cabé
155a371ecf script: ci: check_compliance: add LicenseAndCopyright compliance check
Implement a new compliance check to ensure that all modified files
have correct licensing information (SPDX-License-Identifier as well as
copyright info).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-19 12:45:41 -04:00
Benjamin Cabé
7d510ac2f9 script: ci: check_compliance: adjust test name formatting
Provide more space to tests with a long name so that output is aligned.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-19 12:45:41 -04:00
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