Error in initializing ST-Link Device

佐手、 提交于 2020-01-13 16:24:33

问题


I am currently using the ST-Link debugger to program my STM32F3 Discovery Board. The IDE that I am using is Atollic TrueStudio 5.5.2 but now I am facing a very weird problem which is I keep on getting the message " Error in initializing ST-Link Device. Reason : (-1) Failed to connect to device . Please check power and cabling to target." whenever I want to download the program into my STM32. I had tried some solutions that I found from internet but the problem still exists. Anyone had faced this problems before? Any suggestions will help. Thank you.

Here is the solution I found but can't work for me. http://www.kerrywong.com/2012/08/02/the-dreaded-cannot-connect-to-st-link-error-message/


回答1:


You could try the following.

Make sure that you have installed the right version of the driver (32 or 64 bits).

If you are using an external ST-Link, make sure that you connect VCC, GND, RESET, SWDIO and SWDCLK.

If you are using an external ST-Link, make sure that Atollic is using the right one. You may have 2 ST-link connected (the external and the embedded one).

Ensure that the ST-Link is setup in SWD mode and not in JTAG.

In Atollic, you could also change how the ST-Link connects to your target. Try different combinations, for example Connect under hardware reset.




回答2:


I had same situation on Ubuntu. I solved this, using STM32CubeProgrammer.

On the ST-LINK configuration area:

  1. Serial number -> refresh to get your stlink serial
  2. Mode: Under reset
  3. Reset mode: Core reset

try to connect asap when power your board. When you connect you can do "full chip erease". It suppose to be ready for next usage. I hope it helps




回答3:


In the debugger tab, make sure to select SWD, not JTAG.



来源:https://stackoverflow.com/questions/38092674/error-in-initializing-st-link-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!