cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103ZET error: No device found on target.

RRuan
Associate II

After I click DEBUG ,it shows that

Error in initializing ST-LINK device.

Reason: No device found on target.

I think it's not hardware's problem because I can download my program in Keil uvision successfully. and my debug configuration is showed as follows:

0690X000008BZDuQAO.png0690X000008BZDzQAO.png

9 REPLIES 9
Markus GIRDLAND
ST Employee

Under the "Enable live expressions" there's a box where you can enable a log. Can you activate that one, make a new try to debug and then send me the log?

pcbwiz
Associate II

I was getting that same issue. I uninstalled cubeIDE and reinstalled by right-clicking and run as administrator. All good now. I think there was some driver configuration issue.

I activated it, and this is the contents of the file “st-link_gdbserver_log.txt�?

[0.001] initConfigParams(): Configuration flags start

[0.001] initConfigParams(): config-file          ""

[0.001] initConfigParams(): persistent          false

[0.001] initConfigParams(): +log-file           "/Users/ruanjinhao/文档/CubeMXFiles/TEST/Debug/st-link_gdbserver_log.txt"

[0.001] initConfigParams(): +log-level           31

[0.001] initConfigParams(): +port-number          61234

[0.001] initConfigParams(): +verbose            true

[0.001] initConfigParams(): refresh-delay         15

[0.001] initConfigParams(): +verify            true

[0.001] initConfigParams(): +swd              true

[0.001] initConfigParams(): swo-port           61234

[0.001] initConfigParams(): cpu-clock           8000000

[0.001] initConfigParams(): swo-clock-div         128

[0.001] initConfigParams(): initialize-reset       false

[0.001] initConfigParams(): debuggers           false

[0.001] initConfigParams(): serial-number         ""

[0.001] initConfigParams(): +apid             0

[0.001] initConfigParams(): attach            false

[0.001] initConfigParams(): shared            false

[0.001] initConfigParams(): erase-all           false

[0.001] initConfigParams(): memory-map          ""

[0.001] initConfigParams(): ext-memory-loaders      false

[0.001] initConfigParams(): extload            ""

[0.001] initConfigParams(): +stm32cubeprogrammer-path   "/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.macos64_1.0.0.201904021149/tools/bin"

[0.001] initConfigParams(): temp-path           ""

[0.001] initConfigParams(): preserve-temps        false

[0.001] initConfigParams(): licenses           false

[0.001] initConfigParams(): ignore-rest          false

[0.001] initConfigParams(): version            false

[0.001] initConfigParams(): help             false

[0.001] initConfigParams(): Configuration flags end

[0.001] init(): STMicroelectronics ST-LINK GDB server. Version 5.2.3

Copyright (c) 2019, STMicroelectronics. All rights reserved.

[0.007] Device_Initialise(): Target no device found

[0.007] initServerContext(): 

Error in initializing ST-LINK device.

Reason: [0.007] initServerContext(): No device found on target.

Thank you, but it still doesn't work.

How is your workspace and installation set up?

I noticed the log gets logged to "文档/CubeMXFiles/TEST/Debug/st-link_gdbserver_log.txt" and any non-ascii characters in workspace path, installation path, project name or workspace name can give bad results.

Aren't we all using UNICODE these days? I worked on Windows stuff a decade or so ago, you really can't expect file system stuff to all be "Western/European", the Japanese and Chinese versions of Windows allow for completely different configurations/expectations.

Spaces in files, "faux" files on the Desktop, and in Program Files directories should also be handled. If using 8-bit file paths, be conscious of double-byte character codes.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I changed my workspace path into English and reinstalled CubeIDE, but this error still exists. and this is the new "st-link_gdbserver_log.txt"

[0.000] initConfigParams(): Configuration flags start

[0.000] initConfigParams(): config-file          ""

[0.000] initConfigParams(): persistent          false

[0.000] initConfigParams(): +log-file           "/Users/ruanjinhao/STM32CubeIDE/workspace_1.0.0/TEST/Debug/st-link_gdbserver_log.txt"

[0.000] initConfigParams(): +log-level           31

[0.000] initConfigParams(): +port-number          61234

[0.000] initConfigParams(): +verbose            true

[0.000] initConfigParams(): refresh-delay         15

[0.000] initConfigParams(): +verify            true

[0.000] initConfigParams(): +swd              true

[0.000] initConfigParams(): swo-port           61234

[0.000] initConfigParams(): cpu-clock           8000000

[0.000] initConfigParams(): swo-clock-div         128

[0.000] initConfigParams(): initialize-reset       false

[0.000] initConfigParams(): debuggers           false

[0.000] initConfigParams(): serial-number         ""

[0.000] initConfigParams(): +apid             0

[0.000] initConfigParams(): attach            false

[0.000] initConfigParams(): shared            false

[0.000] initConfigParams(): erase-all           false

[0.000] initConfigParams(): memory-map          ""

[0.000] initConfigParams(): ext-memory-loaders      false

[0.000] initConfigParams(): extload            ""

[0.000] initConfigParams(): +stm32cubeprogrammer-path   "/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.macos64_1.0.0.201904021149/tools/bin"

[0.000] initConfigParams(): temp-path           ""

[0.000] initConfigParams(): preserve-temps        false

[0.000] initConfigParams(): licenses           false

[0.000] initConfigParams(): ignore-rest          false

[0.000] initConfigParams(): version            false

[0.000] initConfigParams(): help             false

[0.000] initConfigParams(): Configuration flags end

[0.000] init(): STMicroelectronics ST-LINK GDB server. Version 5.2.3

Copyright (c) 2019, STMicroelectronics. All rights reserved.

[0.006] Device_Initialise(): Target no device found

[0.006] initServerContext(): 

Error in initializing ST-LINK device.

Reason: [0.006] initServerContext(): No device found on target.

So neither workspace path nor installation path have any non-ascii characters now?

Is it some kind of custom board? I would make sure contact with the board is good and also make sure you point out the correct ST-Link in the debug configuration if you have multiple connected or perhaps a previous one saved.

Do you have TrueSTUDIO or stand alone CubeProgrammer installed? If so, what are the results with those tools?

This error is usually due to a simple connectivity issue.

Regarding the support of japanese and chinese characters for example, @Community member​ :

It would probably not take too much of an effort for the IDE part to support it but there were so many critical components that we integrate into CubeIDE that does not support it that we decided against it.

yes,both paths are correct. I haven't tried truestudio so I don't how it runs in my mac. I use Keil MDK now, it works very well. I think I will give up using cubeIDE…