Commit graph

5615 commits

Author SHA1 Message Date
Joel Holdsworth
3db20541de code_relocation: fix ruff I001 warning
The ruff python linter produces a I001 warning when the imports of a Python
script are not sorted. This patch corrects the issue by sorting them.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00
Joel Holdsworth
8a8b42be8c code_relocation: combine typing imports onto a single line
The script can be made more concise by combining the imports of three
classes from the typing module into a single line.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00
Joel Holdsworth
4f0b402224 code_relocation: fix ruff B028 warnings
The ruff python linter produces a B028 warning when the warnings.warn()
function is called with a stacklevel parameter.

By default the function will set a stacklevel of 1 which causes it to
output the stack frame of the line where the function is called without
any context information from higher up the stack.

It is recommended to use a stacklevel of 2 or higher. Therfore, this patch
sets the stacklevel parameter of all warnings.warn() calls to to 2.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00
Joel Holdsworth
66e35624af code_relocation: applied ruff code formatting to gen_relocate_app
Ruff is the Zephyr projects supported Python formatting tool. This patch
applies auto-formatting gen_relocate_app.py in preparation for coming
tidy-ups and improvements.

With the Ruff auto-formatter applied, error E501 can be removed from
.ruff-excludes.toml exclusion rules.

gen_relocate_app.py has also been removed from the format exclude list.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00
Grzegorz Swiderski
468db18389 cmake: modules: Add zephyr_dt_import
Extract the part of `dts.cmake` that invokes `gen_dts_cmake.py`, then
generalize it into a CMake extension, which can be reused by sysbuild.

The Python script itself is also updated, so that the generated CMake
file can accept an input variable DEVICETREE_TARGET, which comes from
the `zephyr_dt_import(TARGET ...)` argument.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-05-22 13:44:18 +02:00
Yangbo Lu
d91b8b4070 scripts: blobs: add click-through property
Added a click-through property. Some downloading may need to
accept license to continue.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-05-21 12:34:59 +02:00
Benjamin Cabé
0c82c3516f Revert "cmake: shields: introduce shield.yml"
This reverts commit 9d5b19710b.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-05-21 09:30:30 +02:00
Benjamin Cabé
0ed2ca7ced Revert "scripts: west: commands: make use of shield.yml in west shields command"
This reverts commit 9dd10af28b.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-05-21 09:30:30 +02:00
Benjamin Cabé
9dd10af28b scripts: west: commands: make use of shield.yml in west shields command
This change introduces the use of shield.yml in the `west shields`
command so that when using the `-f` option one can output the shields'
full name and vendor information.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-05-20 15:23:34 +02:00
Benjamin Cabé
9d5b19710b cmake: shields: introduce shield.yml
While legacy shields are still supported, this introduces a shield.yml
file similar to board.yml that allows to more explicitly declare a
shield and to set some useful metadata such as vendor and full name.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-05-20 15:23:34 +02:00
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