Commit Graph

5996 Commits

Author SHA1 Message Date
Anas Nashif
349917eef5 twister: fix variant handling
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-12-16 17:17:29 +09:00
Anas Nashif
f3aa334e57 twister: support new toolchain variant syntax
support new syntax involving compiler and toolchains with multiple
compilers, i.e. zephyr/gnu

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-12-16 17:13:40 +09:00
Kyle Bonnici
d726022f83 CI: Update dts-linter to 0.3.7-hotfix2
dts-linter 0.3.7-hotfix2 Security Updates:
- Update `glob` to address CVE-2025-64756
- Update `js-yaml` to address CVE-2025-64718

Formatting updates:
- Ensure that properties have 2 new lines when node is above it.
- Enures that 1 new line is required between a node and #if/#ifdef...
- Enures that 2 new line are required between #endif and node.
- Wraps property values that exceed 100 characters in length.

Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
2025-12-12 15:38:31 -05:00
Jamie McCrae
a4e2a38370 scripts: zephyr_module: Skip writing output on no change
Skips updating files if the output already matches the file
contents, this prevents a random occurance whereby sysbuild
reconfigures itself after a reconfiguration for no known
discernable reason

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2025-12-12 09:57:48 -05:00
Pieter De Gendt
82845973a6 scripts: footprint: size_report: Close ELF file
Use the ELFFile context manager to open/close an input file.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-11 05:48:23 -05:00
Mathieu Choplain
cb27d92c0c scripts: build: check_init_prio: take deferred-init into account
A device with zephyr,deferred-init is initialized by the application, so
we cannot check if it is initialized in "the correct order". On the other
hand, a non-deferred device must not depend on a deferred-init device: this
is guaranteed to be initialized out of order.

Also adjust existing test cases and add a new test case to validate this
behavior.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-10 17:37:27 +00:00
Mathieu Choplain
ed182a89cd scripts: build: check_init_prio: create dedicated "flag errors" function
There is a bit of logic to run every time an error is reported. Factor it
out into a dedicated function.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-10 17:37:27 +00:00
Daniel Leung
bf44a017a6 coredump: fix ruff warnings on gdbstuc scripts
This fixes ruff warnings on coredump gdbstuc scripts.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-12-09 17:09:41 -05:00
Daniel Leung
9ace08210e coredump: fix ruff warnings on parser scripts
This fixes ruff warnings on coredump parser scripts.

Note SIM115 is not fixed yet as it requires more intrusive
changes to handle opened file with context manager.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-12-09 17:09:41 -05:00
Daniel Leung
79a5783a4b coredump: fix ruff warnings on top level scripts
This fixes ruff warnings on top level coredump scripts.
This is done via "ruff check --fix" without manual editing.

Note SIM115 is not fixed yet as it requires more intrusive
changes to handle opened file with context manager.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-12-09 17:09:41 -05:00
Daniel Leung
37b8402668 coredump: run ruff format on scripts
This is done via "ruff format" without any manual editing.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-12-09 17:09:41 -05:00
Daniel Leung
67e6720b31 coredump: gdbstubs: x86: disable pylint duplicate code warnings
This disables the duplicate code warnings on x86 and x86_64
gdbstubs. The exception vector tables may look the same now but
can deviate depending on supported features on architecture.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-12-09 17:09:41 -05:00
Benjamin Cabé
223e521275 scripts: ci: refresh requirements-actions.txt pinned versions and SHAs
This ensures, we pick a `urllib` version >2.6.0.
See:
- CVE-2025-66418 High severity
- CVE-2025-66471 High severity

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-12-09 09:49:26 -05:00
Mateusz Junkier
fb8a1ec9f3 Twister: fix serial port timeout
Fix for 1d70b70. Original code used start_time (set before flashing)
to calculate serial port wait timeout, which caused wait loop
to include flash duration, leading to exceed overall timeout.
Added serial_wait_start timestamp for avoid
including flash time in serial port enumeration timeout.
Make timeout dynamic (20% of flash_timeout, minimum 10s).

Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>
2025-12-08 13:19:16 -05:00
Hake Huang
b3dff9bbbc tests: twister: using --no-rebuild in west flash
west flash deprecates --skip-rebuild to --no-rebuild

Signed-off-by: Hake Huang <hake.huang@nxp.com>
2025-12-08 13:12:04 -05:00
Jordan Yates
d020049f01 scripts: twisterlib: main: trim run duration
Display the total run duration to two decimal points instead of ~14,
similar to the other displayed timestamps.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-12-08 13:11:44 -05:00
Jordan Yates
d1cd982f8f scripts: twisterlib: display testplan build duration
Display how long it takes to build the testplan in the logs. This can
be useful since the duration to bulid the plan can vary wildly depending
on the arguments given. Without this information, it is difficult to
tell (from CI logs) whether a long execution time is from actually
building and running the tests, or just generating the testplan.

For example, in a downstream repo:
```
./zephyr/scripts/twister --integration -iv -T . --dry-run

INFO    - Building initial testsuite list...
INFO    - Built testsuite list in 10.58 seconds
```
vs
```
./zephyr/scripts/twister --integration -iv -T . --dry-run \
--vendor nordic --vendor zephyr

INFO    - Building initial testsuite list...
INFO    - Built testsuite list in 201.01 seconds
```

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-12-08 13:11:44 -05:00
Pieter De Gendt
91278bdddf devicetree: Add DT_CHILD_BY_UNIT_ADDR_INT
Allow fetching child node identifiers by integer unit address.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-08 13:09:24 -05:00
Anas Nashif
021fd07448 Revert "scripts: checkpatch: fix missing blank line detection"
This reverts commit c310133b3e.

randomly asking for Missing a blank line after declarations.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-12-06 11:41:00 -05:00
Lucien Zhao
98673d0aad scripts: ... :edtlib.py: update edtlib.py to generate some warning messages
During the actual development process, it was discovered that the
controller/device' would describe the bus type in the binding. However,
when the two sides did not match, the generated process would not be
affected and there were no any prompts. This made it very difficult for
developers to identify the problem.

I've updated the implementation to:
1. Add a `warn_bus_mismatch` kwarg to `edtlib.EDT()` constructor
   (default: False)
2. Add a `--warn-bus-mismatch` flag to gen_edt.py
3. Only show the warning when explicitly opted in
4. Add some checks in the edtlib. When the bus type of the node
   does not match the binding requirements, provide some auxiliary
   judgment information:
     a. bus position of the node
     b. available binding types
     c. expected binding type.

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-12-06 11:39:17 -05:00
Jamie McCrae
546adfa555 scripts: snippets: Use temp buffer and only output on change
Stores data to output in a temporary buffer and only outputs data
to a file if the data is different to the file's existing data
(assuming it exists). This prevents a random occurance whereby
sysbuild reconfigures itself after a reconfiguration for no known
discernable reason

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2025-12-06 11:38:26 -05:00
Vignesh Pandian
c310133b3e scripts: checkpatch: fix missing blank line detection
Fix checkpatch not warning when blank line after declaration
is removed. Updated regexes to also handle context lines,
ensuring consistent detection.

Fixes: #98976

