The STM32 microcontrollers are built around the Arm Cortex-M processor. Let’s get started by first installing some of these tools. I am using Windows, but I will almost exclusively be using tools that are also available on Linux (and perhaps Mac). However, it should be a fairly straight-forward task porting my examples to any other STM32 MCU or development board. Throughout the series I will be using a NUCLEO-F410RB development board which features an Arm Cortex-M4-based STM32F410RB microcontroller and an integrated ST-LINK for programming over USB.
Needless to say that I tried to google the error messages above, but none of the shown links were conclusive.Īfter some further digging through the box in which I store my microcontroller stuff, I found to my surprise another ST-Link/v2 knockoff which I must have purchased some years ago (and since forgotten about it - hi).All code from this blog post is available on Github. Since none of my ‘Blue Pill’ development boards were recognized by none of the ST-Link/v2 programmers, I suspected a rather systematic error. To ensure that this wasn’t a hardware issue, I tried of course several combinations of ST-Link/v2s and development boards. "If the target is in low power mode, please enable "Debug in Low Power mode" option from Target->settings menu" If you're trying to connect to a low-frequency application, please select a lower SWD Frequency mode from Target->Settings menu" "Can not connect to target! Please select "Connect Under Reset" mode from Target->Settings menu and try again.
Poking around with the ST-Link/v2 settings I was confronted with the following error messages over time: The symptomsĭespite that the ST-Link/v2 was properly recognized, I wasn’t able to connect or upload anything to the development board. After connecting the two devices, I tried to upload a simple test program, but it just wouldn’t work and the error messages were also rather cryptic. The pin-out diagram is printed on top of the ST-Link/v2. The ST-Link/v2 has a 10 pin interface through which it interfaces with the development board. In particular, I found the STM32 ST-Link Utility (STSW-LINK004) to be quite helpful - although it’s only available for Windows.įigure 2: Screenshot of the STM32 ST-Link Utility The problem ST provides also some optional software tools for their microcontrollers. ST has come a long way integrating their stuff into Eclipse, but in 2020 it’s now working well, even on MacOS □. I’m a big fan of Microsoft’s free and cross-platform Editor/IDE Visual Studio Code, but when it comes to ST microcontrollers I prefer to use their STM32CubeIDE. The boards are certainly also knock-offs, although the CPU appears to be genuine. So I ordered a few clones on Aliexpress along with a bunch of ‘Blue Pill’ boards. In the past, I used an original ST-Link/V2, but it became a victim of my last move.
Over the years I’ve used occasionally the ‘ Blue Pill’ which is a little development board, comparable in size with the better known Arduino Nano, but with a modern and more capable ARM Cortex M3 CPU ( STM32F103C8T6).įigure 1: ST-Link/v2 knock-off connected to a ‘Blue Pill’ development board Read on to learn about the problem, the symptoms, and the (super) easy fix. However, making them work was pretty frustrating. I recently ordered a few of these cheap ST-Link/v2 clones for a new project. Due to its capabilities, it is an extremely popular device and clones are available from your preferred Chinese trading platform for less than 5 euros. The ST-Link/v2 is an in-circuit debugger and programmer for the STM32 and STM8 microcontroller families.