Commit graph

6,360 commits

Author SHA1 Message Date
Zophai Liu
9ee71b498c west: runner: add realtek bee mpcli flash runner
Add support for the official realtek programming tool (CLI
version).

Signed-off-by: Zophai Liu <zophai_liu@realsil.com.cn>
2026-02-17 15:22:38 +00:00
Gaetan Perrot
fb0b2c3515 scripts: ci: compliance_check: ignore external module documentation
The undefined Kconfig compliance check may report symbols as
undefined when the corresponding external module is not present.

This results in false positives, since such symbols are provided
only when the module is included in the workspace.

Exclude doc/develop/manifest/external from the grep search used by
the undefined Kconfig check.

This avoids extending UNDEF_KCONFIG_ALLOWLIST for optional external
modules while keeping the check strict for core Zephyr symbols.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-02-17 08:02:05 -05:00
Lukasz Fundakowski
98c6fbfc9b twister: Refactor twister_main.py
Refactored main function for Twister execution.

- Rewrote the main function as a class and divided it into smaller,
  more maintainable methods.
- Improved code structure, making it easier
  to test with unit and module tests.
- Reduced the amount of code in a single function,
  enhancing readability and understanding

Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
2026-02-17 10:32:02 +01:00
Daniel Leung
098f61700f west: sign/rimage: do not assume SOF source exists
After the removal of the SOF module from the manifest, we should
no longer assume SOF source is available in the signing script.
If SOF source directory does not exist, we point the rimage
config directory to the support directory inside board directory
so that we can use local file to sign images.

Note that with this change, pulling SOF via Zephyr manifest is
no longer supported. Only SOF pulling in Zephyr via manifest is
supported.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2026-02-16 09:01:09 -06:00
Daniel Leung
a4c37560d5 west: sign/rimage: remove --no-manifest workaround
The --no-manifest option is no longer being used so we remove
the workaround.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2026-02-16 09:01:09 -06:00
Anas Nashif
dbd231853d west: sign: use local signing key if specified
Environment variable RIMAGE_SIGN_KEY can be used to specify
the signing key for rimage. We should check if it points
directly to the key instead of always prefixing it with SOF
path.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2026-02-16 09:01:09 -06:00
Henrik Brix Andersen
28cd602a81 scripts: requirements-actions: regen pinned dependencies
Run uv pip compile to get updated hashes for tomli.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2026-02-16 13:03:26 +01:00
Pete Johanson
f8ba603aab scripts: west: runners: stm32cubeprogrammer: Add --reset-type support
Obsolete the bespoke --reset-mode parameter in favor of the new standard
--reset-type parameter.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-02-13 19:01:50 +00:00
Pete Johanson
8213786f35 script: west_commands: jlink: Add --reset-type support
Add support for setting the reset type for the jlink runner, to support
targets that need a non-default reset type for proper `reset halt`, etc.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-02-13 19:01:50 +00:00
Pete Johanson
944f64870a script: west_commands: core: Add --reset-type parameter
For some devices, the default JLink reset type may not work properly, so
allow overriding the reset type by passing, e.g. --reset-type=12 when
flashing.

