STM32 ST-LINK驱动安装成功却出现识别不到ST-LINK的办法(The STM32 st-link driver is successfully installed, but the st-link is not recognized)



情况描述:ST-LINK能被电脑识别,驱动是好的。但是在keil中的Debug-setting中的SW Device找不到。无论是下载还是调试,都提示“flash download failed target dll has been cancelled”。(注:如果一按setting ST-LINK的指示灯就灭了,请重新升级一下ST-LINK的固件,可以在keil 5安装文件夹下的ST-LINK子文件夹下的ST-LinkUpgrade.exe自动升级)

显示“NO target connected“ 但是驱动没有问题 在设备管理器中显示出有stlink原因是配置了GPIOA的 14 13这两个口了

GPIOA_MODER复位后的值为:0x2800 0000,即将GPIO13\14配置为复用模式,但为什么在程序配置了GPIO13\14为输出,并且在目标芯片有复位的情况下也会引起SWD无法仿真、下载的问题。”解决办法:

1、先确认目标板上电。2、先长按住目标板上的复位键,再点击 Settings,再松开目标板上的复位键。3、此时KEIL打开Settings的设置对话框,请确认有SWD的内容后,再进行下一步。4、将目标板断电,重新上电。5、先长按目标板的复位键,再点击仿真或者下载按钮,再松开复位键。 注:这里点仿真到松开复位键不是每一次都能成功,每次点了仿真键到松开复位键的时间每次都不同,在某一个点时,就可以进入仿真或者下载程序了。板子就恢复正常了。但需要注意的是,在程序里一定要避开对GPIO13\GPIO14的配置。




Recently, I was learning STM32, but in the process of debugging and downloading the program, I succeeded n times, but suddenly I couldn’t find st-link.

After checking a lot of information on the Internet, it was useless. It took an hour and finally found a solution. I thought why not push this article to me earlier. Thank you for moving your article here for learning and recording only. A connection has been attached at the end. In case of infringement, it will be deleted immediately.

Situation Description: st-link can be recognized by computer, and the driver is good. However, SW device in debug setting in keil cannot be found. “Flash download failed target DLL has been cancelled” will be prompted whether downloading or debugging. (Note: if the indicator light of setting st-link goes out as soon as you press it, please upgrade the firmware of st-link again. You can upgrade it automatically in st-linkupgrade.exe under st-link subfolder under keil 5 installation folder)

“No target connected” is displayed, but there is no problem with the driver. Stlink is displayed in the device manager because the 14 and 13 ports of gpioa are configured

GPIOA_ The value after mode reset is 0x2800 0000, that is, gpio13 \ 14 is configured as multiplexing mode, but why does the program configure gpio13 \ 14 as output and cause the problem that SWD cannot be simulated and downloaded when the target chip is reset? ” terms of settlement:

1. First confirm that the target board is powered on. 2. First long press and hold the reset key on the target board, then click settings, and then release the reset key on the target board. 3. At this time, Keil opens the settings dialog box. Please confirm the content of SWD before proceeding to the next step. 4. Power off the target board and power it up again. 5. First long press the reset key of the target board, then click the simulation or download button, and then release the reset key. Note: the time from clicking the simulation key to releasing the reset key is not successful every time. The time from clicking the simulation key to releasing the reset key is different every time. At a certain point, you can enter the simulation or download the program. The board returned to normal. However, it should be noted that the configuration of gpio13 \ gpio14 must be avoided in the program.

Reprinted to the original article of CSDN blogger “qq)u 42041980”