Skip to main content
Associate
August 5, 2024
Solved

STM32CubeProgrammer issue with West flash command

  • August 5, 2024
  • 3 replies
  • 2673 views

It's the first time I encounter this issue so I'm not familiar with it. It happens with the command "west flash". The problem started after upgrading Zephyr to v3.6.0. Prior to that it was working. Any hints are appreciated!

usage: stm32cubeprogrammer [-h] [-d DIR] [-r RUNNER] [--skip-rebuild] [--domain DOMAIN] [-H] [--board-dir DIR] [--gdb GDB] [--openocd OPENOCD] [--openocd-search DIR]
 [--elf-file FILE] [--hex-file FILE] [--bin-file FILE] [--erase] [-O TOOL_OPT] --port PORT [--frequency FREQUENCY] [--reset-mode {sw,hw,core}]
 [--conn-modifiers CONN_MODIFIERS] [--cli CLI] [--use-elf]
stm32cubeprogrammer: error: argument --reset/--no-reset: ignored explicit argument 'hw'

xavierpachecoeaton_0-1722863370555.png

 

Best answer by Sarra.S

Hello @xavierpacheco-eaton

Verify if CubeProgrammer is added in the boards\st\xxxxxx\board.cmake after upgrade. If not, add 

board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)

 

3 replies

Sarra.SBest answer
ST Employee
August 6, 2024

Hello @xavierpacheco-eaton

Verify if CubeProgrammer is added in the boards\st\xxxxxx\board.cmake after upgrade. If not, add 

board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)

 

ST Employee
August 6, 2024

Hi All,

 

This post has been escalated to the ST Online Support Team for additional assistance. We'll contact you directly.

 

Regards,

Jake

ST Support

Associate
August 6, 2024

The issue has been resolved. As @Sarra.S pointed out, I needed to update the following line and replace --reset with --reset-mode. 

board_runner_args(stm32cubeprogrammer "--port=swd" "--reset-mode=hw")

Thank you!