Error:no device found on target

Discussions concerning TrueSTUDIO for STM32 9.0.0 and later versions.

Moderators: Markus Girdland, Mattias Norlander

Posts: 18
Joined: Fri Mar 10, 2017 5:32 am

Error:no device found on target

Postby diamondjimkoehler » Thu Jan 03, 2019 5:29 pm

I am running TrueSTUDIO 9.2 on a 64-bit Linux machine. The version of Linux is Mint 18.3 which is basically Ubuntu 16.04. I have been trying to develop code for a 'blue pill' (STM32F103C8) using a cheap Chinese ST-LINK/V2 module. Sometimes, everything seems to work properly and I can download and debug code normally. However, more often than not, I get an error when trying to debug and the reason given is "No device found on the target. I have the same problem using versions 9.0 and 9.1 of TrueSTUDIO.
i never get this error if I work with a Nucleo STM32 board or any other STM evaluation boards I have tried ... it seems to be a problem just with the blue pill/ST-LINK/V2 combination. Since it sometimes works but most often does not it seems to me that perhaps it is some sort of timing problem? I have tried programming the blue pill using the ST-LINK part of the Nucleo board connected to the blue pill but that gives the same error. However, on the Nucleo board, the connection to the target processor also has the NRST line and the SWO line which the simple 4-pin connection on the blue pill does not accommodate.
The blue pill's power, cost and availability plus the inexpensive Chinese ST-LINK's make this combination very attractive for hobbyist and other development so it would really be great if this combination could be made to work reliably with TrueSTUDIO. At the moment, I can develop code in TrueSTUDIO using the Nucleo F103 board and then modify the code to for the different clock setup on the blue pill, 'make' that and then, using a "flash' utility, download a hex file into the blue pill via a serial connection. That is very awkward and not really very workable.

Posts: 14
Joined: Fri May 18, 2018 2:57 pm

Re: Error:no device found on target

Postby Andy_Blue » Thu Jan 03, 2019 8:34 pm

I don't have a 'blue pill' (STM32F103C8) in hand, so I can't tell exactly what's wrong. But here are some thoughts may help you.

Error:no device found on target
This means your debugger can't communicate to your target device properly.
Why? Many possibles.
When I have a quick look the debugging connector on 'blue pill', I noticed that there are only 4 pins and includes power and GND, so SRST and TRST all missing, and when you are using STLINK V2, it assumes the SRST was connected in most of the cases, unless you tweak the debugger script to "tell" the debugger not to use it.
The other way to fix could be wiring signal SRST to target board properly. I don't know if any circuitry modification needed. Good luck.

User avatar
Posts: 18
Joined: Tue Jan 01, 2019 7:07 pm
Location: Germany

Re: Error:no device found on target

Postby artbody » Mon Jan 07, 2019 12:08 am

In SW4STM32 there is a possibility to set in
Run/Debug settings
... Debugger -> Show generator options -> Mode Setup ->Software Reset
so you'll need 4 wires SWCLK SWDIO NRST GND

where this option is hidden in AtollicStudio ...i don't know

with a STLink i.e nucleo boards

Code: Select all

Connect under reset
is the default and works

that doesn't work with Chinese STLINK and STM32chip's with 4 wires SWCLK SWDIO NRST GND
Linux artbody 4.14.83-gentoo #1 SMP Mon Dec 3 23:46:25 CET 2018 x86_64 AMD FX(tm)-8350 Eight-Core Processor AuthenticAMD GNU/Linux

Return to “TrueSTUDIO for STM32 discussions”

Who is online

Users browsing this forum: No registered users and 1 guest