Commit graph

5615 commits

Author SHA1 Message Date
Benjamin Cabé
710a7272ba scripts: requirements: update pinned dependencies
Run uv-compile to update to latest minor versions of dependencies.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-06 08:45:13 +02:00
Luca Burelli
ed7f2e0833 scripts: dts: dtlib: preserve order of properties in DTS output
Ensure that the order of properties in the output DTS file matches the
order in which they are defined in the DTS source files by moving props
to the end of the dictionary when they are accessed.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-06-05 15:18:40 -05:00
Luca Burelli
0a4e2e383f scripts: dts: dtlib: improve formatting of long arrays
Split long arrays into multiple lines to improve readability of the
output DTS file. A new line is started when the array data exceeds
80 characters.

Add a few test entries to verify the new behavior.

Note: the F821 linter suppression prevents flagging 'array_start' and
'array_newline' as undefined variables. This is because these variables
are initialized when an opening brace is output, which is necessarily
before any element in a byte or prop array. A sequence of markers not
following this pattern would indicate a bug in the DTS parsing code.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-06-05 15:18:40 -05:00
Anas Nashif
e12457dd6e twister: reports: try to show more build failures in generated summary
Some Build failures are actually cmake issues, so in that case, if
nothing is found as build failure, try to parse for cmake issues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-06-05 15:13:07 -05:00
Pieter De Gendt
c5d1e8e220 scripts: west_commands: patch: Support Python 3.10
The west patch command used hashlib.file_digest which was introduced in
Python 3.11.
Replace with a loop to support Python 3.10 (the current minimum).

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-05 09:34:40 +02:00
Maciej Perkowski
49595c7309 twister: Adjust status for quarantined instances
Skipped status fits quarantined items better than filtered.
Filtered tests are by default removed from reports, which
shouldn't be the case for quarantined tests.
Adjust tests unit and blackbox tests accordingly.

Signed-off-by: Maciej Perkowski <maciej.perkowski@nordicsemi.no>
2025-06-05 09:34:13 +02:00
Maciej Perkowski
50f36f0002 twister: logging: decouple status reporting from logging level
Verbosity >1 should be enough to see filtered tests. Coupling
it with debug logging level makes the output messy.

Signed-off-by: Maciej Perkowski <maciej.perkowski@nordicsemi.no>
2025-06-05 09:34:13 +02:00
Miguel Gazquez
783103ebf6 scripts: west_commands: runners: fix dt-flash handling in some runners
In minichlink and spi_burn, the script checks if dt_flash is True by
checking if the value is "y". But dt_flash is a boolean.
Fix these checks.

Also, when dt-flash is True, spi_burn calculate the address in a
convoluted way, by substrating CONFIG_FLASH_LOAD_OFFSET to
itself.
Simplify this computation.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2025-06-04 10:03:40 +02:00
Miguel Gazquez
8c6a290d4a scripts: west_commands: runners: Fix default value for --dt-flash
The '--dt-flash' parameter accepts a string like "y", "yes", "no", etc,
and is supposed to be converted into a boolean value. This is only the
theory as in practice, the default value is set to 'n' and is never
converted to False afterwards.

Set the default value to False.

