Commit graph

5778 commits

Author SHA1 Message Date
MA Junyi
718f0e7272 scripts: compliance: Add items to UNDEF_KCONFIG_ALLOWLIST
`BOOT_ENCRYPT_ALG_AES_128` and `BOOT_ENCRYPT_ALG_AES_256` are used in
`share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake`
They were first introduced in commit 9a1fe30

Signed-off-by: MA Junyi <mjysci@live.com>
2025-08-29 13:15:09 +02:00
Peter Johanson
5eeddab167 scripts: west: flash: Fix RFP runner platform check
Adjust the RFP runner platform check to properly handle Darwin or Windows
and skip setting a default RPF port on those two platforms.

Signed-off-by: Peter Johanson <peter@peterjohanson.com>
2025-08-28 14:00:02 +02:00
Ta Minh Nhat
652d822203 west: runner: rfp: support memory partition for rfp runner
Add rfp runner support for ek_ra6m4 and ek_ra6m5.
Add memory partition for rfp runner.

Signed-off-by: Ta Minh Nhat <nhat-minh.ta.yn@bp.renesas.com>
2025-08-28 13:58:33 +02:00
Sebastian Bøe
ac851ca160 soc: nordic: uicr: Reorganize how gen_uicr.py is invoked
Reorganize how gen_uicr.py is invoked.

Instead of invoking it from one of the Zephyr images we invoke it from
a new special Zephyr image called uicr.

This uicr Zephyr image is flashed in the same way as normal Zephyr
images so special handling in the runner is no longer necessary.

Also, we simplify gen_uicr.py by moving parsing of Kconfig/DT from
gen_uicr.py to CMake.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2025-08-26 09:38:18 +02:00
Benjamin Cabé
5a1065c37f scripts: ci: differentiate warnings from failures in compliance_check
We have a few checks that report warnings, and for some of them it's
actually the _only_ type of failure they report, so it can be confusing
when the output of check_compliance.py says the "check failed" and lists
all the things that are effectively warnings as "ERROR"s.
This commit makes the output more clear by differentiating between
warnings and actual errors, both when printing out individual failures,
but also when printing the summary for each test case (ie. a test case
is said to be "failing" only when it has at least one error, and is only
showing up as having warnings if it only contains... warnings).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-08-25 09:12:13 +02:00
Tom Burdick
9c27d72922 rtio: Add a context pool
Adds a context pool that can be used when a number of threads may be
dynamically created to use with RTIO. While the pool has a small cost to
it, the cost of verifying a statically declared kobject likely makes it
worth avoiding dynamically allocating these with the typical
kobject_alloc method. Instead this arena style pool of objects can be
used where the kobject validation uses the gperf hash created at build
time.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2025-08-22 16:45:53 +02:00
Garrett L. Ward
d8d90c087b scripts: west: runners: stm32cubeprogrammer: fix path lookup on macOS
On Windows and Linux, the stm32cubeprogrammer runner will use
STM32_Programmer_CLI from PATH if it is available, but this was not
implemented on macOS. Add PATH lookup for macOS as well, using the same
approach as Windows and Linux.

Fixes zephyrproject-rtos/zephyr#93056

Signed-off-by: Garrett L. Ward <glward@glward.net>
2025-08-22 12:35:34 +02:00
Thorsten Klein
b0f40e4dd0 scripts: zephyr_module: accept empty env vars for extra modules
Proceed if the environment variables ZEPHYR_EXTRA_MODULES or
EXTRA_ZEPHYR_MODULES are set to an empty string. Handle same way as if
the variable is unset.

Signed-off-by: Thorsten Klein <thorsten.klein@bshg.com>
2025-08-20 12:06:07 +02:00
Jamie McCrae
ea9815ff34 scripts: zephyr_module: Add variable with module path
Adds a variable that has the path of the module directory, this
is supplied as an argument when running cmake normally but is
not supplied when running the check compliance script, this
addition allows checks to be ran that use such syntax in Kconfig
files. This is then removed from cmake as the python file handles
it instead

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-08-20 12:05:41 +02:00
Krzysztof Chruściński
5718af02c5 scripts: west_command: build: Support for conditional platform configs
extra_configs or extra_args can use additional filtering which was not
supported by the west build command. West is not aware of arch so that
filter type is not supported but platform (board) is known so it can
be used to apply expected configuration.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-08-20 07:39:16 +02:00
Yasushi SHOJI
4c506c01ca scripts: west_commands: sdk: clarify toolchain selection help
Users were confused about which toolchain names to pass to
`west sdk install -t`, since the documentation did not list them.
Enhance the help text to suggest installing all toolchains if
unsure and point to the SDK release notes where the available
toolchains are listed.