Signed-off-by: Vignesh Pandian <vignesh@aerlync.com>
2025-12-04 14:04:45 -05:00
Yves Wang
67e0217399 drivers: edac: Add NXP EDAC driver
Add edac driver for NXP's ERM and EIM peripherals. It can inject ECC
error to specific channel within EIM and then report the error address,
syndrome and count within ERM.

Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
2025-12-04 05:24:28 -05:00
Mathieu Choplain
636df434b9 twister: device-handler: use --dev-id for STM32CubeProgrammer runner
Now that the STM32CubeProgrammer runner supports the standard `--dev-id`
argument, replace usage of `--tool-opt` in the Twister device handler code.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-03 09:12:09 -05:00
Mathieu Choplain
aaaf1d3992 scripts: pytest: hw_adapter: use --dev-id for STM32CubeProgrammer runner
Now that the STM32CubeProgrammer runner supports the standard `--dev-id`
argument, replace usage of `--tool-opt` in the pytest harness hardware
adapter.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-03 09:12:09 -05:00
Mathieu Choplain
f1a75d75c7 runners: stm32cubeprogrammer: add support for --dev-id
Add support for the standard `--dev-id` argument used to select
target ST-Link debug probe based on serial number. Note that this
could already be achieved using custom argument `--conn-modifiers`.
(`--dev-id <XXX>` is equivalent to `--conn-modifiers sn=<XXX>`)

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-03 09:12:09 -05:00
Mathieu Choplain
5f67dfdf41 twister: device-handler: silence no-name-in-module warning
Silence CI warning caused by line "from . import ZEPHYR_BASE". This is a
legitimate pattern, but pylint seems unable to deduce so. Many other
scripts perform a similar silencing.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-03 09:12:09 -05:00
Pieter De Gendt
7e4235ff21 scripts: ci: check_compliance: Skip generated Devicetree Kconfig symbols
Do not generate a compliance error when referring to generated Kconfig
symbols from Devicetree.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-03 11:45:00 +01:00
James Roy
44106ac05f edtlib: binding: Add a examples keyword
Add an `examples` keyword to the binding to
provide a minimal example node for the binding.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-12-02 20:53:01 -05:00
Anton Puppe
043a725b1f edtlib: Fix unformatted error message
Adds a missing f in the second line of a multiline f-string.
Previously, having the wrong top-level keys in a DTS binding YAML file
could cause a partially unformatted error message to be printed.

Signed-off-by: Anton Puppe <anton-noel-flynn.puppe@zeiss.com>
on-behalf-of: @ZEISS anton-noel-flynn.puppe@zeiss.com
2025-12-02 20:52:34 -05:00
Yves Wang
bf9f4c0cee ci: compliance: Correct dts-linter install cmd
Install dts-linter requires prefix for package.json

Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
2025-12-02 15:18:43 -05:00
Yangbo Lu
840d464ffb samples: net: move Ethernet samples to folder
Moved current Ethernet samples to folder ethernet,
as there will be more samples added in the future.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-12-02 11:45:19 +01:00
Haoran Jiang
8454f91e39 scripts: west_commands: runners: sftool: Add flash_files param
In addition to Zephyr's default build artifacts, other build processes
may generate additional images. Therefore, we have added the
`--flash-file` parameter to flash these supplementary images


Signed-off-by: Haoran Jiang <halfsweet@halfsweet.cn>
2025-11-28 17:25:27 +00:00
Kyle Bonnici
589be43e2e devicetree: remaining files
Applying dts-linter results for remaining format files

Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
2025-11-28 10:09:39 +00:00
Thorsten Klein
69536a6811 scripts: zephyr_module: ignore empty paths in extra modules env variables
Ignore empty paths in environment variables ZEPHYR_EXTRA_MODULES or
EXTRA_ZEPHYR_MODULES.

Signed-off-by: Thorsten Klein <thorsten.klein@bshg.com>
2025-11-27 14:48:13 +01:00
Nikodem Kastelik
ad1e5ac253 nordic: update and align to nrfx 4.0.1
New nrfx release contains major rework of nrfx drivers
instantiation making it easier to integrate with dts nodes.
Now, nrfx driver instances can no longer be `const`
because they contain driver runtime state.
Additionally, all nrfx drivers return `errno` error codes
instead of deprecated `nrfx_err_t`.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2025-11-27 14:45:17 +01:00
Jordan Yates
325c354913 scripts: build: ruff compliance
Update scripts in the build folder to pass all enabled `ruff` checks.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-11-27 11:33:18 +01:00
Jordan Yates
b9a3f42d18 scripts: build: apply ruff format
Apply `ruff` formatting rules to all scripts in the build folder.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-11-27 11:33:18 +01:00
Mathieu Choplain
e784a030f2 scripts: runners: stlink_gdbserver: add support for --no-load
Add support for the --load/--no-load argument from the base runner class.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-11-26 12:15:53 -05:00
Mathieu Choplain
2240f10f16 scripts: runners: generalize --no-load argument
Move the existing "--no-load" argument from the OpenOCD and Intel Cyclone V
runners into an argument in the runners base class such that it can be used
by all runners. Also update the existing runners to work with the common
option instead of their own.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-11-26 12:15:53 -05:00
Anas Nashif
5f91f5fb38 doc: fix reference to kernel.h
Fix reference to kernel.h and add zephyr namespace where it was missing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-11-26 12:11:27 -05:00
Jiafei Pan
0ec9360cf4 scripts: requirements: update pyocd version
Update pyocd version to be greater than or equal to 0.36.0 to fix
the potential hang issue when execute "west packages pip --install"

