Skip to content

Commit fb4bb5d

Browse files
erwangofabiobaltieri
authored andcommitted
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: Erwan Gouriou <erwan.gouriou@st.com>
1 parent b0d2bc9 commit fb4bb5d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/west_commands/runners/stm32cubeprogrammer.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,12 @@ def flash(self, **kwargs) -> None:
273273
if self._use_elf:
274274
# Use elf file if instructed to do so.
275275
dl_file = self.cfg.elf_file
276-
elif self.cfg.bin_file is not None and self._download_address is not None:
277-
# Use bin file if a binary is available and --download-address provided
276+
elif (self.cfg.bin_file is not None and
277+
(self._download_address is not None or
278+
(str(self._port).startswith("usb") and self._download_modifiers is not None))):
279+
# Use bin file if a binary is available and
280+
# --download-address provided
281+
# or flashing by dfu (port=usb and download-modifier used)
278282
dl_file = self.cfg.bin_file
279283
elif self.cfg.hex_file is not None:
280284
# Neither --use-elf nor --download-address are present:

0 commit comments

Comments
 (0)