Add new field to RunnerCaps to allow runners to specify either a fixed
list of possible types, or True to expose the standard --reset-type
parameter for that runner.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-02-13 19:01:50 +00:00
dependabot[bot]
c620982fa1 build(deps): bump cryptography from 46.0.3 to 46.0.5 in /scripts
Bumps [cryptography](https://github.com/pyca/cryptography) from 46.0.3 to 46.0.5.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/46.0.3...46.0.5)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 46.0.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-13 10:08:44 +01:00
James Roy
e2d805269a dts: gen_dts_cmake.py: Add a to_cmake_list() function
It conveniently converts an iterator into a CMake list.
(e.g.: `[1,2,3]` convert to `1;2;3`)

Signed-off-by: James Roy <rruuaanng@outlook.com>
2026-02-12 09:30:05 +01:00
Benjamin Cabé
0162442bfa scripts: coccinelle: improve matching for boolean_strict_init.cocci
boolean_strict_init.cocci would find false positive when a compilation
unit would contain a boolean variable "x" somewhere, and, in a different
scope, another variable "x" of e.g. int type that was assigned a 0 or 1.

See for example drivers/sensor/adi/adxl367/adxl367_stream.c:97 where
fifo_wmark_irq is declared as an int in the scope of the function but
as a bool in adxl367_process_status_cb.

This also adds the patching part to the script so that violations can be
fixed automatically.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-02-11 17:50:12 -06:00
zjian zhang
3b11fd38c3 west: runner: add realtek amebaflash runner
Add support for the ameba programming tool (CLI version).

Signed-off-by: zjian zhang <zjian_zhang@realsil.com.cn>
2026-02-11 15:02:10 -06:00
Omkar Nanajkar
d2c47a5cee scripts: west: zsh completion: add missing commands and options
Update the Zsh completion script to support newer west extensions and
commands, bringing it closer to feature parity with the Bash completion.

Key changes:
- Add completion support for twister, bindesc, blobs, robot, sdk,
  packages, patch, gtags, simulate, and reset
- Improve option completion for build, flash, debug, and runner commands
- Enable dynamic lookup for boards and shields
- Refactor argument handling for better Zsh compliance

Fixes #73129

Signed-off-by: Omkar Nanajkar <nomkar2131@gmail.com>
2026-02-10 15:11:42 +01:00
Pieter De Gendt
a0a71dabf8 scripts: zephyr_module.py: Optional jsonschema dependency
Commit 58bf2dc0e6 replaced pykwalify with
jsonschema for Zephyr module.yml files. However the west 'packages'
extension uses this module to list Python dependencies for Zephyr and
active Zephyr modules.

Make YAML validation optional using a new argument.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-10 15:10:10 +01:00
Damian Krolik
47f1e8dcef scripts: coredump: fix Python exception
The coredump parsing script raises an exception as it tries
to format bytes objects as integer (":d").

This is a regression from a recent PR fxing ruff warnings.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2026-02-09 12:02:37 -06:00
Tomasz Chyrowicz
0e99df3ca8 dts: Handle phandles in cmake
Add a possibility to use phandles values in CMake.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2026-02-09 13:30:23 +01:00
Pieter De Gendt
2b57985df1 scripts: dts: python-devicetree: Fix failing test with uppercase address
Commit f55358bcbf changed all hex values to
use lowercase characters. Update the test accordingly.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-09 09:37:12 +01:00
Maciej Sobkowski
61ba3c9cd6 instrumentation: support dynamic triggers
This makes using instrumentation with any sample/board combination
much easier, as it eliminates the need to define a custom dt overlay.
Trigger/stopper functions need to be configured at build time.

Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2026-02-06 13:53:34 +01:00
Jingsai Lu
36ffd63500 scripts: west_commands: add west reset command to reboot board
add west reset command with gdb reset for jlink runner

Signed-off-by: Jingsai Lu <jingsai.lu@nxp.com>
2026-02-06 11:15:23 +01:00
Johan Hedberg
9fa30fc2bf scripts: zephyr_module: Fix optionality of "click-through" for blobs
When pykwalify was changed to jsonschema in commit 58bf2dc the optionality
of 'click-through' was lost. Fix this by making sure there's always a value
in the dictionary, eliminating the following error when the key is missing:

if blob['click-through'] and not args.auto_accept:
   ~~~~^^^^^^^^^^^^^^^^^
KeyError: 'click-through'

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-02-05 13:01:36 +00:00
Mathieu Choplain
2c43940195 scripts: footprint: fpdiff: read proper value for symbol sizes
The AnyNode class has a `size` property which hides the value sourced from
JSON key 'size', resulting in the script displaying nonsense. Consume the
proper value by directly accessing the __dict__ which holds it instead of
relying on the dot operator.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-02-05 10:20:35 +00:00
Sylvio Alves
b4f469a7d4 scripts: coccinelle: add MISRA 10.1 boolean essential type check
Add boolean_strict_init.cocci to detect improper boolean initialization
and assignment using integer literals (0/1) instead of true/false.

This enforces Zephyr coding guideline #59 (MISRA C:2012 Rule 10.1)
which states that operands shall not be of an inappropriate essential
type.

Rules added:
- rule1_init: detects bool var = 0/1 initialization
- rule2_assign: detects bool_var = 0/1 assignment

The original boolean.cocci (Rule 14.4) remains disabled due to
performance issues on large files causing CI timeouts. See PR #34773.

Enable boolean_strict_init.cocci in guideline_check.py so CI runs this
check on changed files.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-02-04 12:52:07 -06:00
Kyle Bonnici
f55358bcbf dts: use lowercase hex values in DTS files.
Apply chnages from dts-linter 0.3.9.

Improve compliance with DTS Coding Style which says that:

4) Hex values in properties, e.g. “reg”, shall use lowercase hex.
   The address part can be padded with leading zeros.

Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
2026-02-04 13:49:43 +01:00
Kyle Bonnici
3749347e1b CI: Update dts-linter dts-linter 0.3.9
Update DTS linter apply lowercase hex values in DTS files
Improve compliance with DTS Coding Style which says that:

4) Hex values in properties, e.g. “reg”, shall use lowercase hex.
   The address part can be padded with leading zeros.

This need dts-linter 0.3.9

Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
2026-02-04 13:49:43 +01:00
Darcy Lu
e7e2b0a16c script: Add flash runner for rts5817
Add flash runner script to support west flash for rts5817

Signed-off-by: Darcy Lu <darcy_lu@realsil.com.cn>
2026-02-04 13:49:21 +01:00
Sylvio Alves
738c5b713d runners: auto-select build artifact when --file-type is specified
when --file-type is provided without --file, automatically select
the corresponding build artifact (zephyr.hex, zephyr.bin, or
zephyr.elf) instead of requiring the user to specify both flags.

the validation that --file-type requires --file is preserved in
core.py, but run_common.py now auto-populates --file before the
validation runs.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2026-02-03 14:25:14 -06:00
Chris Friedt
c78a0e2550 scripts: ci: guideline_check: ignore tests/posix/ in coccinelle
Exclulde `tests/posix/` when running coccinelle checks for reserved names
since POSIX implements much of the reserved names.

This avoids the following failure in CI

```shell
Error: tests/posix/xsi_single_process/src/putenv.c:12: WARNING: \
  Violation to rule 21.2 (Should not used a reserved identifier) - putenv
```

Signed-off-by: Chris Friedt <chris@fr4.co>
2026-02-03 08:22:49 -06:00
Pieter De Gendt
f728794ac0 scripts: dts: gen_dts_cmake.py: Fix keys in dict linter issue
Simplify loop as reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-02 11:37:53 -06:00
Pieter De Gendt
85a6e11bdb scripts: dts: gen_dts_cmake.py: Prevent trailing semicolon for lists
The generated lists have a trailing semicolon, which for CMake would
indicate a trailing empty item.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-02 11:37:53 -06:00
Pieter De Gendt
4159632248 scripts: dts: gen_dts_cmake.py: Format file
Format the gen_dts_cmake_py file using ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-02 11:37:53 -06:00
Guðni Már Gilbert
b4108b53f6 scripts: tests: speed up test_output_levels
Assign a platform to the test so Twister doesn't
pick up multiple platforms.

This reduces the test time by ~2 minutes.

Before: 9 passed in 265.88s (0:04:25)
After: 9 passed in 140.24s (0:02:20)

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2026-02-02 14:46:53 +01:00
Guðni Már Gilbert
fc8e096ee1 scripts: twister: minor speedup in apply_filters
Move a check to run earlier in a for-loop to minimize doing unnecessary
work like creating TestInstance class instances.

This is a very minor optimization when the number of testsuites are low.
But starts to count when there are a lot of testsuites.

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2026-02-02 14:46:34 +01:00
Jon Ringle
c6c014929e scripts: footprint: size_report: Fix TLS symbol attribution
TLS sections (e.g. .tdata/.tbss) use addresses as TLS offsets and can
overlap normal VMA ranges. Avoid using TLS section address ranges for RAM
bucketing and classify TLS symbols using section flags instead.

Signed-off-by: Jon Ringle <jringle@gridpoint.com>
2026-02-02 14:44:13 +01:00
Afonso Oliveira
5c7be7ecb7 runners: Add lldbac runner for run-lldbac debugging
Introduce a new Zephyr runner, `lldbac`, providing interactive debugging
for both nSIM (simulator) and physical hardware using the run-lldbac
tool from Synopsys ARC MWDT.

This runner provides integrated debugging support:
- debug: Interactive debugging with integrated server management,
  Available for both simulator and hardware (integrated mode)
- flash: Flash and run on physical hardware,
  Available for hardware only (simulator should use arc-nsim)

Key features:
- Hardware mode: Flash and debug on physical hardware using JTAG flags
- Simulator mode: Interactive debugging on nSIM using run-lldbac with
  --nsim flag (props or --tcf). Enable with --simulator flag.
- Board-driven config: Boards can specify defaults in board.cmake
- TCF support: Optional --tcf for simulator mode (mutually exclusive
  with --nsim-props)
- GUI support: Optional --gui flag for VS Code debugging
- Postconnect support: Execute commands after connection via
  --postconnect-cmd and --postconnect-file for hardware initialization
- Board JSON: Optional --board-json for complex board configurations

Hardware configuration (flag-based):
- --jtag-device: JTAG device name (optional, auto-detected)
- --jtag: JTAG adapter type (default: jtag-digilent)
- --jtag-frequency: JTAG clock frequency (default: 500KHz)
- --postconnect-cmd: Command to execute after connection
  (can be used multiple times)
