Clean up Twister OpenOCD runner by removing
deprecated cmsis_dap_serial argument and
replacing with adapter serial
Signed-off-by: Shankar Ramasamy <shankar.ramasamy@microchip.com>
Processing the raw coverage data into the output `html` can take a
significant amount of time. Add a display for the duration, similar to
the timers for building the testsuite list and test build/execute times.
Example output:
```
INFO - Built testsuite list in 0.04 seconds
...
INFO - 16 of 16 executed test configurations passed (100.00%), 0 \
built (not run), 0 failed, 0 errored, with no warnings in \
25.85 seconds.
...
INFO - Coverage data processed in 11.45 seconds
```
Signed-off-by: Jordan Yates <jordan@embeint.com>
Fixing missing support for --soc, --soc-family and --soc-series
arguments, which previously would just return all SoCs irrespective
of what was wanted
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Use suite id instead of name as the key in the testsuites
registry. With --detailed-test-id enabled, the suite name
includes the path, which caused a false duplicate error when a
required application was passed via -T on the command line and
was also listed in the required_application section of another
test.
Duplicated scenarios are reported as an error regardless of
whether --detailed-test-id is used.
Update the twister unit tests.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Enrich the Build profile with per-target compile flags and defines and
the key build inputs (board, arch, toolchain), mirroring the
Build-profile output of projects such as the Linux kernel.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Emit the SPDX 3.0.1 Build profile, recording how the image and each
target was built. The profile is omitted when no build information is
available.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Gather the parsed toolchain, CMake file-API and per-target metadata
into the SBOM graph so serializers have the build details they need.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Parse the CMake file-API toolchains-v1 reply and cmake index object so
the SPDX 3.0 Build profile can describe the build toolchain.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Replace the hand-written __init__ boilerplate in the CMake file-API
data classes with @dataclass field declarations, matching the style
already used elsewhere in zspdx (e.g. model.py). This makes the
module easier to extend with new data classes going forward.
No behavioral change: field defaults, __repr__ output, and the
zero-argument construction pattern used by cmakefileapijson.py are
all preserved.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
checkpatch reported a false-positive LINE_SPACING "Missing a blank line
after declarations" for local variables declared with __aligned(), e.g.:
uint32_t eicr, embr, eicr_val;
uint32_t __aligned(4) data32 = 0;
The LINE_SPACING heuristic decides whether a line is a declaration with
a regex that lets the type absorb trailing modifiers/attributes. But
__aligned was missing from the $Attribute list, so the type matched only
"uint32_t", $Ident then matched "__aligned", and the following "(" did
not match the expected [=,;:[] terminator. The line was therefore not
seen as a declaration and a blank line was demanded after the preceding
one.
Add __aligned to $Attribute, consuming its parenthesized argument
(including one level of nesting such as __aligned(sizeof(x))). This is
the root cause: __aligned(N) is now understood as a type attribute
everywhere, not only in the LINE_SPACING check.
Fixes#110417
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add a new optional boolean field defer-to-other-areas to file-groups in
MAINTAINERS.yml. When set to true it signals that the files in that
group are not the sole responsibility of the enclosing area: if another
area also covers the same files without the flag, that other area's
maintainer takes precedence as the PR assignee and the deferred area's
maintainers are added as reviewers instead. When no non-deferred area
covers the files, the deferral has no effect and the area is used for
assignment as normal.
Typical use-case: the Clock Control subsystem owns generic driver
infrastructure under drivers/clock_control/, but a platform area also
covers the platform-specific files there. The subsystem maintainer
adds those files to a deferred file-group so the platform maintainer
becomes the assignee while the subsystem maintainer is still notified
as a reviewer.
Assisted-by: GitHub Copilot:claude-sonnet-4.6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Ownership was decided while mutating the set it was tested against, so a
relationship's endpoints pulled in further relationships and the build
graph cascaded into every document. Decide ownership from a snapshot of
the document's own elements instead.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.8
Every relationship is also stored on its "from" element, so iterating the
graph-wide list in addition to components and files emitted each one
twice. Drop the redundant pass.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.8
Deduplicating against the output list with "not in" ran the model's deep
__eq__ for every comparison and dominated serialization time. Track the
gathered element IDs in a set and skip by ID instead.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-4.8
Move all LE Audio samples to their own subdirectory.
This makes it easier to find samples specific for LE Audio,
where there will be more coming.
This makes the samples directory follow the subsystem
and tests directory patterns as well.
This adds a place where LE Audio samples can place common
code, e.g. handling of LC3 and USB audio, without cluttering
the generic Bluetooth samples directory.
This makes it simpler to apply search patterns, such as the ones
in the MAINTAINERS file.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add a new IPC service backend based on the RPMsg-Lite library.
The backend implements the ipc_service_backend ops (open, close,
register/deregister endpoint, send, send_nocopy, get/drop TX buffer,
hold/release RX buffer) on top of the RPMsg-Lite virtio transport.
A new DT binding (nxp,ipc-rpmsg-lite) is introduced to describe
each RPMsg-Lite link instance: shared memory region, role (host/remote),
link-id, MBOX channels, and per-instance buffer/priority tunables.
Multiple links share a single MBOX channel pair via the
notification-parent property; platform_notify() dispatches the
encoded vector_id to the correct link.
Signed-off-by: Tomas Galbicka <tomas.galbicka@nxp.com>
On Windows, if the working directory and source directory are on different
drive letters, `os.path.relpath` will throw `ValueError: path is on mount
'D:', start on mount 'C:'`
This adds a fallback to use `self.source_dir` in that case, as `srcrel` is
only used in the printout of the checks below, so does not need to be
relative to the working directory
Signed-off-by: William Vinnicombe <william.vinnicombe@raspberrypi.com>
As there are multiple custom nrf* runners which needs dev-id,
handle them in general way for future.
Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
Add devicetree reader macros for counter capture. These include
an index for the channel number and default flags. These are
intended to eventually to be used within drivers for timestamp
capturing.
Signed-off-by: Ryan McClelland <rymcclel@gmail.com>
Add scripts/tracing/trace_viewer.py, a dependency-free (Python 3 stdlib
only) viewer that renders a Zephyr CTF trace graphically on the console,
in the spirit of Trace Compass.
The viewer decodes the packed little-endian CTF records itself rather
than relying on babeltrace2. The per-event field layout is read from the
TSDL subsys/tracing/ctf/tsdl/metadata file (located by climbing the tree
from the script or via ZEPHYR_BASE), so the decoder tracks any events
added there; a small built-in table covers the core scheduling events so
the time graph still works when the metadata file is not found.
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
A comment directly above a top-level 'if' documents the conditional
block, so anchor the required blank line before the comment rather than
between the comment and the 'if'.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude Code:claude-opus-4.8
Add support for the --load/--no-load argument in the pyOCD runner to
enable debugging using pyOCD without programming the target beforehand.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The openocd runner can already select a specific debug adapter by serial
number, but it did not advertise the dev_id capability. As a result the
common `west flash -i <serial>` form supported by every other runner failed
with "openocd doesn't support --dev-id option", which is confusing when
several identical adapters (e.g. CMSIS-DAP) are connected at once.
Declare dev_id=True and route the existing --serial option to the same
'dev_id' destination, following the pattern other runners used for this
migration. Both flags therefore land in args.dev_id (argparse handles
precedence), and the value is passed to the OpenOCD config as
_ZEPHYR_BOARD_SERIAL as before. --serial is kept as a deprecated alias and
documented in the migration guide; tests/test_openocd.py covers both forms.
Signed-off-by: Zhixuan Jin <me@zhixuan.dev>
Generates a new file for use by the build system which lists all
the paths to dts bindings used in a build, then from CMake adds a
dependency to these files so that if they are modified, CMake will
re-run.
This has been implemented by adding support to edtlib to output
details on bindings and binding paths inside of the python code
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Before this change, whenever a Gtest failed the runner failed reporting
that `instance.reason` was a `NoneType` and couldn't be concatenated
to string.
This PR fix that by adding a reason to the Gtest instance whenever
it failed. Additionally, it covers the edge case where Gtest
started but it has never finished executing the test
Signed-off-by: Martin Moya <moyamartin1@gmail.com>
When loading a saved test plan with --load-tests/-F, get_platform()
returns None for any platform name in the file that is not part of the
current build. TestInstance() then dereferences platform.name and fails
with an opaque "AttributeError: 'NoneType' object has no attribute
'name'", which gives no hint about which entry is at fault.
Raise a TwisterRuntimeError that names the file, the unknown platform
and the test instead, so a stale or mismatched test plan is easy to
diagnose.
Assisted-by: AI (GitHub Copilot)
Signed-off-by: Bill Waters <bill.waters@infineon.com>
- fix mplab_ipe runner to use the board by serial number
- fix twister handler to pass dev_id to mplab_ipe runner
- fix map file generation to include MPLAB boards
Signed-off-by: Shankar Ramasamy <shankar.ramasamy@microchip.com>
Add coredump_udp_receiver.py to reassemble ZCDU-framed UDP datagrams
sent by CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING_UDP into a raw .bin file
compatible with coredump_gdbserver.py. Supports IPv4 (--listen 0.0.0.0)
and IPv6 (--listen ::) with an idle-timeout to detect end-of-session
when the END datagram is lost.
Fix coredump_gdbserver.py: call gdbserver.close() only when not using
--pipe mode to avoid a double-close teardown error. Also clarify the
second positional argument as coredump_bin and document both the
serial-log-parser and UDP receiver workflows in the help text.
Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
Pin the pygithub depdendency, keep the code scanning check happy. This
has to be done using a requirement file so that the automation can
update it with the other one so create a new requirements-actions-basic
just for this, it may come in handy for other workflows that don't need
the whole toolchain but just github api access.
Link: https://github.com/zephyrproject-rtos/zephyr/security/code-scanning/1102
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add a KconfigFormat check that runs scripts/kconfig/kconfig_style.py on
changed Kconfig files and reports the style issues on the touched lines.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude Code:claude-opus-4.8
Add scripts/kconfig/kconfig_style.py, a dependency-free checker for the
Kconfig formatting rules from the style guidelines (line length,
indentation, blank lines, comment spacing and final newline).
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Assisted-by: Claude Code:claude-opus-4.8
Rename functions, class attributes, and local variables from camelCase
to snake_case across the zspdx library and west spdx command. This is
a mechanical rename with no functional changes.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Explicitly open SPDX text output files with UTF-8 encoding to avoid
invalid UTF-8 content from platform-default encoding.
Signed-off-by: David Nepožitek <david@nepozitek.cz>
West itself adds ERROR/WARNING prefix, and does not print a (module) name.
Remove the logger class, the default already simply forwards the message.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
CONFIG_LINKER_USE_PINNED_SECTION is the second half of the selective
kernel-pinning model removed in issue #108773. With the kernel image
now always resident at boot (previous commit), the __pinned_*
attribute family is a no-op: every page they would have segregated is
already pinned by z_mem_manage_init()'s whole-image loop, so the
tagging contract neither adds safety nor remains maintainable.
Drop it.
Mechanical removals:
* All ~219 in-tree uses of __pinned_text, __pinned_rodata,
__pinned_data, __pinned_bss, __pinned_noinit, and __pinned_func
across arch/x86, drivers/interrupt_controller, drivers/timer,
arch/common, kernel, lib/libc, subsys/portability/posix, tests, and
the syscall code generator (scripts/build/gen_syscalls.py).
* The assembly aliases PINNED_TEXT/RODATA/DATA/BSS/NOINIT used in
arch/x86/core/ia32/*.S and drivers/interrupt_controller/
intc_loapic_spurious.S become plain TEXT/RODATA/DATA/BSS/NOINIT.
* K_KERNEL_PINNED_STACK_DEFINE, K_KERNEL_PINNED_STACK_ARRAY_DEFINE,
K_KERNEL_PINNED_STACK_ARRAY_DECLARE, K_THREAD_PINNED_STACK_DEFINE,
and K_THREAD_PINNED_STACK_ARRAY_DEFINE are removed. The few
in-tree callers (kernel/init.c, arch/arm/core/cortex_a_r/smp.c,
arch/arm64/core/fatal.c, arch/rx/core/prep_c.c,
arch/x86/core/prep_c.c, kernel/include/kernel_internal.h,
tests/bluetooth/hci_uart_async) move to the corresponding
non-pinned macros.
Machinery removals:
* Kconfig.zephyr drops CONFIG_LINKER_USE_PINNED_SECTION.
qemu_x86_tiny and qemu_x86_atom_virt drop their =y overrides.
* include/zephyr/linker/section_tags.h drops the __pinned_* macro
definitions (both arms). __isr collapses to an empty macro since
its only purpose was to alias __pinned_func.
* include/zephyr/linker/sections.h drops PINNED_TEXT_SECTION_NAME,
PINNED_BSS_SECTION_NAME, etc. and the bare PINNED_TEXT/RODATA/etc.
forwarders, plus the _APP_SMEM_PINNED_SECTION_NAME constant.
* include/zephyr/linker/linker-defs.h drops the lnkr_pinned_*
externs, the _app_smem_pinned_* externs, and the lnkr_is_pinned()
/ lnkr_is_region_pinned() inline helpers.
* include/zephyr/linker/utils.h drops the lnkr_pinned_rodata branch
in linker_is_in_rodata().
* include/zephyr/linker/app_smem_pinned{,_aligned,_unaligned}.ld
are deleted; cmake/linker/ld/target_configure.cmake stops
configuring them.
* boards/qemu/x86/qemu_x86_tiny.ld and
include/zephyr/arch/x86/ia32/linker.ld drop their pinned-section
blocks and the now-redundant #ifndef CONFIG_LINKER_USE_PINNED_SECTION
conditionals throughout the body. The
LIB_KERNEL_IN_SECT / LIB_ARCH_X86_IN_SECT / LIB_ZEPHYR_IN_SECT /
LIB_C_IN_SECT / LIB_DRIVERS_IN_SECT / LIB_SUBSYS_LOGGING_IN_SECT /
LIB_ZEPHYR_OBJECT_FILE_IN_SECT / ZEPHYR_KERNEL_FUNCS_IN_SECT macros
in qemu_x86_tiny.ld are deleted; they existed only to feed the
pinned text/rodata/data/bss/noinit sections.
* kernel/mmu.c drops the mark_linker_section_pinned(lnkr_pinned_start,
...) call. The mark_linker_section_pinned() helper survives but is
now gated only on CONFIG_LINKER_USE_BOOT_SECTION.
* arch/common/init.c and include/zephyr/arch/common/init.h drop
arch_bss_zero_pinned(); arch/x86/core/ia32/crt0.S drops the call
to it.
* arch/x86/core/userspace.c drops the eager k_mem_page_in() of the
thread's privileged stack on user-mode entry. With the kernel
image fully resident the stack is already mapped.
* arch/x86/gen_mmu.py drops map_region("lnkr_pinned") and the
set_region_perms() calls for lnkr_pinned_text / lnkr_pinned_rodata.
* CMakeLists.txt drops the LINKER_USE_PINNED_SECTION block that
generated APP_SMEM_PINNED_* variables and the
pinned_partitions target property feeding gen_app_partitions.py.
cmake/modules/extensions.cmake removes the PINNED_RODATA /
PINNED_RAM_SECTIONS / PINNED_DATA_SECTIONS zephyr_linker_sources()
location keywords and their snippet files.
scripts/build/gen_app_partitions.py drops --pinoutput /
--pinpartitions arguments and the pinned-output branch.
subsys/testsuite/coverage/CMakeLists.txt drops its
CONFIG_DEMAND_PAGING-conditional fork.
* scripts/build/gen_kobject_list.py drops the
app_smem_pinned_start / _end fallback for kobject placement
validation.
* tests/arch/x86/pagetables and tests/kernel/mem_protect/userspace
drop their lnkr_pinned_text / lnkr_pinned_rodata branches.
* include/zephyr/arch/x86/ia32/arch.h folds IRQSTUBS_TEXT_SECTION
to the unconditional ".text.irqstubs" form.
* tests/subsys/llext/src/syscalls_ext.c drops a stale comment about
syscalls landing in .pinned_text.
Targeted retentions:
* arch/x86/core/bootargs.c keeps multiboot_cmdline and efi_bootargs
in .noinit (was __pinned_noinit, which decayed to __noinit when
LINKER_USE_PINNED_SECTION was unset). The multiboot and zefi loader
paths write these buffers before Zephyr's BSS-zero step, so
zeroing them at boot loses the cmdline.
* arch/x86/core/ia32/fatal.c keeps _df_esf and _df_stack in .noinit.
They are scratch space written by the double-fault handler and have
no zero-init requirement; keeping them in .noinit also preserves
the historical post-noinit alignment that gen_mmu.py relies on
(z_mapped_size is computed before CMake-injected iterable sections
are appended to the linker script, so the post-noinit page padding
is what keeps those sections within the mapped region).
* include/zephyr/arch/x86/ia32/syscall.h and
include/zephyr/arch/x86/arch.h wrap the per-arch
arch_syscall_invoke* / arch_is_user_context / arch_k_cycle_get_*
implementations in @cond INTERNAL_HIDDEN. The public Doxygen
contract lives on the prototypes in
include/zephyr/arch/arch_interface.h; the per-arch implementations
are internal. Without this, removing the __pinned_func attribute
exposes the implementations to the doxygen-coverage delta check
as 10 newly-undocumented APIs.
Documentation updates are deferred to a separate commit.
Issue: #108773
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add an SPDX 3.0 (JSON-LD) serializer built on the spdx-python-model
package and wire it into makeSPDX, so that running west spdx with
--spdx-version 3.0 produces SPDX 3.0 output. One JSON-LD document is
written per SBOM document (app, zephyr, build, modules-deps); each
emits its packages, files and relationships and declares conformance
to the Core, Software and SimpleLicensing profiles.
- Add zspdx.serializers.spdx3.SPDX3Serializer.
- Register SPDX_VERSION_3_0 in the supported versions list.
- Add the spdx-python-model dependency.
- Add spdx3-validate and validate the generated SPDX 3.0 documents in
the software_bill_of_materials test.
- Generalize the west spdx command description and document SPDX 3.0
usage.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>