Commit fb4bb5d7 authored by Erwan Gouriou's avatar Erwan Gouriou Committed by Fabio Baltieri
Browse files

scripts: west: runners: stm32cubeprogrammer: Fix stm32n6 dfu flashing

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: default avatarErwan Gouriou <erwan.gouriou@st.com>
parent b0d2bc98
Loading
Loading
Loading
Loading
+6 −2
Changes for scripts/west_commands/runners/stm32cubeprogrammer.py: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -273,8 +273,12 @@ class STM32CubeProgrammerBinaryRunner(ZephyrBinaryRunner):
        if self._use_elf:
            # Use elf file if instructed to do so.
            dl_file = self.cfg.elf_file
        elif self.cfg.bin_file is not None and self._download_address is not None:
            # Use bin file if a binary is available and --download-address provided
        elif (self.cfg.bin_file is not None and
               (self._download_address is not None or
                  (str(self._port).startswith("usb") and self._download_modifiers is not None))):
            # Use bin file if a binary is available and
            # --download-address provided
            # or flashing by dfu (port=usb and download-modifier used)
            dl_file = self.cfg.bin_file
        elif self.cfg.hex_file is not None:
            # Neither --use-elf nor --download-address are present: