Skip to main content
Associate III
Aug 27, 2024 2:29 PM UTC
Solved

ST-Link/V2 CLI asking user to press return

This might have already been asked in the past, is there a way to not having to press return after programming a file with (old) ST-LINK CLI Utility?

I am using the command line version which works fine but before the program runs ST-LINK stop and waits for the user to press return, then the program runs and ST-LINK terminates.

If you run this from a third party application the required CR is annoying.

Here is what happens, you run the programmer:

 

 

H:\STM32\node>ST-Link_CLI -c SWD UR Hrst -p node.hex -run
STM32 ST-LINK CLI v3.6.0.0
STM32 ST-LINK Command Line Interface

ST-LINK SN: 5200371004300132594E514E
ST-LINK Firmware version: V2J45S7
Connected via SWD.
SWD Frequency = 4000K.
Target voltage = 3.3 V
Connection mode: Connect Under Reset
Reset mode: Hardware reset
Device ID: 0x450
Device flash Size: 2048 Kbytes
Device family: STM32H7xx

Loading file...
Flash Programming:
 File : H:/STM32/build/Debug/node.hex
 Address : 0x08000000
Memory programming...
█████████████████████████████████████████████████▒ 99%
Ram programming...
██████████████████████████████████████████████████ 100%
Memory programmed in 1s and 609ms.
Programming Complete.

run application to exit

 

 

The program now wait, when the user presses return the program continues and terminate:

 

 

Application started.

H:\STM32\node>

 

 

I found no option under the help menu to just run without me having to press return.

Note that I cannot use the STM32_Programmer_CLI programmer as it does not work with a cloned ST-Link/V2 programmer which I bought (unknowingly),

Thanks,
Hans.

 

 

This topic has been closed for replies.
TDK
TDKBest answer
Aug 27, 2024 9:40 PM UTC

Use echo to pipe an enter to the command:

H:\STM32\node>echo | ST-Link_CLI -c SWD UR Hrst -p node.hex -run

 

 Depending on how you're running this from the third party application, might need some configuring, but it will work on a straight command line.

"If you feel a post has answered your question, please click ""Accept as Solution""."

4 replies

Andrew Neil
Super User
Aug 27, 2024 2:54 PM UTC

@hans86 wrote:

I cannot use the STM32_Programmer_CLI programmer as it does not work with a cloned ST-Link/V2 programmer which I bought (unknowingly)


A genuine ST-Link/V2 is only about £20.

Or break one off a cheap (under £9) Nucleo board ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
hans86Author
Associate III
Aug 27, 2024 4:10 PM UTC

Hi Andrew,

Thanks for replying, yes you are of course correct, however, money is not the issue. I just wondered if there is some old... I mean experienced ST user who fixed this issue which is quicker than me ordering another board or programmer,

Regards,
Hans.

TDK
TDKBest answer
Aug 27, 2024 9:40 PM UTC

Use echo to pipe an enter to the command:

H:\STM32\node>echo | ST-Link_CLI -c SWD UR Hrst -p node.hex -run

 

 Depending on how you're running this from the third party application, might need some configuring, but it will work on a straight command line.

"If you feel a post has answered your question, please click ""Accept as Solution""."
hans86Author
Associate III
Aug 28, 2024 7:51 AM UTC

Hi TDK,

Great solution!

Thanks,
Hans