Commit graph

786 commits

Author SHA1 Message Date
Chris Friedt
b85e1981c3 west: runners: update the rtt implementation for openocd
Previously, rtt start would always fail because the target
(i.e. firmware) had not been started.

```
Info : rtt: Searching for control block 'SEGGER RTT'
Info : rtt: No control block found
```

When the command is 'rtt', run the binary via gdb before calling
'rtt start'. Firmware calls `SEGGER_RTT_Init()` shortly after
init which allows OpenOCD to find the RTT control block.

Similarly, only start the 'rtt server' after calling
'rtt start' to avoid any potential race conditions
internally within OpenOCD.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-21 11:01:55 +00:00
Chris Friedt
9a8ae21a3c west: runners: openocd: mitigate pylint R0201 warning
Previously, there was a warning that the to_num() method can
(and probably should) be unbound from OpenOcdBinaryRunner.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-21 11:01:55 +00:00
Chris Friedt
c71e339773 west: runners: jlink: print RTT server port
Similar to how print_gdbserver_message() prints GDB server info
when "west debug" is run, print RTT server info when "west rtt"
is run.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-21 11:01:55 +00:00
Chris Friedt
d6f32bb339 cmake: flash: update cmake to support rtt target
Add support for the rtt target so that users can run

`west build -p auto -b <board> -t rtt <app>`

similarly to the way that users can now do so with the debug
target, since the rtt target is supposed to be used in a similar
way.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-21 11:01:55 +00:00
DineshKumar Kalva
eb9eff7018 west: sign: add support for AMD acp_6_0_adsp board.
Add support for signing acp_6_0 SOF with Zephyr images with rimage.

Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
2024-11-19 17:53:11 -05:00
Pieter De Gendt
d37ae60751 scripts: west_commands: zephyr_ext_common: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
76864957fd scripts: west_commands: export: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
14f9164ee1 scripts: west_commands: twister_cmd: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
dd4747ff32 scripts: west_commands: shields: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
f8ec1c8a00 scripts: west_commands: completion: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
a74c9be593 scripts: west_commands: boards: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
d3ecdd9b5b scripts: west_commands: blobs: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Pieter De Gendt
efe3d46531 scripts: west_commands: bindesc: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-11-18 13:18:42 -05:00
Chris Friedt
8ac483fdd4 scripts: west_commands: core: run netcat with check_call()
Netcat (nc) does not handle SIGINT. It silently ignores it.

We cannot use run_client(), given that the pydoc for
run_client() specifically contains "Run a client that
handles SIGINT".

Instead, use check_call(), which correctly handles Ctrl+C.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-11-18 13:17:21 -05:00
Yves Vandervennet
7b29b66bd5 west: linkserver: change the default port number for semihost
LinkServer manages port numbers for gdb and semihost as separate linear
sequences when invoked to debug multi-core applications, e.g the
gdb-server instance for cpu0 will have the default GDB port 3333 and the
next gdb-server instance will be assigned the port 3334. The latter will
conflict with the default port for semihost which is 3334.

This patch changes the default port for semihost to 8888.
Port numbers can be changed when invoking the linkserver runner.

Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
2024-11-16 15:55:34 -05:00
Carles Cufi
9643ca20e9 nordic: Remove the nRF54H20 Engineering B
The production version of the nRF54H20 SoC is now available, so remove
the initial Engineering B (EngB) preview version.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-11-16 15:09:14 -05:00
Grzegorz Swiderski
8fc161f820 west: runners: nrf: Check for missing UICR
On nRF54H and nRF92, booting certain cores requires programming a UICR,
which is normally generated using nrf-regtool. This should be considered
an optional dependency, because we do not wish to force non-Nordic users
to install it just to work with Zephyr, or just for build-only tests.

When nrf-regtool is not installed, a CMake warning will be displayed,
but people ignore warnings all the time. As the last line of defense,
check for missing UICR in the nrfutil flash runner, to prevent our users
from unintentionally programming unbootable firmware. Show a fatal error
specifically if CONFIG_NRF_REGTOOL_GENERATE_UICR=y, yet no UICR exists.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-11-06 16:39:09 -06:00
Luca Burelli
ba58b066d4 west build: fix a leftover "log" reference in build.py
A recent commit changed all references to the global 'west.log' instance
(now deprecated) to the new WestCommand logging API, but another PR
merged in the same period added an extra instance that is now causing CI
to fail. Convert this last reference to the new API.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-06 10:07:13 -08:00
Luca Burelli
6c2bc2ff37 west build: warn about conditional flags in 'extra_configs'
The 'west build' command does not know about conditional flags (in the
format 'type:value:CONFIG_FOO=bar') in the 'extra_configs' argument of
Twister testcase.yaml files, and currently converts them to malformed
arguments that are silently ignored by cmake.

