Lou Pig is used to download and debug Stm32 program, because JTAG is the D version (you understand), the official upgrade when the hands of the cheap upgrade, JTAG changed brick. Later found used for STM8 download debugging with the Stlink can also be used to debug Stm32, Lou Pig bought is more than 20 yuan Stlink,x Bao bought, claiming to be able to use the official firmware, so there is this article:
First of all, the building pig with win 10 64, Keil uvision is 4.74 version
1, of course, is installed Stlink driver, Lou Pig Stlink although claimed to be V2 version, but in fact should not be V2 version, because can not use JTAG mode to debug, only use the SW mode
Device Manager will have stlink display after inserting hardware
2, Keil uvision in the settings
4.7 version has no need to overwrite the Tools.ini, set as can be, the download list has two St link, choose one of the more set options; the other one is said to be special for the D edition.
3, Stlink How to access the Jtag interface description:
Stlink access to the Stm32 as long as the access to three wires.
SWCLK Swdat GND
The wiring is as follows:
The left side of the J1 in the figure is where there is a gap in the JTAG hardware interface.
4, if finished the above steps can not be debugged (for example, can download, but the program cannot debug breakpoints, can not run into the main function, etc.), you should pay attention to stm32 Boot0 and Boot1 pin
There are two pins BOOT0 and BOOT1 on each STM32 chip,
The level state of the two pins at the time of the chip reset determines the region from which the program is executed after the chip is reset, as shown in the following table:
Boot1=x boot0=0 boot from user flash, this is normal mode of operation.
Boot1=0 boot0=1 boot from the system memory, this mode starts the program function is set by the factory.
The Boot1=1 Boot0=1 starts from the built-in SRAM, which can be used for debugging.
In other words, if you want to debug, to the BOOT1 grounding, BOOT0 pull up, but the situation of the building pig test is as long as the BOOT0 pull on the line, such as:
If the above steps are done or not, it may be the hardware used in the building, or Keil uvision generated settings and your inconsistency caused, please continue to delve.
Debugging tutorials with Stlink breakpoints under Keil uvision (RVMDK)