Skip to main content
Visitor II
November 8, 2019
Question

ST-Link_CLI.exe get Device ID

  • November 8, 2019
  • 1 reply
  • 4182 views

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

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    November 8, 2019

    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

    New.FishAuthor
    Visitor II
    November 11, 2019

    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 ?

    Graduate II
    November 11, 2019

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