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>
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>
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>
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>
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>
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>
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>
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>
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>
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>