Commit graph

5505 commits

Author SHA1 Message Date
Fabio Baltieri
649eb6280d ci: pr_metadata_check: convert DNM logic to python
GitHub seems to have issue with workflow state caching that causes the
DNM step to not work properly in few cases and not detecting changes in
the DNM tag, forcing people to mess with tags or close/opening PRs,
which in turns restarts all workflows.

Convert the script to Python so that the tag data is guaranteed to be
fresh.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-05-20 10:17:19 +02:00
Jiafei Pan
48ed1a74a6 scripts: runners: jlink: add support to flash to sram
Add new parameter "--flash-sram" for J-Link runner to flash the image
to SRAM and modify the PC register to start of SRAM.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-05-20 09:16:47 +02:00
Ederson de Souza
9741c25715 twister: More restrictive regex for log markers
Some simulators - like simics - may end up adding extraneous suffixes to
logged lines. This may cause some regex that match too much fail. This
patch fixes two such cases:

  - regex to find RunID changed to only match valid hexadecimal
    characters;
  - regex to match start of testsuite changed to only match valid word
    characters (0-9A-Za-z_).

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-05-17 14:11:45 +02:00
Benjamin Cabé
08206688fd scripts: runners: nios2 runner has been dropped
Remove `nios2` from list of available runners as it's just been dropped
with commit 5fe84d5b69

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-05-16 19:02:34 +02:00
Chris Friedt
c32488f97b cmake: kconfig: auto-generate boolean board revision option
Automatically generate a boolean CONFIG_BOARD_REVISION_FOO=y Kconfig
option based on e.g. CONFIG_BOARD_REVISION="foo".

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-05-16 16:11:48 +02:00
Luca Burelli
fe7f71ba16 dtlib: add test for lineno/filename comments
Tweak the existing filename_and_lineno test to also check the generated
comments in the string representation of the devicetree match expected
contents and alignment.

Using tmpdir as the base directory simplifies the comparison by avoiding
directory separator issues.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-05-16 09:38:35 +02:00
Luca Burelli
c1603b3163 gen_edt: use workspace dir as base for relative paths in comments
This commit allows comments to reference files with paths that are relative
to the Zephyr workspace root. This is done by adding a new argument
'--workspace-dir' to the 'gen_edt.py' script, which is passed to the
'EDT' and 'DT' classes and used instead of the current working directory.

The workspace directory is set to WEST_TOPDIR if West is in use,
otherwise it is set to the parent directory of ZEPHYR_BASE so that
Zephyr files have a 'zephyr/' prefix.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-05-16 09:38:35 +02:00
Luca Burelli
a63cb8e74d dtlib: fix double empty line before root node
The root node is the first node in the DTS string representation, and is
currently separated from the headers by two empty lines.

Adjust the spacing so that only one line is printed in all situations. A
small adjustment is added to the test suite to keep the current expected
outputs unchanged.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-05-16 09:38:35 +02:00
Benjamin Cabé
afdb62d1e2 dtlib: add lineno/filename to string representation of a DT
Output lineno/filename as comments in the string representation of a DT
to help with debugging DT issues. Also, remove the added comments when
comparing the string representation of a DT to a reference string in the
DT testsuite.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-05-16 09:38:35 +02:00
Luca Burelli
6b325daa2a dtlib: wrap array properties in string representation
List each element of a property array in a different line to improve
the readability of the generated DTS file.
Update the test suite's expected outputs accordingly.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-05-16 09:38:35 +02:00
Luca Burelli
4b8be385c0 dtlib: fix 'phandle' property's filename and line number
The phandle property is auto-generated when parsing the DTS, so there is
no 'source information'. This commit sets the filename and line number
of the phandle property to be the same as the first reference to the
target node.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-05-16 09:38:35 +02:00
Anas Nashif
5fe84d5b69 arch: nios2: remove arch
Remove architecture and dependencies.
Remove altera HAL supporting nios2

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-15 20:01:05 -04:00
Anas Nashif
7e47227d87 boards: max10/nios2: remove remaining boards/socs
Remove remaining nios2 based boards and soc files.

