cancel
Showing results for 
Search instead for 
Did you mean: 

Can't connect to ST-Link with CLI

vs_rzb
Associate II

Hi there,

I have an ST-Link V2 which i want to use for programming a .bin file to an stm32G0 MCU. Afterwards i want to set the RTC register to the time beeing. It already works "manually" but i wanted to write a script to automate the process.

I already managed to script an automated RTC register setup, but the script needs the ST-Link to run with the libusb driver.

Now i wanted to automate the .bin file programming with the CubeProgrammer CLI, but i can't connect to the St-link when using the libusb driver. To make things more confusing, i can still connect with the CubeProgrammer GUI when setting the option shared to enabled

After some reading of the docs i also managed to get the probe listed on the CLI when using 

 

 

-l stlink-shared

 

 

It gives the following output:

 

 

      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.18.0
      -------------------------------------------------------------------

===== STLink Interface =====

-------- Connected ST-LINK Probes List --------

ST-Link Probe 0 :
   ST-LINK SN  : 38FF6E06304E4B3020422343
   ST-LINK FW  : V2J45S7
   Access Port Number  : 1
   Board Name  :
-----------------------------------------------

 

 

 

But when trying to pass the -c command i always get Error: No debug probe detected.

As options for this command i think i tried like every possible combination but with no success.

 

Has anyone an Idea, how to solve my mystery? 

 

Regards,

vs

1 ACCEPTED SOLUTION

Accepted Solutions
vs_rzb
Associate II

Thanks for your repies,

sadly nothing of your suggestions worked. Nevertheless i found a workaround for my problem. I'm now using the standard driver again which works fine for connecting and flashing with the CLI.

For the RTC initiation i traced back a variable from my source code to the generated bin file. In this way i can automately manipulate the section of the file right before flashing.

Regards,

vs

 

View solution in original post

3 REPLIES 3
Imen.D
ST Employee

Hello @vs_rzb ,

I can't reproduce the problem from my side.

Try upgrading the ST-Link firmware version.

Run the STM32CubeProgrammer CLI with verbose mode enabled to get more detailed error messages. This can help identify the root cause of the issue. For example: STM32_Programmer_CLI -c port=SWD -vb 3

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Aziz BRIGUI
ST Employee

Hello @vs_rzb

Please make sure you enable the shared option in CLI also, an example command to connect in shared mode via CLI is:

>STM32_Programmer_CLI -c port=SWD shared

Aziz


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
vs_rzb
Associate II

Thanks for your repies,

sadly nothing of your suggestions worked. Nevertheless i found a workaround for my problem. I'm now using the standard driver again which works fine for connecting and flashing with the CLI.

For the RTC initiation i traced back a variable from my source code to the generated bin file. In this way i can automately manipulate the section of the file right before flashing.

Regards,

vs