The gen_shell_aliases.py is used to generate a file that can
be included to the shell to implement aliases support.
Assisted-by: Copilot:claude-sonnet-4.6
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Treat repeated exports of the same symbol/address pair as duplicates
rather than hash collisions when preparing the llext export table.
Log a warning and continue processing so valid duplicates do not
fail preparation.
Also raise a RuntimeError when preparation returns a non-zero status to
surface failures instead of silently continuing.
Signed-off-by: Jun Lai <jun.lai@dolby.com>
Adds support for using the chosen SRAM node for getting the RAM
start address instead of having to rely on Kconfigs
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Create a helper function to decode ULEB128 and replace two hand-rolled
implementations.
Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Fixed big-endian address decoding in find_kobjects to use struct.unpack
with elf.little_endian.
Assisted-by: Claude:claude-sonnet-4.6
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Instead of writing one item for each set_target_properties()
set_target_properties(${DEVICETREE_TARGET} PROPERTIES <item1>)
set_target_properties(${DEVICETREE_TARGET} PROPERTIES <item2>)
...
set_target_properties(${DEVICETREE_TARGET} PROPERTIES <itemN>)
Write one set_target_properties which contains all items:
set_target_properties(${DEVICETREE_TARGET}
PROPERTIES
<item1>
<item2>
...
<itemN>
)
Later when edt.pickle.cmake is included in extensions.cmake
via include(${gen_dts_cmake_output})
CMake will process the file much faster.
Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
The current implementation of the LLEXT EDK exports only a partial set
of compiler settings to the EDK build system, specifically only the ones
defined by the Zephyr core (the 'zephyr_interface' target). Extending
this to include application and module-specific settings (from the 'app'
target and its dependencies) is tricky, because:
- while evaluating the main CMakeLists.txt, the 'app' target is not
fully configured yet, and
- using generator expressions is not possible due to CMake not allowing
expansion of $<COMPILE_LANGUAGE:...> outside of a proper compile
context.
To work around this, this change introduces a new CMake subdirectory
(misc/llext_edk) that creates a dummy target which imports the build
configuration from 'app', but overrides the C compile rules to simply
output the resulting properties (defines, include directories, flags)
to text files. The EDK generation script then reads those text files
to get the full set of build properties, and includes them in the EDK
tarball.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This changes the LLEXT EDK flag filtering to be done after the main
Zephyr build is completed. Instead of filtering the flags via genexes,
the full set is passed to the script along with the set of filters to be
applied, and the filter is applied later.
No functional change is intended.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
The DW_OP_plus_uconst offset in DWARF location expressions is
ULEB128-encoded, but the script reads only a single byte. This
silently truncates offsets >= 128, registering kernel objects at
wrong addresses in the kobject hash table.
Clang triggers this because it emits DW_OP_addr + DW_OP_plus_uconst
for variables within structs, while GCC emits a direct DW_OP_addr.
Signed-off-by: Adarsha Regmi <aregmi@qti.qualcomm.com>
parse_syscalls.py scans thousands of headers and source files during a
pristine build. DEVICE_API_EXTENDS is only present in a few files, but the
new API inheritance handling ran api_extends_regex over every file body.
Assisted-by: Codex:gpt-5 hyperfine cProfile
Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
Fixes#105743
The build_dir path is not passed as a command-line argument but
through the YAML config file exchanged between Twister and the
pytest harness. Read build_dir from dut.device_config instead
of request.config.getoption.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Some device driver APIs embed and extend other ones (e.g. I3C extends I2C).
Introduce DEVICE_API_EXTENDS to declare parent-child relationships between
device API classes, and update DEVICE_API_IS to use a new _ext_end linker
symbol as the upper bound of its range check.
All device API entries are placed in a single output section
(device_api_area). Child class entries are placed after their parent's
entries using a depth-first walk, and an _ext_end symbol is emitted after
all descendants. This makes DEVICE_API_IS(parent_class, dev) return true
for devices with a child API, and naturally supports multi-level
inheritance.
Example linker output for parent i2c with child i3c:
SECTION_PROLOGUE(device_api_area, ,) {
Z_LINK_ITERABLE(i2c_driver_api);
Z_LINK_ITERABLE(i3c_driver_api);
_i3c_driver_api_ext_end = .;
_i2c_driver_api_ext_end = .;
}
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Allow multi-DUT test scenarios to run on native_sim simulator.
For non-device handlers, create placeholder reserved_duts entries
using CompoundHardwareData so pytest harness can find DUT configs.
Multi-DUT on native_sim is only allowed when all required devices
use the same platform (no cross-platform multi-DUT in simulation).
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Replace plain dict usage for required_application elements with
a typed RequiredApplication dataclass for improved type safety
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Add support for flashing a different application to a required
DUT in multi-DUT testing. When a required_device entry specifies
an 'application' field, twister matches it against the
required_applications build dirs and assigns the correct
build_dir to the reserved DUT before flashing.
Move the required applications readiness check from
process_tasks() into ProjectBuilder.process() at the 'run'
stage. This ensures that building is not blocked by the
required_applications mechanism. Mutual
dependencies between instances is also allowed.
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Main:
- Add HardwareReservationManager class and move DUT reservation
logic from HardwareMap to improve separation of concerns
- Add 'required_devices' structure to testsuite YAML schema to
define multiple device requirements for a test
- Add option to reserve multiple devices, filtered by platform
and fixtures. Fixtures can have an extra parameter (after ':')
that must match across the main DUT and required devices
Other:
- Add HarnessConfig dataclass to provide structured access to
harness configuration data instead of raw dict access
- Change 'fixture' parameter in harness_config from string to
list of strings for more flexibility when matching DUTs with
multiple fixture requirements
- Move conversion of short platform names to full target names
from hardware map into TestPlan module. This ensures platform
names are resolved before test discovery
- Add unit tests for HardwareReservationManager
- Align existing tests with new dataclass structures
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
- Runs MPLab IPE commandline utility to flash Microchip boards
- Flash support only, no debug.
- Adds mplab_ipe runner to tests.
Assisted-by: Claude:claude-sonnet-4-6 chat
Signed-off-by: Muhammed Asif P <asifp3104@gmail.com>
Defining code partitions using the zephyr,mapped-partitions
compatible is now possible, which means that
CONFIG_FLASH_LOAD_OFFSET is no longer set. Use the reg address
from devicetree when CONFIG_FLASH_USES_MAPPED_PARTITION is set
instead of relying on the Kconfig option.
Fixes: #107785
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
gen_strerror_table.py missed E2BIG (Arg list too long) because
the regex didn't include numbers in the ERRNO macro
Signed-off-by: Micah Terhaar <mterhaar@me.com>
When the west rtt command is executed, two things happen:
- A GDB server is run.
- A telnet client (via sockets) is opened to connect to that server.
Previously, that telnet client was operating in the line mode in both
directions. That mode is perfectly fine for just presenting the captured
content (RTT data) to the stdout; however, it is not suitable for
interacting with the device via the shell subsystem. None of the
control commands, such as tab and arrow keys, were correctly passed down
to the device.
To solve that the telnet client had to be switched into the character
mode. For that two separate implementations were needed, one for the
Unix and one for Windows. That was solved with two different context
managers.
They both wrap the common logic: two threads, where one reads input
from the keyboard and sends it to the telnet client, and the other on
reads the data from the telnet client and prints it to the screen.
Signed-off-by: Marko Sagadin <marko.sagadin42@gmail.com>
Move the list of undefined Kconfig symbols to allow out of the python
script and into a dedicated file.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Allow warnings output by the `undef_within_kconfig` check to be
suppressed for individual symbols (list loaded from a file).
While ideally this situation should be avoided, in practice it is
sometimes unavoidable for modules that are intended to support being
imported from multiple manifest repos, or are trying to support multiple
zephyr versions.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Allow the symbols defined in `UNDEF_KCONFIG_ALLOWLIST` to be extended
at runtime by loading a list from a file, with the file specified as
an environment variable.
This allows the script to be used without modification by other repos
that have their own set of expected undefined symbols.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The live log parser has been modified, so that it will not use `select`
if running on Windows. This is necessary, since the `select` call is
not available on Windows.
Signed-off-by: Kenneth Nielsen <knns@demant.com>
Amend commit fb5346d743 ("scripts: west_commands: runners: core.py:
ignore sys.stdin type check") to confirm it is indeed a mypy regression
and add the URL of the corresponding issue in the mypy tracker.
Signed-off-by: Marc Herbert <Marc.Herbert@gmail.com>
When no copy/zero relocation logic is generated, the script emits a
return statement in the generated relocation functions.
Add a tab before the fallback return so the generated code keeps
consistent function-body indentation style.
This is a formatting-only change and does not affect relocation
behavior.
Signed-off-by: Yiren Guo <guoyr_2013@hotmail.com>
Instruct mypy to ignore the type check on sys.stdin as it is given issues
with at least mypy==1.20.0.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This causes Twister to be able to log errors found by list_boards.py,
instead of quitting silently.
Before:
$ twister; echo $?
INFO - Using Ninja..
INFO - Zephyr version: v4.4.0-rc3-9-g2f8a724a4b31
INFO - Using 'zephyr/gnu' toolchain variant.
1
Note that there is neither a warning nor an error printed.
After:
$ twister; echo $?
INFO - Using Ninja..
INFO - Zephyr version: v4.4.0-rc3-10-gdb2f2b597c55
INFO - Using 'zephyr/gnu' toolchain variant.
ERROR - Malformed board YAML file: <censored>/board.yml
{'name': 'censored', 'vendor': 'censored', 'socs': [{'name':
'censored'}]} is not valid under any of the given schemas in $.board
1
The change has been implemented so that when running list_boards.py
directly, the errors will be displayed with in the same style as before.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Add support for debugging in IAR:s IDE Embedded Workbench. This is
combined with flashing with IAR:s tool CSpyBat in a single runner called
'iar'.
Co-authored-by: Ivar Bjerling <ivar@ivarbjerling.com>
Signed-off-by: Gustav Holmberg <gustav.holmberg@iar.com>
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>