Downloading binaries using STM32 ST-Link Utility

Just a quick note to finalize STM32 flashing topic. As you may know ST also produces his own debugger/programmer called ST-Link. It supports either JTAG and SWD interfaces. You can purchase ST-Link USB adapter but there is a better option. If you are in to STM32 microcontroller business you probably already own one of ST32 Discovery boards. Since I have STM32VLDiscovery near by this is how we can program another STM32F103RBT6 board using only four wires.

In discovery board locate CN3 jumpers and disconnect them as they connect discovery board to debugger.

Then locate CN2 pins and connect them to target boards JTAG connector as follows:

VDD (pin 1) to JTAG VCC (pin 1)

SWCLK (pin 2) to JTCK (pin 9)

SWDIO (pin 4) to JTMS (pin 7)

GND (pin 3) to GND (pin 4)

Power both boards and open ST-Link utility. You can see that Medium Density board has been detected.

Now you can load binary file and program microcontrollers Flash memory. Using Target menu you can perform additional operations similar to J-Flash.

Interesting feature of ST-Link worth mentioning is MCU panel. Here you can do various things like Run code, halt, step, reset, core reset and read core registers. You can treat this panel as some sort quick debugger

You will find a great tutorial in user manual in ST-Link install location on your PC.

Couple more flashing methods: embedded bootloader and Using J-Link JTAG adapter

Leave a Reply

Your email address will not be published. Required fields are marked *