This change adds a check to 'west build' to clearly warn the user if the
'extra_configs' list contains conditional flags and provide a hint on
how to add them to the CMake command line.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-11-06 10:07:13 -08:00
Lukasz Mrugala
4bb945300b scripts: twister: Python Version Guard
Twister shall now verify that the user does not
use an obsolete Python version. If user's Python
is deemed too old, it will raise a relevant error.
This check will also happen when running Twister
via west.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-11-04 17:24:24 -05:00
Reto Schneider
743761d7d1 scripts: Fix CMake spelling
As per its creators, CMake is written with a capital "M".

The initial reason for this change is that I want Twister to print
"ERROR : CMake build failure" instead of "ERROR : Cmake build failure".

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2024-10-30 16:32:24 -05:00
Grzegorz Swiderski
276c1fc4a0 scripts: Undo Board.{dir -> directories[0]} renames
`Board.dir` can be used in place of `Board.directories[0]` for brevity.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2024-10-26 17:14:06 +02:00
Jamie McCrae
a04dfc4ece scripts: west_commands: run: Add priority to run once config
Adds an optional priority parameter to the flash runner run once
configuration which allows for deciding upon which file should
ultimately be used

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-26 17:14:06 +02:00
Torsten Rasmussen
536d34fa7a cmake: scripts: support board extension
Fixes: #69548

Support extending an existing board with new board variants.

This commit introduces the following changes to allow a board to be
extended out-of-tree.

The board yaml schema is extended to support an extend field which
will be used to identify the board to be extended.

A board 'plank' can be extended like this:
> board:
>   extend: plank
>   variants:
>     - name: ext
>       qualifier: soc1

For the rest of the build system this means that there is no longer a
single board directory.
The existing CMake variable BOARD_DIR is kept and reference the
directory which defines the board.
A new CMake variable BOARD_DIRECTORIES provides a list of all
directories which defines board targets for the board.
This means the directory which defines the board as well as all
directories that extends the board.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-26 17:14:06 +02:00
Pieter De Gendt
c2b6bcc660 scripts: west_commands: build: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-10-26 11:30:59 +02:00
Pieter De Gendt
8b0edb2b22 scripts: west_commands: sign: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-10-26 11:30:49 +02:00
Pieter De Gendt
46cc7a054d scripts: west_commands: spdx: Remove deprecated west.log
The global state west.log is deprecated, replace with WestCommand
logging.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-10-26 11:30:29 +02:00
Carles Cufi
0705a6301c west: runners: nrf: Add support for the suit manifest starter
With the recent introduction of the SUIT manifest starter binary blob,
it is now possible to use it with the nRF54H20 during the flashing
procedure in order to provide a valid SUIT manifest to the system.

This PR introduces the code that handles programming the SUIT manifest
starter, as well as a new --suit-manifest-starter command-line option.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2024-10-25 22:43:19 +01:00
Pieter De Gendt
1759967597 scripts: west_commands: runners: Fix jlink is_ip
Commit f987e8c6f0a49b04a1184b1a36612612482e3d24 introduced a regression
where the is_ip check fails if no --id is passed as an argument.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-10-24 14:04:44 +02:00
Michael Arnold
3b6555a992 runners: jlink: Make port selectable for J-Link IP
If multiple J-Links with IP support are used,
they can be selected with different ports.
The actual implementation is just using the default port.
Make the port selectable with <ip>:<port>.

Signed-off-by: Michael Arnold <marnold@baumer.com>
2024-10-23 15:34:25 -05:00
Appana Durga Kedareswara rao
99a998a161 scripts: west_commands: tests: add pytest for xsdb runner
Add pytest case for xsdb runner.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2024-10-23 11:34:24 +02:00
Appana Durga Kedareswara rao
1708837e7b runners: add support for xsdb (Xilinx System Debugger)
Add support for xsdb(Xilinx System Debugger) used with AMD's FPGA
and SOC platforms, it is a user-friendly, interactive, and scriptable
command line interface, by design choice it's expected that platforms
to have xsdb scripts present inside their platform code.

xsdb runner has bitstream and fsbl optional arguments, bitstream is
needed for fpga targets and fsbl is needed for SOC targets, added
support for both options.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2024-10-23 11:34:24 +02:00
Pieter De Gendt
73d04a4959 scripts: west_commands: tests: Keep runners list sorted
Sort list and add CI tags.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-10-21 18:36:10 -05:00
Pieter De Gendt
c22323fd51 scripts: west_commands: Keep runners list sorted
Sort the list and add check tags for CI.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-10-21 18:36:10 -05:00
Phi Bang Nguyen
829c03bcdc runners: jlink: Fix NoneType object error
The commit 221199e15b presents a bug that
makes west flash failed with error.

