How to program blank STM32F1 with STLINK V2 firmware

Today I found out how to “flash” blank STM32F103xC to make STLINK V2 debugger interface.

So, instead of desoldering from Discovery board to make miniture STLINK debug interface:

a09 - stlink v2 brain desoldered                  a0a - stlink v2 finally assembled usb mini dongle

it’s possible to solder blank (or any) STM32F10x with USB and at least 64k flash + 20k RAM, program it with STLINK V2 Firmware and use your new USB dongle for debugging STM32 or STM8 devices.

First make single sided PCB as described here.

What you will need is a copy of STLINK V2 HEX (available in this keil uVision project in the folder ./Objects) or Binary image of the STLinkV2.J16.S4 image for writing in the microcontroller. Here is is the complete project in keil uVision. Just install free evaluation copy of Keil tools or free version for STM, open the project, connect the debug interface to the pads iC (SCLK) and iD (SDIO) and program the STM32F10x.

After writing the flash it is possible to upgrade to newest version of STLINK V2. Just install STLINK firmware upgrade, e.g. stlink-V2.J21.S4 and perform the update:

pre-upgrade            upgrade-OK

 

6 Comments

  1. Mare says:

    Here is excellent article on using STM32 GNU ARM GCC Toolchain with Eclipse, STLink and OpenOCD Debugger:
    http://eraycanli.com/2015/08/19/stm32-gnu-arm-gcc-toolchain-with-eclipse-stlink-and-openocd-debugger/

  2. Mare says:

    Here are some other options for writing the flash image to STM32F103:
    http://jeelabs.org/book/1546c/

  3. Sherlock says:

    Hi my dear!

    I need an firmware to ST-Link-V2/1 and I just found a firmware to ST-Link-V2.

    Do you have any ST_Link_V2/1 firmware too? Like V2J28M16.

    • Mare says:

      Once you have up and running STLINK you can just run any firmware “upgrade” app at the desired level / version.

      • Sherlock says:

        I have the “STSW-LINK007 Upgrade” and I just can up to V2J28S6 (to ST-LINK/V2), so I don’t have Virtual COM Port acess…
        Do you know how can I resolve it?
        Thanks for your help!

      • Peter says:

        Unfortunately, ST-Link V2-1 have different bootloader and ST-Link V2 can not be simple upgraded to ST-Link V2-1.
        ST-Link V2-1 is composite device (debugger, Virtual COM, mass storage).

Leave a Reply