2025-01-10 05:56 AM - edited 2025-01-10 05:57 AM
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
Solved! Go to Solution.
2025-01-19 10:25 PM
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
2025-01-14 01:05 AM - edited 2025-01-14 05:15 AM
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
2025-01-14 05:14 AM
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
2025-01-19 10:25 PM
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