This PR is to fix the issue #99115.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-11-26 07:10:39 +00:00
Beleswar Prasad Padhi
7e6215e140 scripts: west_commands: Log a hint for rate-limit failure during install
`west sdk install` may fail with a GitHub API rate-limit (HTTP 403)
error. This typically occurs when the command is run multiple times
after previous failures, which is common for new users setting up
the project. Currently, the thrown exception only links to a generic
GitHub rate-limit documentation page, which may be confusing to users.

Users can bypass the rate limit by authenticating with GitHub using a
Personal Access Token. The install script supports this via the
`--personal-access-token` argument. Therefore, detect rate-limit related
failures and print a helpful message suggesting the use of this
argument or netrc based authentication.

Signed-off-by: Beleswar Prasad Padhi <b-padhi@ti.com>
2025-11-25 17:37:19 +00:00
Thorsten Klein
bdbdbcbe8d scripts: west_commands: blobs: support blobs cache
An auto-cache directory can be provided via the `west blobs fetch
--auto-cache` argument or the `blobs.auto-cache-dir` config option.
When enabled, the auto-cache is automatically filled whenever a blob is
missing and must be downloaded.

One or more additional cache directories can be specified via argument
`west blobs fetch --cache-dirs` or the `blobs.cache-dir` config option
(multiple paths separated by `;`).

`west blobs fetch` searches all configured cache directories (including
the auto-cache) for a matching blob filename. Cached files may be stored
either under their original filename or with a SHA-256 suffix
(`<filename>.<sha>`).
If found, the blob is copied from the cache to the blob path; otherwise
it is downloaded from its url to the blob path.

Signed-off-by: Thorsten Klein <Thorsten.Klein@bshg.com>
2025-11-25 13:06:06 +01:00
Thorsten Klein
8fab89e521 scripts: west_commands: format blobs.py
blobs.py is formatted with `ruff format`

Signed-off-by: Thorsten Klein <Thorsten.Klein@bshg.com>
2025-11-25 13:06:06 +01:00
Nakul Chauhan
0172845b3d ci/compliance: update requirements of check_compliance.py script
add missing modules to requirements-compliance.txt to run compliance script

Signed-off-by: Nakul Chauhan <nakulchauhan111@gmail.com>
2025-11-25 13:04:34 +01:00
Morten Kristensen
4f2ad9a53d scripts: ci: use vermin 1.8.0
Update workflow to use the new version of Vermin to enrich the Python
minimum version checks in the CI pipelines.

Signed-off-by: Morten Kristensen <me@mortens.dev>
2025-11-24 14:56:36 -05:00
Eemil Visakorpi
1d70b705b0 twister: Fix serial open for UART devices that do not immediately appear
Testing on linux, --flash-before argument did not work to wait for jlink
upload to complete. Instead Serial port opening throws file not found. The
fix ensures that the code waits for the serial port to appear before
attempting to connect. Tested on a proprietary platform with virtual UART
through usb.

Signed-off-by: Eemil Visakorpi <eemil@doublepoint.com>
2025-11-24 17:22:22 +01:00
Anas Nashif
c9b01e8257 ci: set_assignee: remove size: XS label on updates
The script currently only adds the 'size: XS' label for small PRs (1
commit with ≤1 addition and ≤1 deletion), but it doesn't remove this
label if the PR grows larger after subsequent updates.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-11-24 08:47:51 +01:00
Arkadiusz Cholewinski
1d6e0d533a Power harness: Update path for the raw data file.
Change direction for raw data file from $ZEPHYR_BASE
to <path_to>twister-out/../<test>/

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-11-22 11:45:44 +01:00