ref: https://github.com/zephyrproject-rtos/zephyr/discussions/94572

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2025-08-20 02:18:12 +02:00
Omri Sarig
c712502fb9 scripts/logging: Create live_log_parser
Create a new, generic parser, that is able to parse dictionary logs live
- showing the messages as they are received from the device.

This functionality previously existed only for reading the log from a UART.
With the new script, the functionality is extended to be able to also read
the log from a file or stdin.
Additionally, the script is written in an extend-able way, making it simple
to support more input sources in the future.

The new script contains a better version of the live functionality than the
old script of log_parser_uart script, therefore, the old script has been
deprecated.
The UART script is still available, and will work by invoking the new
implementation with relevant arguments translation, however, it should
ideally not be used any longer, and should be removed from a future
release.

Signed-off-by: Omri Sarig <omsi@demant.com>
2025-08-19 11:39:49 +02:00
Omri Sarig
152e6252fe scripts/logging: Handle partly read packets
The current implementation of the serial log parser is running in a loop -
every 2 seconds it checks if there is any information ready to be read, and
in this case, it reads this information and parses it.
In case the last packet of the information is not fully available, the
script will read only the first part of the packet, and will fail when
parsing, ending the run with an error.

This should not the be the case, as it is not an error to have only part
of the packet in the buffer.
This commit fixes this problem - now, instead of failing because the parser
does not have enough information, the parser will parse all the full
packets it have, and keep the last, partial packet in the queue, to be
parsed together with the next chunk of data.

This is done by updating the log parsers to return the amount of parsed
data when trying to parse the information, and updating the calling scripts
to correctly handle this new return value.
Additionally, the parser is now quietly failing in case of having a partial
message, and throw an exception for any other kind of error in the parsing
(instead of returning a boolean return code).

In addition to the partial packet handling, the current commit also do the
following, minor improvements:
* parserlib now fails by throwing an exception, instead of exiting - this
  is done to make it possible to choose a different handling for the errors
  from the calling code, if needed.
* The dictionary and parser are now created before the parse operation.
  This makes the uart parser more efficient, and also removes the
  previously duplicated messages of build id, target architecture and
  endianess (which was printed every time new information was received from
  the UART).

Signed-off-by: Omri Sarig <omsi@demant.com>
2025-08-19 11:39:49 +02:00
Omri Sarig
cb94b1ba2a scripts/logging: Add support for numbered %ll and %hh
Python does not support values of long-long (ll) or short-short (hh) in
string-formatting. The current parser is correctly removing the first "h"
or "l" from the format, to make it possible to correctly parse these
strings when they are in the dictionary.

However, the current implementation does not correctly handle the case of
having a number before the "ll" or "hh" argument - which is supported by
both C and Python.

This commit updates the parser to correctly handle these cases, by changing
the simple replace operator with a regex replace, which is able to
correctly handle this case.

Before this commit, the string of:
    "This is my long variable: %08llX"
will stay the same, which will throw a ValueError when parsing this
dictionary message:
    "ValueError: unsupported format character 'h' (0x68) at index ".
After this commit, the string will be correctly fixed to
    "This is my long variable: %08lX"
which is parsed correctly.

Signed-off-by: Omri Sarig <omsi@demant.com>
2025-08-19 11:39:49 +02:00
Zhaoxiang Jin
bfe65a0179 scripts: compliance: Add items to UNDEF_KCONFIG_ALLOWLIST
'MCUX_HW_CORE' and 'MCUX_HW_FPU_TYPE' are used in
modules/hal_nxp/device.cmake. It is a variable used
by MCUX SDK CMake.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2025-08-18 22:00:19 +02:00
Ha Duong Quang
0f0dd2774b west: update to support for S32DS3.6
S32DS3.6 requires to use python 3.10, so update
PYTHONPATH for S32DS3.6 when debug on windows.

Update to verify new behavior of supported commands
with S32D3.6 on windows.

Update to find out the usb device connected by VID
and PID instead of class "NXP Probes" on windows
Because based on the S32 Debug probe OS version the
device class of USB is changed. Therefore a reliable
way to identify the probe is check the USB VID and PID.

Signed-off-by: Ha Duong Quang <ha.duongquang@nxp.com>
2025-08-18 13:07:32 +02:00
Marco Widmer
d45985347b twister: coverage: set gcov working directory
gcovr runs gcov to generate temporary coverage files into the gcov
working directory. The working directory defaults to gcovr's -r
argument.