Part of #89280

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-15 20:01:05 -04:00
Felix Behnke
a045eaebad fix: twister: quit-on-failure
use public queue methods to clear queue on failure

-s Felix Behnke felixbeiderarbeit@gmail.com

Signed-off-by: Felix Behnke <felixbeiderarbeit@gmail.com>
2025-05-15 22:14:27 +02:00
Jason Yu
c488c652cd modules: hal_nxp: Unified to use SDK NG driver
Some NXP boards are using legacy SDK driver, such as S32K, K64, MIMX8Q,
and so on. The legacy SDK driver will not be updated, migrate to use
SDK NG driver.

Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
2025-05-15 19:32:19 +02:00
Carles Cufi
9f7b786a35 scripts: compliance: Avoid exception when commit message body is empty
Avoid the following exception in the Identity test when the commit body
is empty:

Traceback (most recent call last):
  File "zephyr/scripts/ci/check_compliance.py", line 2053, in main
    n_fails = _main(args)
              ^^^^^^^^^^^
  File "zephyr/scripts/ci/check_compliance.py", line 1988, in _main
    test.run()
  File "zephyr/scripts/ci/check_compliance.py", line 1459, in run
    auth_name, auth_email, body = git(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 3, got 2)

This is triggered because ``%b`` represents the body of the commit
message, which can be empty if there's a single line in it, because the
first line is considered the title.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-05-15 19:31:47 +02:00
Mirai SHINJO
e4650bc349 scripts: ci: check_compliance: fix identity check for multiple DCOs
The current implementation of the identity check fails if multiple DCO
signoff lines are present and the first instance of the signoff line
does not belong to the author of the commit. This patch proposes a solution
that allows patches with multiple DCO signoff lines to pass the identity
check, regardless of the order of the signoff lines.

Signed-off-by: Mirai SHINJO <oss@mshinjo.com>
2025-05-13 17:46:01 +02:00
Carles Cufi
6659d2d711 scripts: runners: nrfutil: Check return code after Popen
The code invoking nrfutil was not checking the return code of the
subprocess, which meant that if the underlying tool was exiting with a
failure error code it remained undetected.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-05-13 17:45:09 +02:00
Mateusz Junkier
04b49fadab twister: harness_config extended by test retries in testcase.yaml
Extend Twister to allow defining repeat counts
for specific scenarios by harness_config.

Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>
2025-05-13 03:20:10 +02:00
Alberto Escolar Piedras
3e0eb8a7d1 native_simulator: Get latest from upstream
Align with native_simulator's upstream main
19293fafc9959b03ece651e5e2afb768cfa891cf

Which includes:
19293fa misc trivial changes to please static analyzers
2a41263 nsi_tracing: Annotate functions as noreturn
f0307c1 nct: Simplify and improve switching performance
9f0c825 nce: Optimize/improve performance
63ce7e2 nsi_utils: Add macro to define static inline functions
6035bd8 nsi_errno: Minor optimization with no functional impact

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-05-12 19:20:37 +02:00
Robin Kastberg
5a92e46c92 iar: toolchain: Implement IAR static init routine
This will implement a way of doing static initialization
the "IAR" way. This is done by calling __iar_data_init3
which handles all static initialization that is mentioned
in the linker file "initialize by copy".

Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
2025-05-12 19:18:56 +02:00
Vignesh Pandian
d750daa2bb west: fix for west flash --context with sysbuild.
Fix west flash --context fails for Sysbuild projects issue.

Signed-off-by: Vignesh Pandian <vignesh@aerlync.com>
2025-05-08 15:56:02 +02:00
Daniel DeGrasse
6ec7908239 scripts: west_commands: runners: do not print newline in telnet decode
Remove the newline printed after decoding a block of telnet data from
the server in the "pure python" implementation used when netcat is not
available. This newline print is incorrect as it is not in the RTT
output being produced from the device, and can impact programs like
twister which expect specific strings in the output and cannot handle
these strings being split across two lines

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-05-08 12:25:07 +02:00
Kyle Micallef Bonnici
003fb88afd scripts: footprint: fix node size computation
fix issue with (no paths) != sum(<no paths>)

In some cases it was observed that item were being
added to the node_no_paths and these only had a
path of ':' hence no node was ever added.

