ohahaha

[Tools] ST-LINK V2-1 (available for personal testing)

 
Overview
This project is completely designed using Lichuang EDA. If you like this project, please give it a like in the comment area. Thank you for your support!
Everyone is welcome to collect this project.

Table of contents

1 Introduction

2. LCEDA 2D & 3D pictures

     2.1, 2D pictures

     2.2. 3D pictures

3. Schematic reference

     3.1. USB interface circuit

     3.2. LDO power circuit

     3.3. ST-LINK V2.1 circuit

4. COM indicator light

5. PCB design

6. Welding debugging

7. ST-LINK V2.1 firmware burning & firmware update

      7.1. Obtain firmware

      7.2. Burning software

      7.3. Update firmware

8. Verification

9. Test

10. Things to note

 

 

1 Introduction

 
STLINK version introduction.png
  • ST-Link/V2: Supports STM32 and STM8 debugging, without virtual serial port. Most of them are sold on TB. Currently, there are several versions of ST-Link on hand. This version will be used for burning later.
  • ST-LinkV2-1: supports STM32 debugging, with virtual serial port and virtual USB disk download. This is the version of ST-Link currently loaded on ST’s official Nucleo series evaluation boards.
What this project produces is ST-Link V2-1, which is used for STM32 program downloading, simulation debugging and serial port functions.

 

2. LCEDA 2D & 3D pictures

 

2.1, 2D pictures

Figure 0 2D TOP surface.png
Figure 1 2D BOT surface.png

 


2.2. 3D pictures

Figure 2 3DTOP surface.png

Figure 3 3DBOT surface.png

3. Schematic reference

 
The schematic diagram of this project refers to the ST-link V2-1 design on the Pandora development board of Punctual Atom, as shown below. The first time I came into contact with ST-link V2.1 was on this Pandora development board.

 


Precautions:

 


 

3.1. USB interface circuit

The USB_ST_LINK on the Pandora development board can be transferred directly. The USB-Type-A is used in this design.
 
USB STlink v2.1.png on Pandora development board

3.2. LDO power circuit

For POWER on the Pandora development board, you only need to take one LDO and move it over.
 
POWER.png on Pandora development board
 

3.3. ST-LINK V2.1 circuit

STlink v2.1 on the Pandora development board, this part can also be moved over and replace STM32F103C8T6 with STM32F103CBT6
 
STlink v2.1.png on Pandora development board
 

4. COM indicator light

 
A schematic diagram of ST's official ST-Link V2.1 is uploaded in the attachment.
 
In ST's official ST-Link V2.1 drawing, there is an indicator light named COM. This is a red and green LED indicator light, which is the LED shown in the picture below .
 
COM indicator.png
 
So what is the function of this indicator light? It is specially introduced in the official TN1235 technical manual. The relevant parts are excerpted as follows.
 
STLINK COM LED.png
 
The translation is as follows:
 
Since ST-LINK/V2, all ST-LINK boards have an LED labeled "COM" (on the housing or PCB).
Regardless of the connection type, this LED shows the ST-LINK status:
  • LED flashing red: First USB enumeration with PC in progress.
  • LED red: Communication between PC and ST-LINK is established (end of enumeration).
  • LED flashes green and red alternately: data is being exchanged between target and PC.
  • LED is green: the last communication was successful.
  • LED is orange: ST-LINK communication with target failed
The ST-LINK V2-1 integrated in the Pandora development board referenced by this project uses a red LED to replace the red and green COM indicator light. Therefore, this project also follows this design, and the COM indicator light is replaced by a red LED. .

 


 

5. PCB design

 

1. The D- and D+ data lines of the USB part must use differential routing .

 
Differential routing.png
 

2. The crystal oscillator circuit part must be placed close to the MCU.

 
Crystal oscillator circuit.png

 


 

6. Welding debugging

Figure 4.jpg
 
Figure 5.jpg
 
Figure 6.jpg
 
Figure 9.jpg
 
Figure 10.jpg
 
Figure 11.jpg
 
Figure 12.jpg
 
Figure 14.jpg
 
Figure 15.jpg

 


 

7. ST-Link V2.1 firmware burning & firmware update

 

7.1. Obtain firmware

Since the official source code of ST-Link has not been disclosed, and the ST-Link firmware ( read protection ) has not been directly provided, there are currently (July 2020) multiple versions of firmware circulating on the Internet.

