Skip to main content
Explorer II
August 30, 2022
Solved

ST-LINK utility command line interface - types of reset

  • August 30, 2022
  • 3 replies
  • 5536 views

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.

    This topic has been closed for replies.
    Best answer by JJRR

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

    3 replies

    Technical Moderator
    August 30, 2022

    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

    JJRRAuthor
    Explorer II
    August 30, 2022

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

    Graduate II
    August 30, 2022
    1. Link_CLI is obsolete learn Programmer_CLI
    2. For connection isnt Srst , but -c SWD UR
    JJRRAuthorAnswer
    Explorer II
    September 2, 2022

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

    JJRRAuthor
    Explorer II
    September 1, 2022

    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!

    JJRRAuthor
    Explorer II
    September 2, 2022

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