This resulted in the size of (no paths) to not be
equal to the sum of it's children.

I am not sure if this size should be a child named
of no paths or if  this should be part of the
node_hidden_syms. I assumed it should be part
of node_hidden_syms

Signed-off-by: Kyle Micallef Bonnici <kylebonnici@hotmail.com>
2025-05-07 23:03:29 +02:00
Yuval Peress
5b19a9b94d twister: Better manage gcov sym link
In twister coverage runs we create the gcov sym link to llvm-cov
executable. This code runs multiple times which causes errors with the
current implementation since creating the symlink will fail; then
copying will also fail because we're using the symlink (self copy the
file).

Add a helper function to `try_making_symlink` which will handle the
following cases:
1. If the symlink already exists and is correct, do nothing.
2. If the symlink exists but points to the wrong file, replace it.
3. If the symlink doesn't exist create it.
4. If creating a symlink fails, just copy the file.

Signed-off-by: Yuval Peress <peress@google.com>
2025-05-07 21:20:45 +02:00
Luca Burelli
2d264618bc twister: improve the alignment of columns in verbose output
This commit improves the alignment of columns in the verbose Twister
output by reclaiming extra space in the testsuite name column when the
platform name oveflows its allocated width.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-05-07 03:59:05 +02:00
Luca Burelli
021d90b641 tests: twister_blackbox: fix vendor filter test
Commit 6dc27a4 ("boards: align vendor entry in board.yml files")
unknowingly broke Twister blackbox tests by correctly placing Atom
targets under the 'intel' vendor. Since this was not previously the
case, the Twister blackbox vendor filter test for 'intel' was actually
expecting 'qemu_x86/atom' to be filtered out as "Not a selected vendor
platform."

This commit updates test_filter.py with the new vendor flags.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-05-03 17:49:29 +02:00
Andy Lee
45746c172e scripts: zephyr_module now handles when unable to retrieve git rev
We now return "unknown" as the revision, and only concat onto
the revision if the revision is a valid git has value.

Signed-off-by: Andy Lee <andy@chiefmarley.com>
2025-05-02 10:39:03 +02:00
Duy Nguyen
a87c3acfa9 twister: Add support for new rx arch test
Add "rx" in the arch list of twister

Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2025-05-02 09:18:16 +02:00
Phi Tran
7ac89d33b1 scripts: west: flash: Add support for .mot file format
Add support for .mot file flash using west flash command
The RX build output .mot as binary file to flash into
board

Signed-off-by: Phi Tran <phi.tran.jg@bp.renesas.com>
Signed-off-by: Duy Nguyen <duy.nguyen.xa@renesas.com>
2025-05-02 09:18:16 +02:00
Aksel Skauge Mellbye
73b8d1b637 edtlib: Expose binding title in node class
Make the binding title available from the node the same way
the binding description is propagated.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-05-02 09:15:50 +02:00
Tais Hjortshøj
0709014549 scripts: west_commands: Add powershell autocompletion (west -b)
Windows powershell can by default not autocomplete known boards when
tapping which can cause frustration when you can't quite remember the
exact name or you don't want to type it out.
west build .\path\to\application\ -p -b stm<tab> will search for
available board including 'stm' in their name.

Signed-off-by: Tais Hjortshøj <tbh@mjolner.dk>
2025-05-02 01:16:00 +02:00
Jamie McCrae
51cf4157e6 scripts: dts: gen_defines: Add support for fixed-subpartitions
Adds support for generating defines for this binding type

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-04-30 18:44:06 +02:00
TOKITA Hiroshi
4b563934a6 west: runners: openocd: Add option to start RTT server during debug
Add `--rtt-server` option to start RTT server when the OpenOCD
launched from `debug`, `debugserver`, and `attach` commands.

This option starts the RTT server and opens a port,
but RTT logging must be done externally.
That is, you must connect to port 5555 using `telnet` or `nc`
in another terminal to view the RTT log.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-04-29 20:08:20 -04:00
Jamie McCrae
088c8f4df8 Revert "west: fix for context with sysbuild"
This reverts commit 8972146302.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-04-28 13:41:34 +02:00
Vignesh Pandian
8972146302 west: fix for context with sysbuild
show `west flash --context` with sysbuild

