cancel
Showing results for 
Search instead for 
Did you mean: 

ST-Link_CLI.exe get Device ID

New.Fish
Associate III

I'm writing some code for our product flash programming via ST-Link_CLI.exe, because there are two kinds of STM32 MCU in one boards, one is STM32F417 another is STM32F09, two ST-Link connected to one PC via USB port. I would like to send command to get device ID to check it is connected the right USB port.

From the document "UM0892 STM32 ST-LINK utility software description", I can't find the command to get device ID, I believe there is one, what is the command?

Regards

Sam

6 REPLIES 6
Mike_ST
ST Employee

Please type: ST-LINK_CLI.exe -c SWD UR

STM32 ST-LINK CLI v3.5.0.0

STM32 ST-LINK Command Line Interface

ST-LINK SN: 0672FF393132534E43033457

ST-LINK Firmware version: V2J34M25

Connected via SWD.

SWD Frequency = 4000K.

Target voltage = 3.3 V

Connection mode: Connect Under Reset

Reset mode: Hardware reset

Device ID: 0x4yy :backhand_index_pointing_left:

Device flash Size: 512 Kbytes

Device family: STM32xxx

Hello Mike,

This works, but I get another problem, when I program the target MCU using: "  -c SWD UR -P" + MyFileName + " -Q -V",

it will looking for elf file, the message is as below:

Loading file...

Flash Programming:

 File : C:\Projects\Development\Commercial\Lego3_Tester\Labview\Lego3_SCM_24Heaters_V007.hex

 Address : 0x08000000

Memory programming...

The elf loader file is not accessible.

My questions is: the .elf only related to each MCU or related to my TrueStudio project?

If related MCU, how to get it from ST website?

If related to my TrueStudio project, where is it in my project file ?

Consider how you are executing/spawning the application. It is not stand-alone, is has sub directories with loaders it needs to find.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks.

I find those files in this directory: C:\Program Files (x86)\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\FlashLoader

Hi Mike,

We try to build tester by using Raspberry Pi, is there Linux version of ST-LINK_CLI.exe ?

Regards

Sam

Hello Sam,

There is no Linux version of ST-LINK CLI.

Please try STM32CubeProgrammer.