- --postconnect-file: File containing commands to execute after
  hardware initialization
- --board-json: Path to board.json file for board configuration

Simulator configuration:
- --simulator: Enable simulator mode (required)
- --nsim-props: nSIM properties file path
- --tcf: Tool Configuration File (alternative to --nsim-props)

Signed-off-by: Afonso Oliveira <afonsoo@synopsys.com>
Signed-off-by: Mohamed Moawad <moawad@synopsys.com>
2026-02-02 14:43:05 +01:00
Robert Robinson
ccf98f74bf scripts: runners: nrf: Add support for nRF7120
Add support for nrf7120 to use nrfutil runner in
upstream zephyr.

Signed-off-by: Robert Robinson <robert.robinson@nordicsemi.no>
2026-02-02 12:55:40 +01:00
Guðni Már Gilbert
58bf2dc0e6 scripts: zephyr_module: replace pykwalify with jsonschema
Replace all usage of pykwalify in zephyr_module.py with jsonschema

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2026-02-02 09:59:40 +01:00
Hake Huang
cdd9d63a46 twister: handler: add spsdk support with dev_id
spsdk now support dev_id as parameter

Signed-off-by: Hake Huang <hake.huang@nxp.com>
2026-01-31 10:56:06 +01:00
Guðni Már Gilbert
bcb00aaa9a scripts: twister: don't parse snippets multiple times
Currently apply_filters is parsing & validating a snippet YAML
file multiple times, duplicating expensive work.

Do the work once per testsuite instead of for each testsuite
multiplied by number of toolchains.

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2026-01-30 16:56:25 -06:00
Lukasz Fundakowski
2ad2ce9fe1 twister: Improve error handling for user's errors
Exit from twister in case of user's error e.g. empty list
of tests provided by user instead of throwing unhandled
exception.

Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
2026-01-30 16:55:29 -06:00
Piotr Kosycarz
aedada06c6 scripts: pylib: twister: twisterlib: coverage: catch hex parsing
As parsing hex was moved, move also catching its possible errors.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2026-01-30 05:59:28 -06:00
Kyle Bonnici
968bd7fa6f CI: Add prefix to dts-linter npx commands
When running check_compliance downstream the prefix path is not correct.
This need to be relative to zepphyr base.

This PR ensure that the prefix is set correctly when invoking dts-linter

Signed-off-by: Kyle Bonnici <kylebonnici@hotmail.com>
2026-01-30 09:20:02 +01:00
Somil Gupta
5b8764e463 checkpatch: warn on sizeof used with character literals
In C, character literals have type int, so using sizeof() on a
character literal evaluates to sizeof(int) and can easily lead to
subtle size miscalculations.

Add a new checkpatch warning to flag sizeof() usage on character
literals and suggest using an explicit cast instead.

Signed-off-by: Somil Gupta <somil24559@iiitd.ac.in>
2026-01-30 09:18:43 +01:00
Yves Wang
181e421611 scripts: traceconfig: Improve file path display
For Windows, if the build dir is under same drive with zephyr base, the
generated link shall be relative url like posix style.
If they are in different drive, url is meaningless. So just use raw link
format so that some editors can directly jump to.

Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
2026-01-29 16:08:38 -06:00
Yves Wang
745e0b28bd scripts: guiconfig: Add dark mode
TK under Windows/Linux did not have a native support for dark mode.

Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
2026-01-29 17:17:31 +01:00
Jon Ringle
cf5deb7c6e scripts: footprint: plot: Increase label font size
Improve readability of sunburst labels in generated interactive plot.

Signed-off-by: Jon Ringle <jringle@gridpoint.com>
2026-01-29 14:26:47 +00:00
Grzegorz Chwierut
1b1e902540 Revert "twister: pytest: fix duplicate log lines from pytest"
This reverts commit 96985a32e8.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2026-01-29 14:26:41 +00:00
Jon Ringle
f6487c3b8c scripts: footprint: plot: Guard against missing total_size
When total_size is missing, skip the percentage line in hover text.

Signed-off-by: Jon Ringle <jringle@gridpoint.com>
2026-01-29 14:26:10 +00:00
Mathieu Choplain
edbdfcad8c llext: add discarded symbol groups inspector
When the LLEXT subsystem detects that a symbol is marked for export from
the main image, but the symbol group in which the export belongs is not
enabled, add a marker in a special section in addition to not placing the
symbol in the final export table.

Add a post-build script which consumes the special section as post-build to
dump information about all discarded symbols in a build artifact, and also
check for common errors (missing Kconfig symbol / improperly named groups).

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-01-29 13:42:56 +01:00