preamble
Before playing STM32 are using J-LINK burn program, not only convenient, but also burn the speed is much faster than using the serial port.
Recently I took a couple of 32 microcontroller graduation orders, so I bought a couple of C8T6 minimum system boards to use for development. Initially, I used J-LINK to burn the C8T6, and I just need to find out the corresponding pins from J-LINK and connect them with DuPont wires. However, I have to go to the school's lab every night, and I have to rewire every time, so it's not so convenient to use J-LINK again.
So I bought another ST-LINK burner, and after testing the burner successfully, I organized the configuration process into this blog for your reference.
preliminary
- One STM32F103C8T6 minimum system board (other STM32 microcontrollers are also applicable)
- One ST-LINK/V2 burner (for other versions)
- 4 female-to-female Dupont wires
- Windows system computer, and has installed MDK-ARM, not installed can click on the jump to install->Keil Series Tutorial 03_MDK-ARM Installation and Registration
wiring connection
The actual wiring diagram, I wrapped the DuPont wire with insulating gel so it's easy to plug and unplug.
Below is the wiring diagram for ST-LINK/V2 and STM32, all one-to-one.
ST-LINK/V2 | STM32 |
---|---|
3.3V | 3V3 |
GND | GND |
SWDIO | SWDIO |
SWCLK | SWCLK |
After connecting according to the above, plug the ST-LINK into the USB port of your computer.The following article defaults to ST-LINK being plugged into the computer。
Download ST-LINK Driver
Here we provide two ways for you to choose, one is to download the driver from the official website (you need to register ST account), the other is to download it from Baidu.com disk.
1. Download through the official website
Official website link:/en/development-tools/
Open the official website and click "Get Software", click on "Get latest", the back according to the prompts to register an account to download can be, here is no longer demonstrated.
2. Download via Baidu.com
I have packaged and uploaded the driver used in this article to Baidu.com, scan the QR code below and reply to "0017" to get a free share link.
Installation of ST-LINK driver
After downloading it, extract the zip and open the extracted folder.
Find it."dpinst_amd64.exe"Right click and open as administrator.
Click "Next >”。
If the image below appears, click "Install"Just do it.
The driver is installed successfully, click "Finish”。
Check if the computer is connected to ST-LINK
After the driver has been successfully installed, you can right-click in the taskbar of your computer "start menu", select "equipment management", in "Universal Serial Bus device (USB)"will be displayed in the "STM32 STLink", it means that ST-LINK is connected.
If it does not show up, you need to unplug the ST-LINK again and it will show up.
Keil Configuration for ST-LINK
Here you can open an existing project to facilitate the subsequent verification of the success of program burning.
Once the project is open, click "magic wand", on the page that opens click "Debug", select "ST-Link Debugger"and then click on "Settings”。
If the image below appears, click "Yes", select Upgrade.
Click "Device Connect", when the firmware appears click "Yes > > > >" and wait for the download to complete.
Once downloaded, click "OK", tap the top right corner of the "X" to close this page.
In "Debug"In the left Port selection "SW", Req enter "5", on the right side of the "SW Device"Connected hardware has been shown, indicating that Keil has established a connection with ST-LINK.
If it doesn't show up, unplug the ST-LINK again, or reboot Keil.
Next, make the other configurations in the "Flash Download"Check the box in the "Reset and Run", thus achieving the effect of software resetting the microcontroller after burning the program.
Underneath the selection is based on the Flash capacity of the specific microcontroller.The Flash capacity of the microcontroller is recommended to be checked on the official website or in the datasheet of the chip.
In "Pack", uncheck the box "Enable" before the software resets automatically after burning, click "OK”。
Setup is complete, click "OK”。
Compile and burn programs
Click the Compile button, 0 errors and 0 warnings and click "LOAD button"Burning Programs.
If the following result is displayed, the burn is successful.
Of course if you have selected an existing project for burning earlier, then you can verify whether the burning is successful by the program executed by the microcontroller.
postscript
This is the end of this article, if it is helpful to you, please like and support it yo.