cancel
Showing results for 
Search instead for 
Did you mean: 

How can i fix the error: Reason: (4) No device found on target. on the STM32G0316-DISCO board?

FMaie.1
Associate II

Hello everyone, i am trying build a capacitive Touch sensor with the help of the STM32G0316-DISCO board. Right now i am stuck with the following error-message:

Error in final launch sequence:

Error in initializing ST-LINK device.

Reason: (4) No device found on target.

Error in initializing ST-LINK device.

Reason: (4) No device found on target.

(I am using STM32CubeIDE btw)

This Error message apeared after i tryed to debug my code while having a 1 MOhm resistor between the pins PA14-BOOT0 (digital input) and PA13 (digital output). And oh yeah i tried a blick LED-Scatch before so my USB-Connector is working.

Any help is much appreciated!😀

7 REPLIES 7
KnarfB
Principal III

Maybe the resistor changed the boot mode? You can override (disable) the BOOT0 function by programming some user bytes using STM32CubeProgrammer.

FMaie.1
Associate II

I don't know if i am doing it right. But if i connect the discoveryboard and select USB as connections-type i just get the message:

21:51:33 : Error: Establishing connection with device failed

Could it be that, because i gave pin PA14-BOOT0 a new purpose as Input (It acts as output sometimes too), i override the BOOT0 mechanism?

KnarfB
Principal III

> 21:51:33 : Error: Establishing connection with device failed

Thats from STM32CubeProgrammer, right?

Did you try several reset modes including Hardware Reset?

FMaie.1
Associate II

Yeah it is. I also just tried the "Full Chip Erase"-Option in the CubeProgrammer, which didn't help, because it just made the CubeProgrammer not responsive.

I also tried to connect the BOOT_0 pin with 3,3V at start up (I read that in another thread). This stopped the toogling of the pins that would normaly toogle without that connection. I tried to programm it after but the error "No device found on target" still apeared. But i feel like this might be something. Can this somehow fix my problem? Also thank for the help until now!

The SWD debug interface is on PA14 + PA13. If you remove the resistor and everything connected to those pins, you should hopefully be able to connect to the chip right after a hardware reset.

FMaie.1
Associate II

Just to be clear. Right now i have the VDD pin connected to the PA14/BOOT0 pin (Is this the hardware reset?). Nothing else is connected. Then i connect it to my Computer. If i try to program it with the CubeIde i still get the same error. On the Programmer i get "21:30:56 : Error: Activating device: KO. Please, verify the boot mode configuration and check the serial port configuration. Reset your device then try again..." when i select UART. With OTA the programm stops working. With ST-LINK no target is found. The same with UART. And if i try to fully erase it i get this "21:35:42 : Error: Connection to target must be established before performing the erase command."

KnarfB
Principal III

PA14 is not only BOOT0 but also SWCLK for SWD Debug (ST-LINK). If you tie that pin to a fixed potential, ST-LINK cannot work.

Reference manual RM0444 Rev 2 says "Note: PA14 is shared with BOOT0 functionality. Caution is required as the debugging device can

manipulate BOOT0 pin value." But does not explain further details. So, as long as you intend to debug, I would not touch those pins at all.

UART and OTA are different options commonly called IAP (in-application programming) wich are good for programming a device using alternate interfaces, but not for interactive debugging or flashing using SWD.