Signed-off-by: Vignesh Pandian <vignesh@aerlync.com>
2025-04-25 15:55:40 +02:00
Jamie McCrae
4876ff4b42 scripts: ci: check_compliance: Add Kconfig to allow list
Adds a Kconfig used in MCUboot to the allow list

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-04-25 14:03:34 +02:00
Sebastian Bøe
fff2fef27c west: runners: nrf_common: Temp hack for NRF54H20_IRON
Temp hack while waiting for NRF54H20_IRON support for Network in
nrfutil.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2025-04-24 20:28:51 +02:00
Ederson de Souza
01d10a4115 twister: Look at SIMICS_PROJECT environment variable to find simics
While cmake/emu/simics.cmake uses SIMICS_PROJECT env var, twister checks
if a build is "runnable" by checking if `simics` is executable, but it
doesn't look at SIMICS_PROJECT env var.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2025-04-24 16:54:00 +02:00
Fin Maaß
e6d6aacf32 ci: set_assignee: don't allways pick next area when submitter = assignee
we don't want to pick the next area when there
are other maintainers available in the same area.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-04-23 17:54:38 +02:00
Chris Friedt
5fb47cd97f scripts: check_compliance: un-ignore diff and patch for CheckPatch
Un-ignore diff and patch files for CheckPatch.

This was originally added to avoid throwing false-positives when diff
and patch files were actually in the repo, since it would incorrectly
try to perform code-formatting checks on those files instead of on
the content of the commit.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-22 13:14:30 -04:00
Chaitanya Tata
b1dfd13cf3 scripts: utils: tls_creds_installer: Improvements
Improve error handling and reporting.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-04-22 09:59:05 +02:00
Chaitanya Tata
7b3d44e403 samples: net: wifi: Add a script to install certs
For enterprise mode we need to install multiple certs to the TLS
credentials store, so, add a helper script in python to make it work
cross-platforms.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-04-18 10:40:39 +02:00
Chaitanya Tata
d1aa75cdd6 scripts: utils: Add a script to install TLS credentials
This helps install certificates to the TLS credentials store using TLS
credentials shell.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-04-18 10:40:39 +02:00
Carles Cufi
999b6a14a4 west: runners: nrf: Add an option to control the ext erase mode
The erase mode for any external memory that is mapped to the address
space of the MCU is derived from the internal non-volatile memory erase
mode. In order to allow users to override the default value, add a new
--ext-erase-mode command-line option that takes an erase mode just like
--erase-mode does.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-04-16 08:07:44 +02:00
Carles Cufi
58e0e31c7e west: runners: nrf: Generalize the erase command
Instead of providing an `--erase-pages` command, generalize it to a new
`--erase-mode` one that can be set to `none`, `ranges`, or `all`. This
gives the user full control over the erase mode that will be passed on
to nrfutil.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-04-16 08:07:44 +02:00
Carles Cufi
01f65f658b west: runners: nrf: Fix typo in nrjfprog runner
The correct string is `ERASE_NONE`.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2025-04-16 08:07:44 +02:00
Jordan Yates
a5ffd7f7a3 scripts: twisterlib: extend testcase schema for reboots
Extend the testcase schema to provide a way to communicate that a given
test is expected to reboot during execution. The generic harness takes
that information and suppresses `already STARTED` warnings if the
restart is expected.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-14 13:05:46 +02:00
Fabrice DJIATSA
cf517f92fc scripts: twister: fix regenerate serial device with unknown platform
Since BOOT-SERIAL isn't a recognized STMicroelectronics product name,
when Twister saves the new map.yaml, it will also check if the previous
map.yaml had the 'SERIAL-BOOT' product name and attach the corresponding
serial device.It won't generate a new one with an unknown platform name.


Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-04-14 11:49:13 +02:00
Chris Friedt
b032304bbe scripts: ci: check_compliance: use git-top to check modules
BoardYml, DeviceTreeBindings, Kconfig, and KconfigBasic checks
can be run with a decentralized west manifest.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-04-11 06:32:31 +02:00