When running twister with the --coverage-per-instance argument, multiple
gcovr instances may run in parallel. Since they all share the same gcov
working directory, they may interfere with each other, resulting in
errors like this:

	AssertionError: Sanity check failed, output file
	spinlock.h##4167b923a06cc9590c8eef372f016a6d.gcov doesn't exist
	but no error from GCOV detected.

To fix this, specify a separate gcov working directory for every test
through gcovr's --gcov-object-directory option.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2025-08-14 15:49:35 +02:00
Benjamin Cabé
051a951553 scripts: west: spdx: convert datatypes.py classes to Python data classes
Remove a bit of boilerplate code and add typing in the process.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-08-14 15:48:57 +02:00
Guðni Már Gilbert
b7efede67e scripts: kconfig: optimize write_kconfig_filenames
Filter duplicate entries in `kconf.kconfig_filenames` before calling
`os.path.realpath`.

Before (current code), all entries in `kconf.kconfig_filenames` go
through `os.path.realpath`. Including all duplicate entries.

With the proposed change, the duplicate entries are removed before
calling `os.path.realpath`.

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2025-08-13 18:31:41 +02:00
Lukasz Fundakowski
fc8164036c twister: Fix pytest warnings while discovers tests
Added `__test__ = False` to classes that have
`Test` in the name.

Signed-off-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
2025-08-12 20:39:29 -04:00
Fabio Baltieri
ee5b5f30fe twister: always call flash directly
Drop the logic to use the generator "flash" target, that is using west
anyway, always call flash directly anyway so that those targets can be
deprecated.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-08-12 09:55:47 +03:00
Hake Huang
9e551f5877 twister: harness: add display harness
display harness to validate display content

Signed-off-by: Hake Huang <hake.huang@nxp.com>
Co-authored-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-08-12 09:54:27 +03:00
Hau Ho
6b1f06b202 scripts: west: flash: Add support for scripts to flash using the RFP tool.
Add support for scripts to flash using the RFP tool.

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
2025-08-11 12:48:35 +03:00
Sylvio Alves
3d0192df75 runner: esp32: remove unused entries
Both partition_table and bootloader entries are not necessary for esp32
runner.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-08-07 13:14:40 +02:00
Henrik Brix Andersen
f567c22f37 scripts: west: commands: completion: bash: add --domain completion
Add completion support for "west build --domain" under the Bash shell.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2025-08-06 12:04:10 -04:00
Johann Fischer
1c0a4ca645 scripts: ci: check_compliance.py: add BOOT_SERIAL_UART to ALLOWLIST
Add Kconfig option BOOT_SERIAL_UART, defined in the MCUboot module but
needed to be used in tests, to the UNDEF_KCONFIG_ALLOWLIST.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-08-06 11:57:39 -04:00
Daniel DeGrasse
2d2e64af17 scripts: ci: exempt BOOT_RAM_LOAD_REVERT from checks
Add BOOT_RAM_LOAD_REVERT as a defined Kconfig to the whitelist

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-08-05 11:53:58 +01:00
Marek Matej
fa1840268b scripts: update the CI requirements for Espressif port
Updated twister.yaml workflow to fetch esptool for the CI.
Fix format of the arguments used in the esptool-5.0.2.
Check that esptool is available on build time.
Update runners for esp32.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2025-08-04 17:02:52 -04:00
Lauren Murphy
69a3ed2753 llext: replace stripping script with call to zephyr sdk strip
Replace custom stripping script with a call to Zephyr SDK strip.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-08-01 19:36:59 +01:00
Lauren Murphy
92db7bcf11 llext: compile llext with arc mwdt on nsim vpx5
Allow users to compile LLEXTs with the MetaWare Design Toolchain.
Provides utility to dramatically shrink bloated extensions by removing
unused section names left behind by MWDT strip. Test extensions will
not fit in NSIM VPX5 memory otherwise; each is reduced from ~16k to ~1k.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2025-08-01 19:36:59 +01:00
Anas Nashif
b1a3dc00b0 twister: report: switch --detailed-test-id logic
now no-detailed-test-id is enabled by default, so switch the logic so we
do not require the extra parameter when reruning.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-01 07:50:10 -04:00
Anas Nashif
7b1cc710b1 ci: test_plan: do not filter same test with different toolchain
Make sure we get same test with different tests included.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-01 07:50:10 -04:00
Anas Nashif
45596b7d71 ci: test_plan: fix detailed test id handling
detailed test id is no longer default, so switch the logic to deal with
that.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-08-01 07:50:10 -04:00
Declan Snyder
b45bc0332d scripts: check_init_priorities: Fix file leak
The elf file needs to be closed after done being used, otherwise sys
module will generate resource leak warnings.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-30 06:13:21 -04:00
Declan Snyder
0d6b0cebb1 scripts: gen_offset_header: Fix file leak
The files should be closed after done being used, otherwise python
warnings are generated from the sys module

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-07-30 06:13:21 -04:00
Luca Burelli
83b9577f38 west build: display closest matching board names on error
This commit modifies the 'west build' command to display the closest
matching boards when an invalid board is specified, making it easier
for users to find a typo in the used board name.

