Skip to main content
Associate
April 2, 2024
Question

Encountered Error when opening STM32_Programmer_CLI.exe

  • April 2, 2024
  • 12 replies
  • 11106 views

Hi! I'm trying to flash a STM32H723ZG with STM32CubeIDE 1.14.0 and ST-LINK V2

and use OSPI peripheral to communicate with the W25Q256 external flash as QSPI

and I have this error:

(I have tried all the suggestions given in the community to solve this problem, but I still haven't got any results.

The only way I could get the result was using STMcubeIDE version 0.4.

Do you have any suggestion to fix this problem in higher versions? Thank you)

 

ST-LINK FW : V2J44S7

Board : --

Voltage : 1.58V

JTAG freq : 9000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID : 0x483

Revision ID : Rev Z

Device name : STM32H72x/STM32H73x

Flash size : 1 MBytes

Device type : MCU

Device CPU : Cortex-M7

BL Version : 0x93

 

 

 

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a03076.srec

File : ST-LINK_GDB_server_a03076.srec

Size : 195.92 KB

Address : 0x08000000

 

 

Erasing memory corresponding to segment 0:

Erasing internal memory sector 0

Erasing memory corresponding to segment 1:

Erasing external memory sectors [0 1]

Download in Progress:

 

 

Error: failed to download Segment[0]

Error: failed to download the File

Encountered Error when opening C:\ST\STM32CubeIDE_1.14.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.100.202311100844\tools\bin\STM32_Programmer_CLI.exe

Error in STM32CubeProgrammer

Shutting down...

