STLink V2 with STM32 Boards? solved: use STM32CubeProgrammer (SWD)

Hi all,

I am used to use STLink V2 with the STM32 package from Roger Clark.

Now the official STM32 package from ST Microelectronics supports all processors I use.
So I would like to use this package with STLink V2.

But I didn't find out how, and don't know what upload method to select.

Maybe a dumb question, but I need help to spare me some time searching. Thank you.

Jean-Marc

For example, in order to upload a program to the boards: F103VE or F103CB, using STlink V2 in the official core, you must select: STM32CubeProgrammer (SWD)

@TFTLCDCyg,

Thank you for your help!

In fact, this was also my first guess, and what I tried first. But I was not sure about the error I got.
Now I will take a closer look and download or install the missing part:

Arduino: 1.8.12 (Windows 10), Board: "Generic STM32F1 series, Generic F103VE, STM32CubeProgrammer (SWD), Enabled (generic 'Serial'), None, Low/Full Speed, Smallest (-Os default), Newlib Nano (default)"

WARNING: library GxEPD_HD-master claims to run on STM32, STM32F1, esp32, esp8266 architecture(s) and may be incompatible with your current board which runs on stm32 architecture(s).
…
Sketch uses 509612 bytes (97%) of program storage space. Maximum is 524288 bytes.
Global variables use 50708 bytes (77%) of dynamic memory, leaving 14828 bytes for local variables. Maximum is 65536 bytes.
Low memory available, stability problems may occur.
STM32_Programmer_CLI.exe not found.
Please install it or add <STM32CubeProgrammer path>\bin' to your PATH environment:
https://www.st.com/en/development-tools/stm32cubeprog.html
Aborting!
An error occurred while uploading the sketch

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Jean-Marc

That mistake ... quite a headache!

If you have a previous installation of the official STM32 core, remove it manually. The path where you can find it in windows is:

C:\Users\User\AppData\Local\Arduino15\packages

Delete the STM32 folder.

Then install using json, the latest version of the official kernel:

https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json

PD:


STlinkV2 + bluepill F103C8 (@96 MHz) + FT813 NHD 3.5"

I had to open the link found in the error message: STM32CubeProgrammer software for all STM32,
download after registering (again), unzip and then install running SetupSTM32CubeProgrammer-2.4.0.exe, which required some specific java runtime version, which prompted me to install Java.
After starting the installation again, took some time to complete, program upload through STLink V2 was successful.

Just re-installing the official STM32 package was not enough, unfortunately.

Jean-Marc