cancel
Showing results for 
Search instead for 
Did you mean: 

ST-LINK utility command line interface - types of reset

JJRR
Senior

Hi,

I am using ST-LINK_CLI for flashing mcu via ST-Link ->SWD. In ST-Link utility can be set Reset mode (SW,HW,Core). How can I set this parameter in ST-Link_CLI ? I did not find anything in documentation.

Or is there any better tool to control STLink via command line? Actually I use it to control it from python...

Thank you, Jan.

1 ACCEPTED SOLUTION

Accepted Solutions

Programmer_CLI resolved all my problems. Do not why, but with STUtiity (Link_CLI) the connection was not reliable.

View solution in original post

6 REPLIES 6
Michael E
ST Employee

Hello @Community member​ ,

When you launch ST-Link_CLI the help is displayed.

You can set the port and the reset mode by command line.

There is 2 or 3 examples available.

The syntax is:

-c [ID=<id>/SN=<sn>] [JTAG/SWD SWCLK=<f>] [UR/HOTPLUG] [LPM] [RM=Hrst/Srst/Crst]

Regards

Michael

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

JJRR
Senior

Thanks! It looks like what I was looking for. "Srst" param is probably what I have to use whe connecting to device..

  1. Link_CLI is obsolete learn Programmer_CLI
  2. For connection isnt Srst , but -c SWD UR
JJRR
Senior

So I replaced Link_CLI by Programmer_CLI. Unfortunatelly sometimes (probably when some connections errors occurs) the commands do not answer - it stays stuck. e.g. whe everything works fine the command "STM32_Programmer_CLI.exe -l" takes few ms, but when it stucks it can take several seconds.

Is that normal? Is there any easy workaround or it is upt o my python program to handle these stucks?

Thanks!

I solved it by killing the subproces when it takes more then my timeout value

Programmer_CLI resolved all my problems. Do not why, but with STUtiity (Link_CLI) the connection was not reliable.