that can never succeed because it is not in the com port filter list.
This would trigger every time that a combination of --flash-before and
--serial-pty is used.
The list of monitored serial ports - at least on linux - does not contain
/dev/pts but that list is constantly checked if the /dev/pts/X device might
magically appear some day.
This is the proper fix instead of adding /dev/pts/* to the monitor list
because the reason why we need to wait is because in the codepath without
serial_pty, we might be resetting the target device, causing the dev node
to disappear/reappear. This is not the case for the virtual ports created
for serial_pty.
Signed-off-by: Lucas Romero <lucas.romero@a-labs.io>
The result property getter rebuilds the list from XML children every
access, and the setter removes all existing results then re-appends them
all. So self.case.result += [res] is O(n²) over time.
self.case.append(res) directly appends to the underlying XML element in
O(1), bypassing the expensive property entirely.
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Moved all `sys.path.insert` from twister's modules
to `twisterlib.__init__.py` to have only one place where all paths
are added.
Signed-off-by: Łukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Add a compliance test for device driver APIs to make sure API
<class>_driver_api struct variables are put in the corresponding linker
section using the DEVICE_API macro.
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Make sure that we don't allow bindings which manually
specify any defaults for the status
properties. See DTSpec 2.3.4.
Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
The status property indicates the operational status of a device.
The lack of a status property should be treated as
if the property existed with the value of "okay".
We are currently allowing defaults.
This is a continuation of
https://github.com/zephyrproject-rtos/zephyr/pull/104931
Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
Added unit tests for `twister_main.py` module to increase code coverage.
Did minor refactoring in `twister_main.py`.
Fixed type hints and added type ignores.
Removed unused variables.
Signed-off-by: Łukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Run the uv command to update the pinned version in
scripts/requirements-actions.txt and doc/requirements.txt.
This picks up requests>=2.33.0, mitigating CVE-2026-25645.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
'west sdk install' assumes the host-specific minimal SDK archive
always has a matching entry in sha256.sum and aborts with a Python
KeyError when it does not.
Detect the missing checksum entry and report a normal
west fatal error instead.
Without this patch:
west sdk install --install-base ../
KeyError: 'zephyr-sdk-1.0.0_macos-x86_64_minimal.tar.xz'
With this patch:
west sdk install --install-base ../
FATAL ERROR: No Zephyr SDK 1.0.0 bundle found for host
macos-x86_64.
Signed-off-by: Mirai SHINJO <oss@mshinjo.com>
Add quotes around binding file paths in error messages for better
readability and consistency. Also normalize paths using os.path.normpath
to ensure consistent path separators across platforms.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
When TOOLCHAIN_VARIANT_COMPILER is empty, we should not append
a trailing slash (/) to ZEPHYR_TOOLCHAIN_VARIANT. Or else any
matching of ZEPHYR_TOOLCHAIN_VARIANT would be incorrect.
For example, ZEPHYR_TOOLCHAIN_VARIANT == 'xt-clang' and west
build would have it correct, while twister would have it as
'xt-clang/'. This prevents kconfig from matching correctly
(possibly among other things).
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This change adds a script to generate an HTML dashboard, invoked via
west, providing a consolidated and user-friendly view of various build
artifacts and metrics. This includes footprint information (as both
tables and plots), configuration tracing, sys init levels, an interactive
devicetree browser, and more.
Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
Signed-off-by: Martí Bolívar <mbolivar@oss.qualcomm.com>
To allow other scripts to use the initlevel information determined
by the Validator class, expose an API to get them.
Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
In order to allow the plot.py functionality to be used by other
scripts, move the code into a separate function that can be
imported.
Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
Introduce DT_FOREACH_REG and DT_INST_FOREACH_REG macros to enable
iteration over reg entries in devicetree nodes by invoking a user-
supplied macro per entry. Add support for macros accepting a
separator and variadic arguments with the new DT_FOREACH_REG_SEP,
DT_FOREACH_REG_VARGS, and DT_FOREACH_REG_SEP_VARGS macros, as well
as their DT_INST_ variants.
The DT_FOREACH_REG macro mirrors the behavior of the ranges property.
Update the devicetree macro generation logic in gen_defines.py to
emit the new macro variants. Document the additions by expanding the
Augmented Backus-Naur Form grammar in macros.bnf. Add detailed
comments with usage examples and parameter details for all new macros.
Expand test coverage with new overlay nodes and dedicated tests to
verify macro correctness and behavior, across various node scenarios
including multi-register, single-register, and nodes lacking reg
properties.
Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
The runner always selected elf_file, ignoring hex_file and bin_file from
RunnerConfig. This broke MCUBoot support since the bootloader
requires hex/bin format and the build system sets hex_file to
signed images (zephyr.signed.hex).
Fixes commit 3c7d973 ("west: runners: probe-rs: Add enhanced
functionality")
Signed-off-by: Michał Bogdziewicz <michal@bogdziewicz.xyz>
Add Fish shell completion entries that are already present in the
Bash completion script but were missing from the Fish one:
- Add __zephyr_west_complete_shield for cached shield completion
- Add --shield argument completion to west build
- Add completion entries for the west shields subcommand
- Add completion entries for the west twister subcommand
Fixes#73128
Signed-off-by: Nancy Sangani <9d.24.nancy.sangani@gmail.com>
The OpenRISC CPU architecture is signified by the CONFIG_OPENRISC Kconfig
option. This patch adds this information to the log database ARCHS table.
Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
When the `west rtt --runner=jlink` command is executed, the client is
attached to the channel number 0 by default.. However, if several
subsystems are configured to use different RTT channels, e.g. shell to
the channel 0 and logging to the channel 1, it's currently impossible
to attach to any channel other than 0.
The `west rtt` command for the `jlink` runner is extended by a new
argument called `--rtt-channel=<channel>` where `<channel>` is an
integer, e.g. 0, 1, etc. Usage example:
west rtt --runner=jlink --rtt-channel=1
When the channel is specified, once the client is connected, it sends the
following configuration sequence:
$$SEGGER_TELNET_ConfigStr=RTTCh;<channel>$$
This configuration sequence instructs the server to send data associated
only to the given channel. This string must be send within 100 ms after
establishing a connection, otherwise it would be ignored.
The following is an example of a configuration where shell uses channel 0
and logging - channel 1:
CONFIG_SHELL=y
CONFIG_SHELL_BACKEND_RTT=y
CONFIG_SHELL_BACKEND_RTT_BUFFER=0
CONFIG_SHELL_BACKEND_SERIAL=n
CONFIG_SHELL_LOG_BACKEND=n
CONFIG_LOG=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_RTT_BUFFER=1
CONFIG_LOG_BACKEND_UART=n
Signed-off-by: Ilia Kharin <akscram@gmail.com>
Add a custom Kconfig preprocessor option to obtain the highest IRQn on a
controller. This can be useful to compute CONFIG_NUM_IRQS automatically at
build time.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Allow fallback URLs to select a different back-end.
The "url:" field can now take a list of URLs so that if an
URL fails, the next one can be fetched (i.e. a remote host is down).
Error handling is refactored to let blobs.py call os.exit(), with a
new ZephyrBlobException used for the purpose of catching blob-fetching
related errors, and still allow i.e. KeyboardInterrupt to be raised.
Signed-off-by: Josuah Demangeon <me@josuah.net>
The spec makes it clear that node address can be omitted from node path
if not unambiguous see 2.2.3. Path Names
> A unit address may be omitted if the full path to the node is
unambiguous.
e.g.
````
/ {
foo@10 {};
}
```
both paths -> /foo and /foo@10 should work.
Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
IMO the spec is clear about the case insensitivity. The node address
must be match the reg value see 2.2.1.1. Node Name Requirements
> The unit-address must match the first address specified in the reg
property of the node.
reg property is a prop-encoded array and by definition.
reg = <0xA> or reg = <0xa> are the same. hence Both foo@a and foo@A
are the same.
Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
Wrap the picotool sign command (requires recent picotool) to build
signed ELF files (which can be later converted to UF2 as well).
The resulting files boot, yet this has not been tested with actual
Secure Boot yet.
Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
- monitor_serial() opens handler.log in binary mode (\"wb\") and writes
re-encoded bytes. When the runner (e.g. linkserver for frdm-mcxn947)
produces serial output that is not cleanly decodable as UTF-8, the
decode('utf-8', 'ignore') silently drops bytes and the resulting
handler.log is unreadable.
- Fix by opening handler.log in text mode with explicit UTF-8 encoding,
consistent with BinaryHandler.handle_serial() which uses open(\"w\").
Change the decode error handler from 'ignore' to 'replace' so
corruption becomes visible as replacement characters rather than
silently dropped bytes.
Signed-off-by: Jjateen Gundesha <jjateen97@gmail.com>
Add Zephyr itself, with its CPE and PURL, to the modules-deps.spdx file, to
have one accurate SBoM for vulnerability scanning. Also add DEPENDENCY_OF
relationships to be able to build up a dependency-graph with the
modules-deps.spdx SBoM
Signed-off-by: Nils Schlegelmilch <n.schlegelmilch@vega.com>
Co-authored-by: Benjamin Cabé <benjamin@zephyrproject.org>
According to the DT spec the 'phy-handle' phandle prop
is required, when a phy is used. As this phy could be
a child, we have to filter it out to not get a cycle in the graph.
This allows the phy to be a child of the eternet controller,
when using the 'phy-handle' dt prop.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The espressif toolchain variant (ZEPHYR_TOOLCHAIN_VARIANT=espressif)
has not been used for years. Espressif targets are now built using the
Zephyr SDK, which bundles the required Xtensa and RISC-V toolchains.
Remove the cmake/toolchain/espressif/ directory containing generic.cmake,
target.cmake, and Kconfig files that implemented this variant. Also
clean up references in the coredump xtensa gdb stubs, removing the
ESPRESSIF toolchain enum value and related handling code.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Update unit tests after moving hardware reservation logic from
Handler class to HardwareMap. Relocate and rename tests to match
the new module structure and API changes.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Hardware reservation logic moved from Handler class to ProjectBuilder
runner using context manager approach. When NoDeviceAvailableException
is raised due to no free devices, the task is re-queued for later
processing instead of blocking the execution pipeline.
The reserve_hardware() context manager handles device reservation,
yields execution control only when hardware is available, and ensures
proper cleanup in the finally block.
All DUT management logic is now consolidated in HardwareMap class,
removing DUT references from Handler classes. This improves code
maintainability by centralizing responsibilities and eliminating
shared ownership of hardware resources between modules.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Extend the special casing of specifer space to include io-channels,
making the implementation a bit more easily scalable for the
future as well. This allows defining io-channels like gpios,
prepending a name like foo-io-channels, which is useful when
multiple groups of io-channels need to be defined for a node:
foo {
bar-io-channels = <&baz 0>, <&baz 1>;
qiz-io-channels = <&baz 2>, <&baz 3>;
};
This is useful for defining channels to be read in parralel
sequences.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Increase the reset pulse from 10ms to 100ms to ensure reliable
boot across all Espressif SoCs. Shorter pulses may cause the UART
to miss early bootloader output, leading to false-positive test
failures.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Adds support for outputting partition information on this new
compatible, to match fixed-partitions
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit updates the Twister Black Box tests to expect the enhanced
toolchain variant names (i.e. `host/gnu` and `zephyr/gnu`).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Zephyr SDK 1.0.0 has dropped newlib support and made picolibc the default
libc.
This commit updates the errno check script to check minimal libc error
numbers against the picolibc error numbers.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
support new syntax involving compiler and toolchains with multiple
compilers, i.e. zephyr/gnu
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit renames the `--toolchains` and `--no-toolchains` arguments,
which control the SDK GNU toolchain installation, to `--gnu-toolchains` and
`--no-gnu-toolchains` to avoid any confusion with the SDK LLVM toolchain.
The old `--toolchains` and `--no-toolchains` arguments remain supported
with a deprecation warning message.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This reverts commit 1993ea019b because the
`parse_syscalls.py` script has been modified to not output whitespace
characters other than spaces in the generated JSON file.
Signed-off-by: Loek Le Blansch <loek.le-blansch.pv@renesas.com>