cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 CubeIDE 1.5 with STlink v2: No device found on target. Is it my mistake or is it the software from STM?

KZeil.1
Associate

Basically I got the tool chain working on Linux Mint 20.0 with the STM32 CubeIDE v1.5.0, downloaded and installed today.

My device is a Blue Pill (genuine STM32F103C8T6).

It's connected with an STlink v2 via SWD (Firmware version V2J37S7).

Boot0 and Boot1 are both high via a 100k resistor to 3V3. I can program the device with PlatformIO, but not with the CubeIDE from STM. The Error Message:

Error in final launch sequence:
 
Failed to start GDB server
Failed to start GDB server
Error in initializing ST-LINK device.
Reason: (4) No device found on target.

The Console output:

STMicroelectronics ST-LINK GDB server. Version 5.7.0
Copyright (c) 2020, STMicroelectronics. All rights reserved.
 
Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 1
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Disabled
        SWD Debug                  : Enabled
        InitWhile                  : Enabled
 
Target no device found
 
Error in initializing ST-LINK device.
Reason: No device found on target.

Currently I have 2 workarounds:

  1. set Boot0 to GND, push reset and then start the programming, wait for finished download to the device, set Boot0 pin to 3V3 (via 100k resistor) again, press reset, now the new program is running.
  2. Use the STM32CubeProgrammer tool, select "Under Reset" for connection mode, press and hold reset button, click connect and release the reset button. Now I can do a full chip erase. Then disconnect in CubeProgrammer and do a power-on-reset of the device, just to be sure. Now click on Run in CubeIDE - works now as expected. This is the console output:
STMicroelectronics ST-LINK GDB server. Version 5.7.0
Copyright (c) 2020, STMicroelectronics. All rights reserved.
 
Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 1
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Disabled
        SWD Debug                  : Enabled
        InitWhile                  : Enabled
 
Waiting for debugger connection...
Debugger connected
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.6.0-RC3                  
      -------------------------------------------------------------------
 
ST-LINK SN  : 36FF6A064D59303621422343
ST-LINK FW  : V2J37S7
Board       : --
Voltage     : 3,24V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x410
Revision ID : Rev X
Device name : STM32F101/F102/F103 Medium-density
Flash size  : 64 KBytes
Device type : MCU
Device CPU  : Cortex-M3
 
 
 
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_EKblf8.srec
  File          : ST-LINK_GDB_server_EKblf8.srec
  Size          : 8756 Bytes
  Address       : 0x08000000 
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 8]
Download in Progress:
 
 
File download complete
Time elapsed during download operation: 00:00:00.613
 
 
 
Verifying ...
 
 
 
 
Download verified successfully 
 
 
Error in executing 'detach' command ... 
Debugger connection lost.
Shutting down...

1 REPLY 1
TDK
Guru

> set Boot0 pin to 3V3 (via 100k resistor) again, press reset, now the new program is running

Are you sure? Setting BOOT0 high during will run the built-in bootloader, not your program.

If you feel a post has answered your question, please click "Accept as Solution".