Changed the file filter in the compliance check script from "d" to "dr" to
not fail when a commit _moves_ an already large image to a new location.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Before this commit, invalid user handles (and other issues) are
misleadingly reported as lacking access. Example:
https://github.com/zephyrproject-rtos/zephyr/actions/runs/24588250420/job/71903123213?pr=107507
```
=== GitHub Access Check ===
Collaborators without at least triage access:
- sylvioales
Some added maintainers or collaborators do not have sufficient access.
```
This feedback is wrong because the real issue is: `sylvioales` had a
typo, that user does not exist.
This commit addresses the `W0718: Catching too general exception Exception
(broad-exception-caught)` pylint warning that accurately warns about hiding
errors. After it:
```
=== GitHub Access Check ===
sylvioaves is not a user: 404 {"message": "sylvioaves is not a user",
"documentation_url": "https://docs.github.com/rest/collaborators/collaborators",
"status": "404"}
Collaborators without at least triage access:
- sylvioaves
```
Note the misleading "missing access" message is still there but:
1. the actual, relevant error message is not discarded anymore
2. getting rid of the last part would be much bigger code change.
This commit deals with other Github issues like for instance
passing an invalid token:
```diff
=== GitHub Access Check ===
+401 {"message": "Bad credentials",
+ "documentation_url": "https://docs.github.com/rest", "status": "401"}
Collaborators without at least triage access:
- sylvioaves
```
Signed-off-by: Marc Herbert <marc.herbert@gmail.com>
Signed-off-by: Marc Herbert <Marc.Herbert@gmail.com>
Add a Python script that can be used to optimize the Kconfig
values for different use cases and scenarios.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Assisted-by: Claude:claude-sonnet-4.6
Add option to execute command and then read the resposne for a
specified time. It can be useful if we want to validate additional
data that is output as the result of a command execution.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Allow to use a switch-case instead of an array holding ISR entries.
When most of IRQs are not used, they share the same, default entry.
It results in most of the ISR array entries being identical duplicates.
This change allows to use dynamically generated function (after first
linker pass) that uses switch-case instead of a full array.
Default entries are handled only once, in a default section.
Used IRQs have their own case sections.
This can help reduce binary size.
Signed-off-by: Adam Szczygieł <adam.szczygiel@nordicsemi.no>
This will allow to reuse fcntl middle layer in other parts besides NSOS,
such as planned Native Simulator host FS mounting.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Use Application core as default unless specified differently.
This will make adding new product easier.
Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
Twister would incorrectly fail, if you didn't have
the serial library installed. Instead moving it
to the try except clause causes it to be handled
correctly
Signed-off-by: Kasper Sloth <kasper.sloth99@gmail.com>
On Windows, symbols from external modules have absolute paths outside
ZEPHYR_BASE. Without --workspace, size_report places them under
node_others whose _size is never computed, leaving it at 0 while its
children carry non-zero sizes.
Add --workspace to size_report in dashboard.py.
Also compute node_others._size before adding it to the tree.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
The previous webbrowser.open(file_path) approach fails under WSL
because Windows cannot open files via UNC paths. Use a local HTTP
server instead, which works reliably across more platforms.
Also add USES_TERMINAL to the CMake dashboard target so that log
output is visible.
Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
Add support for flash/debug/debugserver using existing build targets.
Long the goal is to move from build targets to dedicated implementation
in the runner.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The ARM64 coredump arch block did not include FP (x29) and SP,
making GDB unable to unwind the stack. The GDB stub also
misinterpreted SPSR as SP (tu[20] mapped to SP_EL0), producing
corrupted stack pointer values and broken backtraces.
Bump the arch block version to v2 (24 registers, 192 bytes)
adding FP and SP after the existing 22 registers. Update the
GDB stub to auto-detect v1 vs v2 blocks by payload size and
correctly map SPSR (skip), ELR (PC), FP (x29), and SP.
When CONFIG_ARM64_SAFE_EXCEPTION_STACK is enabled and the
exception originated from EL0, use the saved esf->sp (original
sp_el0 stored by the exception entry code) instead of computing
it from the ESF address, since the exception handler may be
running on a separate safe stack.
Fixes#99054
Signed-off-by: Anirudha Sarangi <anirudha.sarangi@amd.com>
Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
The xtensa runner launches xt-gdb via check_call() without ignoring
SIGINT in the parent Python process. When the user presses Ctrl+C,
the signal kills the West process before GDB can clean up.
Fix by using check_call_ignore_sigint() from the base class.
Signed-off-by: Andres Hernandez <andres.a.h@outlook.com>
The native runner's do_debug() and do_debugserver() methods launch GDB
via check_call() without ignoring SIGINT in the parent Python process.
When the user presses Ctrl+C, the signal kills the west process, which
tears down GDB before it can clean up. When GDB is in TUI mode via
`layout src`, this leaves the terminal in a bad state with mouse
tracking escape sequences active.
Fix by using check_call_ignore_sigint() from the base class.
Signed-off-by: Andres Hernandez <andres.a.h@outlook.com>
The local check_call_ignore_sigint() method is an exact duplicate
of the same-named method in ZephyrBinaryRunner. Remove the
local definition and rely on the base implementation.
Signed-off-by: Andres Hernandez <andres.a.h@outlook.com>
Renaming run_client() to check_call_ignore_sigint() makes its purpose
clearer and consistent with the pattern already established in the
blackmagicprobe runner.
Then, update all callers with the new name.
run_client() is kept as a deprecated function, wrapping
check_call_ignore_sigint() for backwards compatibility.
Signed-off-by: Andres Hernandez <andres.a.h@outlook.com>
Add support for providing multiple .conf and .overlay files for a given
snippet. This uses the standard syntax of a space or semi-colon
separated list in the snippets.yml file for EXTRA_CONF_FILE,
EXTRA_DTC_OVERLAY_FILE, and SB_EXTRA_CONF_FILE. In other areas of the
build system these variables already take such a list, so this provides
a more consistent syntax in the snippets case.
Signed-off-by: Graham Roff <grahamr@qti.qualcomm.com>
shutil.copy() calls copyfile() then copymode(). On Windows the UF2
bootloader resets the MCU (unmounting the drive) after receiving the
file, before copymode() runs, raising OSError: [WinError 433]. FAT
filesystems also do not support Unix permission bits. Replace copy()
with copyfile() to transfer data only and avoid the failing chmod.
Fixes zephyrproject-rtos#107165
Signed-off-by: Taha Momayiz <momayita@mail.uc.edu>
When information about the node's matching binding is available, add
it to the dashboard. Knowing which binding matched a node is a common
source of confusion, so this hopefully is helpful additional context.
Adding this information has officially made the dt-prop-info field a
bit too complex to render inline. To avoid confusing people with the
extra info, re-work the CSS to display this new information in a grid
of key/value pairs associated with each node or property.
Signed-off-by: Martí Bolívar <mbolivar@oss.qualcomm.com>
Add the ability to specify different pre init commands for flashing, in the
case flashing needs to use a different transport/target than other
operations like debug for heterogeneous targets.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
Before a capture is started "enable" is sent to the device in case
`CONFIG_TRACING_HANDLE_HOST_CMD` is enabled to start the transmission of
tracing data from the device. However it is never stopped.
Send "disable" when the capture is stopped to stop the transmission from
the device.
Also `ser.close()` was unreachable which is also fixed.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Parametrized tests in gtest are shown as the following example in a log:
[ FAILED ] FooTest/FooTypedTest/0.TypedTestFoo, where TypeParam = <type>
current regex of the gtest harness didn't detect such test so it marks
this as pass or that the result wasn't found. This commit extends the
regex to detect such behavior and adds unit test to verify that.
Signed-off-by: Martin Moya <moyamartin1@gmail.com>
Posix is not a library per the definition of libraries in Zephyr. It
always has been a portability layer and shall reside with other
portability layers under subsys/portability.
Addresses #99250
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Disable the DeviceMmioCheck compliance check while documentation and
community discussion are ongoing. The check code is kept in place and
can be re-enabled by removing the self.skip() call.
See https://github.com/zephyrproject-rtos/zephyr/issues/106966
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
The check was scanning the entire file content, causing CI failures
for PRs that touch any line in an existing non-compliant driver, even
if the change is completely unrelated to the violation.
Fix this by parsing git diff -U0 hunk headers to determine which
lines were actually added in the changeset, and only flag
RAW_REG_ADDR_RE matches on those lines. The MMIO_API_RE suppression
still scans the whole file so that files already using the MMIO API
are correctly excluded.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
The RAW_REG_ADDR_RE pattern used \w+ for the cast type, which only
matches single-word types like (uint32_t *). This misses the most
common pattern in Zephyr drivers:
.base = (struct foo_regs *)DT_INST_REG_ADDR(n),
Replace \w+ with [^)]* to match any cast expression including struct,
volatile, and multi-word types.
Also extend the pattern to catch DT_[INST_]REG_ADDR_BY_NAME() casts,
which are equally broken on MMU platforms, and scan .h files in
addition to .c files since some drivers define their config structs
in companion headers.
Before: 554 flagged lines across drivers/
After: 694 flagged lines across drivers/ (+140 newly caught)
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Append the documentation link to Github annotation. This make it easier for
users to go directly to the relevant page from a pull request.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
do_create() is a classmethod and cannot access self.logger.
Use a module-level _logger instead, consistent with core.py
and __init__.py in the runners package.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
Besides a custom range to run the compliance checks, allow to run on all
commits to HEAD.
This is useful when testing locally, to verify existing files in tree.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add a DeviceMmioCheck to check_compliance.py that flags driver files
casting DT_REG_ADDR() or DT_INST_REG_ADDR() to a pointer without
using the device MMIO API.
.base = (SomeType *)DT_INST_REG_ADDR(n),
This stores the raw physical address and dereferences it directly. On
systems with an MMU, the physical address has no page table entry and
the access will fault unless someone else has created an identity
mapping (typically via mmu_regions.c).
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
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>