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