The user is also instructed to run 'west boards' if he wants to get
the full list of available boards.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-07-30 06:11:09 -04:00
Robert Robinson
8e69b52205 scripts: twister: handlers: Append dev-id for runner nrfutil_next
appends the --dev-id argument when using nrfutil_next runner.

Signed-off-by: Robert Robinson <robert.robinson@nordicsemi.no>
2025-07-29 11:24:21 -04:00
Fabio Baltieri
b1fccaad6e scripts: check_init_priorities: fix device function name display
Device init pointers have been moved off struct init_entry and into
struct device in 766bfe7b2e, but check_init_priorities.py have not been
modified to check the new pointer so it's been showing NULL for all
devices since.

Fix it by searching down the right pointer for device init entries.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-28 04:22:43 -04:00
Tim Pambor
dff24c8c00 twister: Fix race condition in try_making_symlink
Replaces the check-then-create pattern for symlinks with
opportunistic creation. Instead of checking for existence
before creating the symlink, the code now attempts to
create it directly and gracefully handles the case
where it already exists.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-07-25 23:30:31 +02:00
Jamie McCrae
6751c85c63 scripts: ci: check_compliance: Add check for zephyr module file
Adds a check which fails CI if a zephyr module file is added to the
zephyr repository itself

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-25 08:13:56 -04:00
Arkadiusz Cholewinski
d021851182 CI: Coverage: Fix: Get component name from testsuite name.
Get component name from testsuite name instead of
testcase identifier.

Signed-off-by: Arkadiusz Cholewinski <arkadiuszx.cholewinski@intel.com>
2025-07-24 17:00:48 +01:00
Jonathan Nilsen
78a61579d8 west: runners: nrf: don't recover twice on nrf54h
Update the recover mechanism for nrf54h to only call recover
once. Using nrfutil device recover with both --core Network and
--core Application is redundant with IronSide SE as both of these
map to the same operation which does a full erase of the device MRAM.

Additionally, recovering twice in a row specifically in a nrfutil
batch file (which is used by this runner implementation) triggers some
odd behavior with the current latest version of
nrfutil device + IronSide SE, which can cause the device to enter a
reset loop and appear unresponsive and preventing 'west flash --recover'
from working properly.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Jonathan Nilsen
eb7239c6a8 west: runners: nrf: Program UICR/PERIPHCONF artifacts if present
Program the new UICR and PERIPHCONF artifacts if they are generated.
These are required for the application to operate properly if they
are in use.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Grzegorz Swiderski
b4c18e8999 boards: nrf54h20dk: Merge iron variants into the base variants
This replaces the legacy SDFW compatible board configuration with the
IronSide SE compatible one, thus removing support for running samples
and tests on nRF54H20 devices with the old firmware.

All applications are expected to work on `nrf54h20dk/nrf54h20/cpuapp`
out of the box. For other board targets, all applications are expected
to boot, but may require additional peripheral configuration in UICR.
Build system support for the new UICR format is to be added separately.

Co-authored-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-07-24 16:57:45 +01:00
Pieter De Gendt
b1f398d176 scripts: ci: check_compliance: KeepSorted allow combining strip and re
No reason we couldn't strip a line we want to match to a regex.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-24 06:08:10 -04:00
Chaitanya Tata
ef8bbab600 ci: Add missing nrf_wifi directory
This directory is part of the nRF Wi-Fi driver and should trigger tests.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-24 06:04:00 -04:00
Jamie McCrae
744a5635f9 scripts: ci: check_compliance: Add support for module Kconfigs
Adds support for checking module samples and tests for additional
Kconfigs, as well as logging Kconfigs, so that this check can be
reused more easily with out of tree manifest repos

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-23 17:29:07 +01:00
Tim Pambor
c7e97bb5f8 runners: probe-rs: Support debug and debugserver
Add support for west debug and west debugserver to
the probe-rs runner.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-07-23 17:28:52 +01:00
Benjamin Cabé
99138170b3 scripts: requirements: remove lxml dependency
No more users of lxml in the tree so drop the 3rd party dependency (it
might still be pulled in by other projects, ex. gcovr).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-23 09:31:28 +02:00
Benjamin Cabé
65f2833638 scripts: tests: twister_blackbox: drop lxml dependency
No need to rely on lxml for such a simple XML parsing task.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-23 09:31:28 +02:00