Signed-off-by: Miguel Gazquez <miguel.gazquez@bootlin.com>
2025-06-04 10:03:40 +02:00
Pieter De Gendt
88d7715a29 scripts: west_commands: zspdx: writer: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-02 20:22:51 +02:00
Pieter De Gendt
01bfd2600d scripts: west_commands: zspdx: walker: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-02 20:22:51 +02:00
Pieter De Gendt
e365746fd9 scripts: west_commands: zspdx: scanner: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-02 20:22:51 +02:00
Pieter De Gendt
10bd714110 scripts: west_commands: zspdx: sbom: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-02 20:22:51 +02:00
Pieter De Gendt
8360238ae5 scripts: west_commands: zspdx: getincludes: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-02 20:22:51 +02:00
Pieter De Gendt
3ccda0e4fe scripts: west_commands: zspdx: datatypes: Fix UP008
Replace super call with parameters reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-02 20:22:51 +02:00
Pieter De Gendt
6c4decf272 scripts: west_commands: zspdx: cmakefileapijson: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-02 20:22:51 +02:00
Pieter De Gendt
2913bfee6f scripts: west_commands: zspdx: cmakefileapi: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-02 20:22:51 +02:00
Pieter De Gendt
0a0e691750 scripts: west_commands: zspdx: cmakecache: Fix linter issue
Fix redundant open mode.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-06-02 20:22:51 +02:00
Pieter De Gendt
62ea066794 scripts: west_commands: simulate: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-31 06:54:39 -04:00
Pieter De Gendt
b9fb5d79e4 scripts: west_commands: robot: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-31 06:54:39 -04:00
Pieter De Gendt
359a0c2809 scripts: west_commands: flash: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-31 06:54:39 -04:00
Pieter De Gendt
5321c14628 scripts: west_commands: debug: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-31 06:54:39 -04:00
Pieter De Gendt
d9d4daa940 scripts: west_commands: build_helpers: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-31 06:54:39 -04:00
Pieter De Gendt
166fd3e506 scripts: west_commands: build: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-31 06:54:39 -04:00
Anas Nashif
e9451b7294 actions: update python requirements
Lower version of elasticsearch to match the server version we are using.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-05-29 23:25:10 +02:00
Yangbo Lu
600cae64c2 scripts: blobs: add auto-accept option for license click-through
Added auto-accept option for license click-through.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-05-29 10:46:56 +02:00
Fin Maaß
f7153012ef dts: enum_macros: make sure that they are lowercase
DT_ENUM_HAS_VALUE_BY_IDX states, that the value
must be lowercase-and-underscores, this makes sure,
that they can match.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-05-28 17:48:57 +02:00
Benjamin Cabé
804915841a shields: doc: allow to indicate supported hw features
Shield authors can now indicate an optional list of hardware features
that the shield supports, in the form of the same kind of "binding type"
already used for boards.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-05-28 15:33:50 +02:00
Pieter De Gendt
432db03003 scripts: requirements-actions: Update packages
Update packages installed by GH actions.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-28 15:32:33 +02:00
Pieter De Gendt
3c234b4ecb scripts: Update ruff and generate excludes
Update to the latest version of ruff and generate linter and format
exclusions for current python files in tree.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-28 15:32:33 +02:00
Pieter De Gendt
8e2e319925 scripts: west_commands: export: Sorted imports
Sort imports with ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-28 11:13:51 +02:00
Pieter De Gendt
476a8c2c39 scripts: west_commands: completion: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-28 11:13:51 +02:00
Pieter De Gendt
eba120384a scripts: west_commands: blobs: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-28 11:13:51 +02:00
Pieter De Gendt
0c18197325 scripts: west_commands: bindesc: Fix linter issues
Fix issues reported by ruff.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-05-28 11:13:51 +02:00
Noah Pendleton
7f1a639327 west: blobs: fetch exit immediately on HTTP error
If an HTTP error occurs during `west blobs fetch`, the response was written
to a file (even if the response body is empty), and then the checksum
validation fails, which can be somewhat confusing.

Add an immediate error message and exit-with-error-code when the HTTP
request fails.

Tested by modify a blob manifest to have an invalid URL:

```bash
# test with invalid URL
❯ west blobs fetch nrf_wifi
Fetching blob nrf_wifi: .../wifi_fw_bins/default/nrf70.bin
ERROR: HTTP error occurred: 404 Client Error: Not Found for url: ...

# test with networking disabled
❯ west blobs fetch nrf_wifi
Fetching blob nrf_wifi: .../wifi_fw_bins/default/nrf70.bin
ERROR: An error occurred: HTTPSConnectionPool(host='git.... \
  Max retries exceeded with url: \
  .../zzzz/nrf_wifi/bin/zephyr/default/nrf70.bin
...
```

