Skip to main content
PS.7
Associate
July 20, 2021
Question

Can someone share the commands (CLI) to establish connection once (-c) and do all flash steps, finally disconnect

  • July 20, 2021
  • 2 replies
  • 636 views

We are trying to execute the following steps,

"C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI" -c port=SWD --erase all

"C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI" -c port=SWD -w "C:/Users/Public/Documents/p2_hi_primary_bl.hex"

"C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI" -c port=SWD -w "C:/Users/Public/Documents/p2_hi_secondary_bl.hex"

"C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI" -c port=SWD -w "C:/Users/Public/Documents/p2_hi_fct.hex"

"C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI" -c port=SWD -rst

We are getting error when we run each command. can we run connect only once, then proceed flash steps, and after flashing disconnect?

This topic has been closed for replies.

2 replies

TDK
Super User
July 20, 2021

You should be able to chain commands. What error are you getting?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Mike_ST
Technical Moderator
July 20, 2021

At least you should be able to merge the 2 first and the 2 last commands :

C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI -c port=SWD mode=normal -e all -d "C:/Users/Public/Documents/p2_hi_primary_bl.hex"

C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI -c port=SWD mode=normal -d "C:/Users/Public/Documents/p2_hi_secondary_bl.hex"

C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI -c port=SWD mode=normal -d "C:/Users/Public/Documents/p2_hi_fct.hex" -rst

I have never tried to download several hex on the same line.