AttributeError: 'NoneType' object has no attribute 'startswith'

In function is_tunnel(), tunnel may contain None and has no attribute
"startswith". Fix it.

Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
2024-10-16 20:53:31 +01:00
Adam Dunkels
221199e15b runners: jlink: add support for J-Link tunnels
This adds support for J-Link tunnels, which run on top of an IP network
and therefore uses the -IP option. J-Link tunnels are identified by a
tunnel: prefix instead of a bare IP address. This change checks for the
presence of such a prefix, and choses the -IP transport option if the
tunnel prefix is found.

This has been tested with J-Link Remote Server v7.98g and the SEGGER
tunnel option.

Signed-off-by: Adam Dunkels <adam@dunkels.com>
2024-10-15 04:10:18 -04:00
Marc Herbert
8b859cea2d west: promote config_get*() functions from sign.py to the base class
These two functions have stood the test of the time and they have
absolutely nothing specific to sign.py

This has the benefit of transitioning away from west's global and
deprecated logging interface
(https://github.com/zephyrproject-rtos/west/issues/149) and this
deprecation is what prompted this commit: see #79240.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-10-15 04:06:42 -04:00
Yonatan Schachter
5da7ba55aa west: bindesc: Added get_offset command
Add `west bindesc get_offset` command to print the offset of
the descriptors inside the given image.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2024-10-11 13:20:49 -04:00
Moritz Geier
da87952948 west: runners: stm32cubeprogrammer: Fixed behaivor if programmer is in path
Enabled west commands to use CubeProgrammer installed in custom directory.

Signed-off-by: Moritz Geier <moritz.geier@proton.me>
2024-10-11 13:20:29 -04:00
Jordan Yates
97db13dc09 scripts: west_commands: runners: propagate arguments
Provide a mechanism to propagate useful arguments from one runner to the
next. The primary use case for this is to propagate a JLink serial
number, so that if it is queried from the terminal the user only needs
to make the choice once.

Implements #76077.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-10-10 20:24:35 -04:00
Benjamin Cabé
acbda31707 west: boards: add full_name support in format string
The recently introduced board.full_name property can now be used as part
of the format string in the `west boards -f ...` command.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-10-10 10:06:31 +02:00
Jamie McCrae
dd7ce12d68 scripts: west_commands: sign: Deprecate imgtool signing
Deprecates signing for imgtool using west sign

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-08 17:00:46 +02:00
Torsten Rasmussen
24ee391231 west: support build info file for west build
For pristine builds 'west build' will now create a build_info.yml file
containing the west build command including arguments.

This is done to help users and external tools to recreate builds.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-08 17:00:30 +02:00
Gerard Marull-Paretas
091e38b3f2 scripts: west_commands: runners: nrf: add support for nRF54H20 EngB
Make sure cpuapp/cpurad cores are detected correctly when using nRF54H20
EngB.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-10-07 18:42:14 +02:00
Laurentiu Mihalcea
155f3f3ba6 west_commands: sign: add imx95 to target list
Add imx95 to target list to allow signing images for
imx95.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-02 13:46:06 -05:00
Helmut Lord
aac15846fa west_commands: build: add extra file arguments
Adds an argument to include additional .conf or .overlay files

Example use:

```
west build -b nrf52840dk/nrf52840 -p --extra-conf foo.conf
```

```
west build -b nrf52840dk/nrf52840 -p --extra-dtc-overlay foo.overlay
```

Or:

```
west build -b nrf52840dk/nrf52840 -p --extra-conf foo.conf
--extra-conf bar.conf
```

```
west build -b nrf52840dk/nrf52840 -p --extra-dtc-overlay foo.overlay
--extra-dtc-overlay bar.overlay
```

Signed-off-by: Helmut Lord <kellyhlord@gmail.com>
2024-09-30 16:55:26 -05:00
Peter van der Perk
dd15aff5fe west: linkserver: Fix version detect for ihex support
version detect never occured correctly and always yielded true

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2024-09-26 03:34:53 -04:00
Henrik Brix Andersen
16b39e8a03 scripts: west: commands: completion: add twister --log-level completion
Add bash tab-completion for for the newly introduced "west twister
--log-level" arguments.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-09-24 14:27:03 -05:00
Fabian Blatz
11c83c80fc west: commands: runners: canopen: add download-buffer-size option
Adds a --download-buffer-size option to the canopen runner to allow
specifying the buffer size of the SDO download.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-09-23 13:21:52 -05:00
Guennadi Liakhovetski
dc5f1bfb3f west: fix for Python prior to 3.10
"type | None" syntax is only available with Python from version 3.10,
fix building with earlier 3.x Python versions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-12 14:51:03 +02:00