Exit.

    12 replies

    Technical Moderator
    April 2, 2024

    Hello @dwJavad ,

    Could you please try with latest release of STM32CubeProgrammer (v2.16.0) and STM32CubeIDE (v1.15.0).

    Then, please keep me informed about your update on this.

    "When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"
    dwJavadAuthor
    Associate
    April 2, 2024

    Thanks for the support.

    I upgraded both software to STM32CubeProgrammer (v2.16.0) and STM32CubeIDE (v1.15.0).

    But the problem has not been solved yet.

     

    ST-LINK FW : V2J44S7

    Board : --

    Voltage : 1.59V

    SWD freq : 4000 KHz

    Connect mode: Under Reset

    Reset mode : Hardware reset

    Device ID : 0x483

    Revision ID : Rev Z

    Device name : STM32H72x/STM32H73x

    Flash size : 1 MBytes

    Start Address : 8000000

    Device type : MCU

    Device CPU : Cortex-M7

    BL Version : 0x93

     

    Memory Programming ...

    Opening and parsing file: ST-LINK_GDB_server_a01356.srec

    File : ST-LINK_GDB_server_a01356.srec

    Size : 192.62 KB

    Address : 0x08000000

     

    Erasing memory corresponding to segment 0:

    Erasing internal memory sector 0

    Erasing memory corresponding to segment 1:

    Erasing external memory sectors [0 1]

    Download in Progress:

     

    Error: failed to download Segment[0]

    Error: failed to download the File

    Encountered Error when opening C:\ST\STM32CubeIDE_1.15.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.200.202311302303\tools\bin\STM32_Programmer_CLI.exe

    Error in STM32CubeProgrammer

    Shutting down...

    Exit.

     

    Technical Moderator
    April 5, 2024

    Hi @dwJavad,

    I escalated this issue internally for analysis via internal ticket number: 178110 (Internal tracking number is not accessible by customers).

    "When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"
    dwJavadAuthor
    Associate
    April 7, 2024

    Thanks for the support.

    Associate III
    April 10, 2024

    Is there any resolution to this? I am having a very similar problem.

    Pavel A.
    Super User
    May 10, 2024

    @Sbag these API_MS_WIN...  DLLs are not real, so it's normal that they do not exist. Please don't copy random DLLs from other machines and various websites (heaven forbid). 

    Get a clean pristine Windows system, ensure that your internet connection is not obstructed by broken corporate or state "security solutions".

     

    dwJavadAuthor
    Associate
    May 11, 2024

    @Imen.D 

    @Sbag 

    I could upload the code by changing the plugin.

    But at the end of the upload process, the previous error is still visible and prevents debugging the program.

    Associate II
    May 11, 2024

     [I could upload the code by changing the plugin.]

    plugin ? pls explain. 

    Associate II
    May 11, 2024

    // these API_MS_WIN...  DLLs are not real // 

    That is something..   Thanks for the info. 

    Associate II
    May 11, 2024

    I use the log file to see what is happening in detail

    This is the output 

    STMicroelectronics ST-LINK GDB server. Version 7.7.0

    Copyright (c) 2024, STMicroelectronics. All rights reserved.

     

    Starting server with the following options:

    Persistent Mode : Disabled

    LogFile Name : C:\Users\user\STM32CubeIDE\workspace_1.15.0\BLINKY\Debug\st-link_gdbserver_log.txt

    Logging Level : 31

    Listen Port Number : 61236

    Status Refresh Delay : 15s

    Verbose Mode : Enabled

    SWD Debug : Enabled

     

    COM frequency = 950 kHz

    Target connection mode: Attach

    Reading ROM table for AP 0 @0xe00fffd0

    Hardware watchpoint supported by the target

    ST-LINK Firmware version : V2J45S7

    Device ID: 0x410

    PC: 0x1

    ST-LINK device status: RUN_MODE

    ST-LINK detects target voltage = 3.28 V

    ST-LINK device status: RUN_MODE

    Stm32Device, pollAndNotify running...

    ST-LINK device initialization OK

    SwvSrv state change: 0 -> 1

    Waiting for debugger connection...

    Waiting for connection on port 61236...

    Waiting for connection on port 61237...

    Accepted connection on port 61236...

    Debugger connected

    Waiting for debugger connection...

    Waiting for connection on port 61236...

    GDB session thread running

    GdbSessionManager, session started: 1

    Try halt...

    ST-LINK device status: HALT_MODE

    Accepted connection on port 61236...

    Debugger connected

    Waiting for debugger connection...

    Waiting for connection on port 61236...

    GDB session thread running

    GdbSessionManager, session started: 2

    Enter STM32_SystemReset() function

    Enter STM32_InitAfterReset() function

    NVIC_DFSR_REG = 0x00000008

    NVIC_CFGFSR_REG = 0x00000000

    Stm32Device, closeDevice() entry

    GDB session, device event: 5

    GDB session, device event: 5

    Stm32Device, pollAndNotify stopped

    Stm32Device, closeDevice() exit

    ------ Switching to STM32CubeProgrammer -----

    Encountered Error when opening C:\Program Files (x86)\STM32CubeIDE_1.15.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.201.202404072231\tools\bin\STM32_Programmer_CLI.exe

    ------ Switching context -----

    Error in STM32CubeProgrammer

    GDB session terminated: Client connection lost

    GdbSessionManager, session terminated: 1

    GDB session terminated: Client connection lost

    GdbSessionManager, session terminated: 2

    GdbSrv, last session terminated, signal dispose

    Stopping port 61236

    Received stop for port 61236, not accepting new connections.

    GdbSrv, deInit entry.

    Shutting down...

    GdbSessionManager, deInit entry.

    GDB session disposed: 2

    GDB session disposed: 1

    GdbSessionManager, deInit exit

    SwvSrv deInit entry

    Stopping port 61237

    Stopping port 61236

    Received stop for port 61237, not accepting new connections.

    SwvSrv deInit exit

    Stm32Device, closeDevice() entry

    Stm32Device, closeDevice() exit

    Stm32Device, deInit success

    GdbSrv, deInit exit.

    Exit.

     

    The funny thing is I can upload the hex file from STM32CubeIDE using Stm32programmer as well as ST_LINK utility. But not STM32CubeIDE.

    So there is no issue with ST-Link V2 (Clone?) or the Bluepill board. So this is definitely the IDE issue.

     

     

    Associate II
    May 11, 2024

    I have had similar problem with latest MPLAB for PIC ics with Pickit3.5 @ $25/- Vs ST-Link V2 @$2/-  

    Lastest version will not connect with pickit. After banging my head for over a week , I had to uninstall clean various folders and registry and install a previous version. With each try it showed signs of life. finally installed 4 versions back. It was nightmare each operation taking almost 2 to 3 hours. Now it is working nicely. These companies deliberately discontinue support of older well tried debuggers for their much costlier new products. There also the pics could be programmed using their old standalone utility 

    I am beginning to think, it is the same issue here too. STM may have silently withdrawn support for these cheap debuggers. Like the other one, I am able to program using standalone st-link utility which seems to be much better with comparison of file and device memory. The advantage of IDE for debugging is lost. May be it will work with an old version of Stm32CudeIDE too. 

    In my case even openCD doesn't work. on CubeIDE. 

     

    Pavel A.
    Super User
    May 11, 2024

    Encountered Error when opening C:\ST\STM32CubeIDE_1.14.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.100.202311100844\tools\bin\STM32_Programmer_CLI.exe

    This error message is misleading. It suggests that STM32_Programmer_CLI.exe is not found or could not run.

    In fact there was a runtime error, caused by external loader(?)

    @STTwo-32 @Imen.D 

    Besides fixing the root cause, suggest to change the message. Instead or "opening" - "executing" or like that.

     

    Explorer
    July 10, 2024

    Any updates on this? We are experiencing what seems like the same issue as above.
    We have tried uninstalling all existing STM software and reinstalled only the newest tools. Updated windows to the newest version as of 2024-07-10 (Windows10, version 10.0.19045, build 19045).
    We are able to program the device using STM32CubeProgrammer but not using the STM_Programmer_cli.exe from CubeIDE.

    Associate II
    August 21, 2024

    @AndersRasmussen 
    I've been stuck for a few days now and despite all my research and attempts, nothing seems to have solved the problem. I've also uninstalled and reinstalled all the ST tools but nothing works. I'm using Windows 11 but I've never had any problems.

    Boris19_1-1724259200195.png

    I can load my program with the .bin from STM32CubeProgrammer but I can't use the debugger from STM32CubeIDE 1.14 and 1.16.

    Boris19_0-1724259131976.png


    I hope that the ST teams find a solution... quickly.

    Associate II
    August 24, 2024

    I've solved the problem. It was a hardware short on the uP's NRST. I was misled by the fact that it worked once.

    Associate II
    September 8, 2024

    Are you using Windows or other OS ? If it is windows, which version. 

    goto that folder and click of that exe. look at the message you get. If my assumption is correct, you should get and api-..........dll error. 

    from command prompt you can provide --help tag . it should ennumerate all the command strings. If it does, it is working and correctly installed. problem is elsewhere. But I am sure sure it will give the same dll error. 

    In my case the said is installed in may folders. But it access only that is installed in system folder. It is cannot be changed due to system level protection. 

     

    Try it and see what you get. 

    I think STM32_Programmer and STM-LINK utility do not use that dll or have proper code to access the existing dll. 

    I have also found some version of the dll is simply dummy but ST_programmer_CLI.exe needs some entrypoint that does not exist. This is problem with the ....CLI.exe that comes with the version of STMCubeIDE - problem to be solved by the software engineers of STM.