Recover board using ST-Link

Introduction

 

This page describes how to recover a board using ST-Link dongle, this procedure can be applied to all boards like CC3D, Revolution, RevoNano or Sparky2 boards.

Most boards have the SWD port already populated, if not you may need to solder directly the required wires.

In this page




Building a SWD cable

SWD port pinout

#

Function

1GND
2NONE
3IO
4CLK

Connect the GND, IO and CLK wires between the SWD port and the STLink dongle, the pin2 is not used.



Sparky2

Please note the IO and CLK lines are reversed for Sparky2 board !

pin3 is CLK and pin4 is IO



Software setup


Download the required software from the ST website, need registration: ST website download page

After downloading the files and installed the required software, start with the Link Utility.

It will automatically install the drivers and provide the option to upgrade the firmware.


Update STLink dongle firmware

If you have problems you may try updating the dongle firmware, but be aware that this can brick a clone STLink dongle.

Connect the STLink dongle and start the ST-Link Utility software.

Go to the ST-Link menu and choose Firmware Update

  • Click "Device Connect" and "Yes >>>>" button

  • The STLink dongle firmware is up to date now.

  • Disconnect the STLink dongle.



Bootloader binaries

Here is the bootloader binaries for various boards, to be used with STLink utility:

BoardBootloader file
CC3D

Revolution

Revolution Nano
Sparky2
Oplink Mini

For bu_* files to be flashed using GCS, see the Downloads page instead.




Flash Bootloader with STLink Utility

Connect and apply power

  • Connect the STLink dongle to a USB port.
  • Connect the JST connector to the board's SWD port.
  • Power the board: can be using external +5V on Output connector, or using the USB port

 

  • Connect the device using the icon


  • At this point memory content should be populated and device characteristics displayed, here is a CC3D example:

  • Go to the Target menu > Program and Verify or click on Prog and Verify icon.
  • Click the Browse button and load the bootloader file where you saved previously.

  • Click Start to flash device


  • Device is now flashed with the new bootloader file.


  • Disconnect the device using the Disconnect button:



Update the firmware

After the bootloader is restored, you can flash the firmware using GCS and "manual" method:

  1. Disconnect board from USB port
  2. Hit Upgrade&Erase button
  3. Connect board to USB port
  4. Wait the flash process, reboot and erase flash, this can take up to 30s.