With this commit we add a runner that is capable of flashing
the sensry sy1xx socs via uart to support the onboard OTP
bootloader. Added the sy1xx runner to the list for
automated test.
Signed-off-by: Sven Ginka <s.ginka@sensry.de>
Change OpenOCD version regex to be compatible again with format strings
not having a space or newline immediately after the version nr.
Modified regex has been verified with the strings listed below.
Ubuntu:
"Open On-Chip Debugger 0.11.0"
ADI:
"Open On-Chip Debugger (Analog Devices 0.12.0-1.1.1) OpenOCD 0.12.0 (2024-
08-27-17:25)"
Zephyr SDK:
"Open On-Chip Debugger 0.11.0+dev-00728-gb6f95a16c (2024-02-17-23:51)"
Infineon:
"Open On-Chip Debugger 0.12.0+dev-5.2.1.3248 (2024-08-08-17:29)"
Espressif:
"Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:25)"
Fixes: 1c05f2121c
Signed-off-by: Hakan Jansson <hakan.jansson@infineon.com>
Add a basic RFP runner that supports the `flash` command targettting
the Renesas Standard Boot Firmware.
Signed-off-by: Peter Johanson <peter@peterjohanson.com>
The Nordic nRF54L series ICs use RRAM instead of flash. This implies
that erasing the internal storage before writing the new firmware is not
required anymore (unlike NOR flash, which does).
Note that RRAM on nRF54L devices is not physically paged, and paging is
only artificially provided, with a page size of 4096 bytes, for an easier
transition of nRF52 software to nRF54L devices.
In order to speed up the flashing operation and avoiding doing wasteful
write operations on the RRAM, default to ERASE_NONE for ICs in these
series.
A new ``--erase-pages`` command-line switch has been added to allow
users to keep erasing the pages that will be written to the firmware.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Instead of hardcoding a set of paths and trying to find the JLink
executable in them, use the corresponding Windows registry to locate it:
`HKEY_CURRENT_USER\\Software\\SEGGER\\J-Link`
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The logic to detect the default JLink location was placed at the top of
the script, executing whenever the script was imported. The west
extension command framework loads all runners when initializing, and so
this logic was being executed even when using another runner.
Move the logic to a function that is only executed when the JLink runner
is selected, to avoid executing it at all times.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The ADI fork of OpenOCD prints a modified version line; adjusting the
regex to account for that different format when checking the OpenOCD
version.
Signed-off-by: Pete Johanson <pete.johanson@analog.com>
The following board revision properties can now be used as part
of the format string in the 'west boards -f ...' command.
- board.revisions with format {revisions}
- board.revision_default with format {revision_default}
Signed-off-by: Alex Fabre <alex.fabre@rtone.fr>
MD5 and SHA1 are not supposed to be used nowadays on security context.
Some ancillary scripts in tree do use them, but for verification only -
or where externally mandated, such the SPDX tool.
This patch marks those usages as `usedforsecurity=False`, which helps
clarify intent.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Calling `west build --build-opt="-v" --build-opt="-j=<n>"`
passes the build options to `cmake --build ... -- <build-opt>` which
again is passed to the native build tool, such as ninja or make.
However, when ExternalProjects are used in CMake, such as in TF-M or
sysbuild builds then those extra build options are only passed to the
first image build and not those build as external projects.
CMake supports environment variables for those flags, so translate
verbosity and number of jobs to those environment variables and thereby
support those flags for all images when specified by the user.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
In order to enable the use case where the underlying flash tool supports
bulk-flashing using multiple device IDs, augment the core runner class
with this new runner capability and implement it in the nrfutil runner,
since the nrfutil tool supports it natively.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This is an extension for indexing the source code in the workspace
with GNU Global. See the command line help for more information about
Global.
Signed-off-by: Martí Bolívar <marti.bolivar@oss.qualcomm.com>
Rework of the flashing algorithm broke the STM32N6 dfu flashing.
Add the case of using usb port and download-modifier (new n6 specific
option) as a new case of using the bin file for flashing.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Fix --download-address to expect a signed.bin file when --download-address
is provided.
To allow testing this case despite the checks put in the runner, add a
patch functions which return that zephyr.bin is actually present
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Aim is to avoid 2 issues:
- Requesting --download-address to flash hex files
- Flashing hex files (non signed) on N6 which works but doesn't allow
persistent firmware
Hence this changes binds --download-address with usage of .bin files.
If --download-address was not provided, default to hex flashing.
File existence done with isfile() will ensure the required file
is available before flashing and report an error if this is not the
case.
Note: In specific N6 case, we're verifying zephyr.signed.bin is
available instead of zephyr.bin. This is ensure since self.cfg.bin_file
matches runners_yaml_props_target configuration (set to
zephyr.signed.bin on STM32N6).
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Existing logic is passing elf file as parameter only when fsbl
or bit file parameter is present. This is incorrect, elf file should
be always passed irrespective of other parameters.
Signed-off-by: Mubin Sayyed <mubin.sayyed@amd.com>
To use openocd rtt shell in a non-Windows environment,
you need to turn off ICANON and ECHO.
Refer to pyocd to enable a temporary terminal and configure
it correctly.
Signed-off-by: Findlay Feng <i@fengch.me>
Add a function generate_uuid_registry that calls the gen-uuid-reg.py script
to generate the uuid-registry.h file. If signing an image without sof,
trigger the generation of the uuid-registry.h file.
Instruct the toml file preprocessor to also use the definitions from the
uuid-registry.h file. This will allow the values placed in the
uuid-registry to be used in toml files.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
The nRF54H and the nRF92 series do not support the RESET_SYSTEM reset
kind. Instead one must use RESET_HARD, which this patch now implements.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
After commit aaefaad, flashing of the FLPR and PPR cores in the nRF54H20
was broken due to those cores missing from the _get_core() function that
retrieves the core to program, triggering an exception. Fix it by
referencing those cores and mapping them to the application core.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This acts in a similar way to nrfjprog's --qspiini parameter introduced
in 7eb364b, but works slightly differently in nrfutil: it requires a
config file in JSON format instead of .ini, and it is passed along to
the `execute-batch` command instead of providing it together with the
`program` command.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Both backends supported as runners for nRF ICs, nrfjprog and nrfutil,
support erasing external memory as part of the programming operation.
Before this patch, and when the firmware was detected to be partially or
fully placed in external flash by inspecting the .hex address range, the
runner would instruct the backend tool to fully erase the external
flash (but the nrfjprog runner would ignore that, always erasing only
the sectors required). Instead, correctly default to erasing only the
sectors that are required to program the new firmware image in both tools,
and erase it completely only when the --erase flag is provided by the user.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The Nordic nRF52 series have a peculiarity that is not shared with any
other Nordic families of SoCs: the reset pin can be reconfigured as a
regular GPIO. This has an unintended consequence: if the user has
reconfigured the pin in Devicetree to be a GPIO, `west flash` will
override that and configure the IC to use it as a reset pin, and the
firmware at boot won't be able to switch it back to GPIO, because that
requires a UICR erase. This behavior is very confusing to users, because
the GPIO does not work at all, since it is now just a reset line.
With this patch, `west flash` defaults to using soft reset instead of
pin reset for the nRF52 family of devices, to avoid overwriting the
reset pin configuration that the user includes in the image.
In order to be able to continue to use pin reset for users that so
desire it, a new option `--pinreset` is added that forces the use of pin
reset. The existing `--softreset` option is left exactly as it was, but
it is now applicable only to families other than the nRF52.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Commit dc7d8bb introduced the requirement to provide the erase kind when
executing the corresponding op, but it was forgotten in this particular
spot.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Implement possibility to specify options for --start and --download
arguments.
These options are implemented as lists to better fit STM32CubeProgrammer
programming model.
This options are required to enable the programming of STM32N6 in USB-DFU
mode, which requires "-d my.bin 0x1 -s noack" arguments list.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
If a blob checksum does not match what is recorded in the
associated module.yml file, `west blobs fetch` should
(eventually) fail.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
The `erase` command was being used but there was no "backend"
implementation for it in nrfutil nor nrfjprog. Simplify the syntax and
implement it for both tools.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
These are used to detect if the firmware image contains any values
inside the UICR for additional handling.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This is no longer necessary, because thanks to sysbuild we no longer
invoke a runner with a .hex file that is the result of merging builds
for more than one core.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
In commit 6e9e839195, an indirection via
the new `options` dictionary was missed in the SUIT handling.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add the option to flash a bin file if one is available from the board's
cmake configuration.
Use of elf has prio over this, and bin has prio over hex which remains
the default option.
Also add a parameter to stm32cubeprogrammer runner to specify the download
address.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
The src-module argument can be used to select the module in which west
patch searches for patch definitions. This commit also allows the use of
module names instead of the path.
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
Instead of pre-generating the JSON batch to then execute it, use
command-line arguments and --x-append-batch to generate the JSON file
tht will then be passed to x-execute-batch.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add support for the `--erase` option on `west flash`, for boards that
specify at least one `--cmd-erase` option.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Add a gh-fetch subcommand to the west patch extension to download a patch
file from Github and generate the patch meta data.
The patch info is appended to the patches.yml file.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
JLink refuses new RTT telnet connections for a few moments after a socket
closes. This causes an issue when using `nc` as the telnet viewer, since
JLink would deny the connection. To resolve this, keep the "ping" socket
we use to determine if the RTT viewer is active connected, and use that
socket for RTT communication.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
Add an argument `--esp-encrypt` to flash an ESP32 series chip with
encrypted flash.
The content of the binary is encrypted on the fly by the chip. It is
not required to know the encryption key. However, the fuses that
disable encrypted flash download must be kept enabled for this to work.
Signed-off-by: Martin Jäger <martin@libre.solar>
The Espressif branch of OpenOCD uses the version string "v0.12.0" instead
of "0.12.0" causing the version regex match to fail.
Add an optional 'v' prefix to avoid the failure.
Fixes: #83373
Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
Add runners entry to the module schema and import the file specified.
Every class that inherits from ZephyrBinaryRunner will be discovered and
added to runners list.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Since "JLink.exe" is also an executable distributed with JDK's, do an
explicit search on the standard SEGGER install directories for a JTAG
"JLink.exe" before falling back to whatever is first on PATH.
Fixes#51825.
Signed-off-by: Jordan Yates <jordan@embeint.com>