Signed-off-by: Noah Pendleton <noah.pendleton@gmail.com>
2025-05-28 11:09:54 +02:00
Grzegorz Chwierut
632d006260 twister: Convert platform names before printing
Just move a code with workaroud to convert platform names
to the full name with variants.
It fixes an issue, that not every platforms are printed
before running tests.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2025-05-27 17:55:46 +02:00
Camille BAUD
75972e0e21 tests: west_runners: Add bflb_mcu_tool to import test
Adds bflb_mcu_tool to import test

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-05-26 09:19:26 +02:00
Camille BAUD
fb937beb62 scripts: runners: Introduce bflb_mcu_tool runner
Introduces one of the official flash tools for bouffalolab platforms.

Co-authored-by: Gerson Fernando Budke <nandojve@gmail.com>
Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-05-26 09:19:26 +02:00
Benjamin Cabé
df01afa8c6 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-23 17:19:58 +02:00
Benjamin Cabé
3a62b17b85 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-23 17:19:58 +02:00
Benjamin Cabé
66fda826e1 shields: scripts: cmake: use list_shields.py in shields.cmake
The logic to "guess" shield names/dirs was duplicated between
list_shields.py (which is used by e.g. west shields) and shields.cmake.
This commit moves the logic to list_shields.py, and updates
shields.cmake to call the script and process its JSON output.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-05-23 17:19:58 +02:00
Benjamin Cabé
93ced043f5 scripts: shields: handle BOARD_ROOT not containing shields folder
Prevent list_shields.py from crashing if a provided BOARD_ROOT
does not contain a shields folder.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-05-23 17:19:58 +02:00
Jamie McCrae
a9d0a36332 scripts: kconfig: Add dt_nodelabel_int_prop function
Adds a function which can be used to get the integer value of a
devicetree property in Kconfig from a nodelabel

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-05-23 14:04:32 +02:00
Joel Holdsworth
39916042d1 code_relocation: use booleans for string_create_helper arguments
The string_create_helper function has the arguments: load_address_in_flash
and is_copy. These arguments take logical values, but previously the
calling code used 1 and 0 rather than the more idiomatic True and False.

This patch corrects the issue by replacing use of int values with bool
values.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00
Joel Holdsworth
f7332da62e code_relocation: improve code conciseness
This patch makes various simplifications to the code structure which make
it more concise by reducing repetition.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00
Joel Holdsworth
33d9961f56 code_relocation: use named fields in string templates
Previously the script used templates where the fields were identified by
numeric ordinal-identified placeholders. This makes the code hard to read
because it is hard to tell which string corresponds to which placeholder
in the substitution.

This patch corrects the issue by replacing the ordinal placeholders with
named placeholders.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00
Joel Holdsworth
567984c12e code_relocation: fix ruff UP037 warnings
In Python, type annotations can be quoted to avoid forward references.

However, if "from __future__ import annotations" is present, Python will
always evaluate type annotations in a deferred manner, making the quotes
unnecessary.

The ruff python linter produces UP037 warnings to indicate cases where
quoting of type annotations can be removed. This patch corrects the
warnings.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00
Joel Holdsworth
8ee466337e code_relocation: fix ruff UP006 and UP035 warnings
PEP585 enabled collections in the Python standard library (like tuple) to
be used as generic type annotations directly, instead of importing
analogous members from the typing module (like typing.Tuple).

The ruff python linter produces a UP006 warning if the deprecated type
annotations continue to be used.

This patch corrects the issue by correcting the single instance where
PEP585-style type annotations can be used.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00
Joel Holdsworth
6ede0d5bc1 code_relocation: fix ruff SUM401 warning
The ruff python linter produces a SIM401 warning when a dictionary is
accessed using if-statements to check for key presence. In this case, the
dict.get() method could be used instead.

For example:

    value = foo["bar"] if "bar" in foo else 0

...can be replaced with:

    value = foo.get("bar", 0)

This patch corrects the single instance of this issue in the script.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00
Joel Holdsworth
f4c54fcb93 code_relocation: fix ruff SIM102 warning
The ruff python linter produces a SIM102 warning when there are nested if
statements which can be collapsed into a single if statement:

    if foo:
        if bar:
	    ...

...becomes...

    if foo and bar:
        ...

This patch corrects the single instance of this issue in the script.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-05-22 20:57:39 +02:00