Programming STM32 Microcontroller Flash in Windows

Created on: 25 August 2012

STM32 microcontrollers can be programmed without the need to install commercial development tools or evaluation versions of these tools.

Using the ST-LINK utility software from ST Microelectronics, a binary program file can be loaded to the STM32's Flash memory via a ST-LINK or via the embedded ST-LINK on evaluation boards such as the STM32 value line discovery evaluation board.

Downloading and Installing the Software

Download the STM32 ST-LINK utility software. More information and documentation is available under the Design support tab on the ST-LINK/V2 page of the ST Microelectronics website.

To install the software on a Windows PC, extract the stm32_st-link_utility.exe file from the downloaded zipped file. Run the extracted file and go through the installation procedure.

Programming the STM32 Flash

Start the STM32 ST-LINK Utility program. There will be a link to the utility on the desktop. In Windows 7 it can also be found under Start → All Programs → STMicroelectronics → STM32 ST-LINK Utility → STM32 ST-LINK Utility.

Plug the ST-LINK or evaluation board with embedded ST-LINK into the USB port of the PC. In the STM32 ST-LINK Utility window, click the Connect icon on the top toolbar (or Target → Connect). Use the Open File icon on the top toolbar (or File → Open file...) to open the binary file to load to the STM32.

After opening the binary file, a dialog box will pop up stating that the file is not downloaded to the device. Click the OK button in this dialog box to load the binary file to the STM32 (shown in the figure below). In the Download dialog box that pops up, click the Program button.

Disconnect from the board using the disconnect icon on the top toolbar (or Target → Disconnect) and then press the reset button on the board, or cycle the power to run the loaded program.

The ST-LINK utility software program