Version 1: STLink V2.J16.S4 version firmware: Standard V2 version, supports SWD and SWIM interfaces, this version of firmware is. Attachment uploaded.

Version 2: STLink V2.J28.M18 version firmware: used for ST-LINK/V2-1, ST-LINK/V2-A, ST-LINK/V2-B boards (with STM32 debugging interface, large-capacity storage interface, virtual COM port) version. Attachment uploaded.

 

To make ST-Link V2-1 in this project, you must use version V2.J28.M18 as the burned firmware version .

 

7.2. Burn firmware

You can use these two tools to burn firmware for the first time

STM32CubeProg: STM32CubeProgrammer software for all STM32 download address

The main function of STM32CubeProg is programming (download), and supports Windows, Linux, and macOS operating systems.

At the same time, you need to install the JRE environment to use it, download address .

 

STM32Cube Pro interface.png

 
 
       
The function of STM32 ST-LINK Utility is slightly simpler than STM32CubeProg, and its main function is also programming (download).
 
en.stm32stlinkutility.jpg
 
This article uses the STM32CubeProg programming tool to burn firmware .
 
You also need a burning tool to burn the firmware. I only have the following ST-Link v2 here.
Figure 16
 

7.3. Update firmware

 

There are three methods for firmware update
 
  • Download the official firmware upgrade app
STSW-LINK007 : Firmware upgrade for ST-LINK, ST-LINK/V2, ST-LINK/V2-1 and STLINK‑V3 boards
 
The versions of the released upgrade package tools are detailed in the official RN0093 release manual (uploaded in the attachment).
 
The latest firmware version number as of July 2020
 
Firmware upgrade package latest firmware version.png
 
  • Use the upgrade tool provided by STM32CubeProg or STM32 ST-LINK utility to upgrade
 
STM32CubeProg V2.4.0 built-in firmware version
 
STM32Cube Pro firmware upgrade version.png
 
STM32Cube Pro firmware upgrade version introduction.png
 
  • Use the built-in upgrade tool of Keil MDK-ARM to upgrade. When the ST-link version is lower than the built-in version of MDK, you will be prompted to upgrade.
The built-in firmware upgrade version of Keil MDK-ARM v5.31 is the same as the built-in firmware upgrade version of STM32CubeProg V2.4.0, both are V2.J35.M26
 
This article uses the STM32CubeProg V2.4.0 built-in upgrade tool to update the firmware.
 
hint
See the attached video for the firmware burning and update process.

 

8. Verification

Verification.png
Display the above information and confirm that the firmware is OK

 

9. Test

  1. Test the burning function, use Keil-MDK, download the program successfully, indicating that the burning function is normal
  2. Test the Debug function and use Keil-MDK for debugging. If it can be debugged, it means that the Debug function is normal.
  3. To test the U disk drag and burn function, you need to generate a bin file ( bin file generation method ), drag the bin file to the U disk simulated by ST-link, and successfully burn it, indicating that the virtual U disk function is normal.
  4. Test the serial port transceiver function: Use Dupont cable to connect the TX and RX of ST-LINK V2-1, open the serial port assistant, send data, and the receiving area receives the same data, indicating that the serial port transceiver is normal

 

10. Things to note

  1. The ST-LINK firmware upgrade tool does not know which version it starts from, and does not support cross-version firmware updates.
  2. The recent versions of ST-LINK firmware have added read protection, and the SWD port is locked, so the firmware cannot be read or written through the SWD port.
  3. If you want to change to firmware such as DAP-LINK, you cannot burn the firmware through the SWD port, but you can erase the STM32 firmware information through ISP, and then you can use the SWD port to read and write normally.

 

 


 
 
 
Warm reminder: If you have any questions, you can leave a message directly in the comment area. After seeing the message, we will reply in time.
Friends who like it, please give it a like above the comment area, thank you!

 


The content of this video is about firmware burning and updating.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-15 20:13:21
  • Chapter 1 of X86 Learning: Development Board Configuration
  • About the message triggered by clicking SIPBUTTON
  • FL032-C0 240*320 TFT LCD AVR Driver
  • Good things to share
  • STM32F407+LWIP---How to check if TCP communication is disconnected? And reconnect
  • Compile MICOPYTHON with MDK or IAR

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号