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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Remove `nios2` from list of available runners as it's just been dropped
with commit 5fe84d5b69
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
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>
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>
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>
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>
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>
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>
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>
use public queue methods to clear queue on failure
-s Felix Behnke felixbeiderarbeit@gmail.com
Signed-off-by: Felix Behnke <felixbeiderarbeit@gmail.com>
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>
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>
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>