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>
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>
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>
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>
Add new '--start-address' argument to the STM32CubeProgrammer west runner.
This argument can be used to specify an address from which the MCU should
start executing, instead of relying on the default value in CubeProgrammer.
Also update STM32CubeProgrammer runner tests to support new argument.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
Add the option to support an external loader for flashing
hex file to internal and external NOR flash using
the STM32CubProgrammer CLI with a board_runner_args
"--extload=MX25LM51245G_STM32U585I-IOT02A.stldr"
The absolute path of the stldr file is added to the
stm32CubeProgrammer command.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
The '%ProgramFiles%' is not guaranteed to be 'C:\Program Files' on
Windows x64.
The value will be 'C:\Program Files (x86)' if the west is executed by
32-bit Python.
To correct the issue '%ProgramW6432%' must be used.
Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
Allows to use the stm32cubeprogrammer runner on Linux to be executed
from any installation directory as long as the executable is found
in PATH.
Until now on Linux the programmer could only be used if it either has
been installed in the default location or if the executable path was
passed via the cli parameter.
Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
The --tool-opt runner option is the recommended practice for allowing
runners to take additional arguments that are passed on to the
underlying tool. It exists because we don't want to add one runner
option for every single tool option that users might want to tweak --
that would be a nightmare.
Enough runners are using this option that it's time to promote it to a
common runner capability with consistent behavior, the same way we did
for the --dev-id option in the past. This removes boilerplate from
individual runner files and ensures consistent argument handling for
this option when it is supported.
Since --tool-opt is a bit long to type, and we've had some complaints
about that, take this as an opportunity to standardize on -O as a
short option equivalent for it.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The RunnerConfig class stores the locations of the Zephyr output files
in various formats (elf, hex, bin). A longstanding issue with the
representation is that these might not exist if the corresponding
Kconfig options are not set. For example, if
CONFIG_BUILD_OUTPUT_BIN=n, there is no .bin file.
Change this so the type system knows these are Optional[str], not str.
Fix the runners that use non-ELF outputs so they check for the
existence of the relevant file before using it, mostly using a new
ZephyrBinaryRunner.ensure_output helper.
I'm not going to bother with checking for the ELF file itself; that's
always there as far as I can tell.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>