Skip to main content
Visitor II
October 14, 2019
Question

How to deal wirh : Could not verify ST device! ?

  • October 14, 2019
  • 7 replies
  • 18431 views

Dear all,

Could not verify ST device!

This error popped up suddenly and blocks any progress. I took an older computer and had the same error again.

Therefore, I suspected a hardware failure and ordered new adapters and processor boards, but I kept having the same error again.

I have upgraded the STM32CubeIDE, the st-link drivers (dpinst_amd64.exe) and st-stlink-server(st-stlink-server.1.1.1-3.msi).

The st_link v2 adapter have been upgraded with the latest firmware.

Using STM32 Link Utility, I was able to program, verify and run blink applications.

I am using BluePills (STM32F103C8) with chinese adapters on a 64 bit Windows 10 machine.

Please find below the output produced when starting debugging in STM2CubeIDE using the GDB server in SWD mode.

I also selected the OPENOCD debugger, but it also failed, though in a different way.(see below)

Does anyone have a suggestion how to proceed on this?

Cheers, Paul

..........................ST-LINK GDB server.....................

STMicroelectronics ST-LINK GDB server. Version 5.2.3

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

Starting server with the following options:

    Persistent Mode      : Disabled

    LogFile Name        : C:\Users\Paul_2\Documents\STM32\Workspace\test\Debug\st-link_gdbserver_log.txt

    Logging Level       : 31

    Listen Port Number     : 61234

    Status Refresh Delay    : 15s

    Verbose Mode        : Enabled

    SWD Debug         : Enabled

Hardware watchpoint supported by the target 

SWD frequency = 4000 kHz

ST-LINK Firmware version : V2J31S7

Device ID: 0x410

PC: 0xc6640804

ST-LINK device status: HALT_MODE

ST-LINK detects target voltage = 3.17 V

Vendor = 0x55 

Error in initializing ST-LINK device.

Reason: ST-LINK: Could not verify ST device! Abort connection.

......................OPENOCD.........................................

Open On-Chip Debugger 0.10.0+dev-00021-g524e8c8 (2019-04-23-20:37)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

adapter speed: 8000 kHz

adapter_nsrst_delay: 100

Info : Listening on port 6666 for tcl connections

Info : Listening on port 4444 for telnet connections

Info : clock speed 8000 kHz

Info : STLINK v2 JTAG v31 API v2 SWIM v7 VID 0x0483 PID 0x3748

Info : using stlink api v2

Info : Target voltage: 3.166882

Info : Unable to match requested speed 8000 kHz, using 4000 kHz

Info : Stlink adapter speed set to 4000 kHz

Warn : UNEXPECTED idcode: 0x2ba01477

Error: expected 1 of 1: 0x1ba01477

in procedure 'init' 

in procedure 'ocd_bouncer'

    This topic has been closed for replies.

    7 replies

    Graduate II
    October 15, 2019

    Hi !

    I am not very fluent in SWD, but the verbose output from Open OCD helps to identify the issue : the ID read by both tools differs from what is expected. Meaning that the error is the same in both cases.

    Your device under test reads back 0x2ba01477 while the tools expect 0x1ba01477. I don't think it can be an electrical problem. Since you are using a bluepill, maybe the microcontroller is a counterfeit product. You should ST about this, perhaps with a picture of the uC.

    PZwarAuthor
    Visitor II
    October 17, 2019

    Could not verify ST device!

    Thank you so much, Kraal!

    I inspected the looks of the chip and found it quite different from the ones I used before.

    The text was not engraved but printed in a sloppy way. I think that your suggestion of a counterfeit is right.

    I tried to make these counterfeits working under STM32CUBEIDE and OpenOCD.

    Therefore, I adapted the st_scripts/target/stm32f1x.cfg file by replacing the 0x1ba01477 by 0x2ba01477.

    I also added a line:

    reset_config trst_only

    This gives a error message:

    Error: BUG: can't assert SRST

    Neverthless, I could load and debug my code.

    Visitor II
    March 16, 2020

    Hi PZwar,

    I have the same problem.

    However I am unable to locate the "st_scripts/target/stm32f1x.cfg" file or folder on windows 10.

    Using STM32CUBEIDE and OpenOCD.

    Thanks & regards

    =====================Debug log =========================================

    Open On-Chip Debugger 0.10.0+dev-01193-g5ce997d (2020-02-20-10:57)

    Licensed under GNU GPL v2

    For bug reports, read

    http://openocd.org/doc/doxygen/bugs.html

    srst_only separate srst_nogate srst_open_drain connect_assert_srst

    Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

    adapter speed: 4000 kHz

    adapter_nsrst_delay: 100

    Info : Listening on port 6666 for tcl connections

    Info : Listening on port 4444 for telnet connections

    Info : clock speed 4000 kHz

    Info : connected to stlink-server

    Info : stlink-server API v1, version 1.3.0

    Info : STLINK V2J36S7 (API v2) VID:PID 0483:3748

    Info : using stlink api v2

    Info : Target voltage: 3.180552

    Info : SRST line asserted

    Warn : UNEXPECTED idcode: 0x2ba01477

    Error: expected 1 of 1: 0x1ba01477

    Graduate II
    October 17, 2019

    Hi Paul,

    I'm glad you find a way to use your dev board even if the device ID is not correct.

    I would add that for test or learning purpose it is OKish to use the bluepill with the strange part as it is, but for anything that goes into production you should always use real product.

    Best regards,

    Kraal

    Visitor II
    March 17, 2020

    Hmm the MSB bits of the ID Code register are just a version number so 2 means newer than 1.. ?

    http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.100230_0002_00_en/Chunk424975896.html

    Visitor II
    September 30, 2020

    So you tweaked the config files for the openocd server, but what if I want to use the ST-Link GDB Server and not Openocd?

    Graduate II
    September 30, 2020

    Might want to consider using authentic ST parts rather than GigaDevices clones.

    Visitor II
    September 30, 2020

    Luckily I also ordered some replacement STM32F103 MCU's and soldered them onto the blue pill. They seem to have a correct vendor id and work with CubeIDE... ;).

    PZwarAuthor
    Visitor II
    September 30, 2020

    I'm sorry, I do not have a solution for that.

    ST Employee
    December 19, 2023

    This forum thread was marked by the moderator as needing a little more investigation, so a Support case was created in your name and will be handled off-line.

    Visitor II
    May 24, 2024

    Info : STLINK V2J44M29 (API v2) VID:PID 0483:374B
    Info : Target voltage: 3.189084
    Info : clock speed 4000 kHz
    Info : stlink_dap_op_connect(connect)
    Info : SWD DPIDR 0x2ba01477
    Info : [STM32F103C8Tx.cpu] Cortex-M3 r2p0 processor detected
    Info : [STM32F103C8Tx.cpu] target has 6 breakpoints, 4 watchpoints
    Info : starting gdb server for STM32F103C8Tx.cpu on 3333
    Info : Listening on port 3333 for gdb connections
    Info : accepting 'gdb' connection on tcp/3333
    [STM32F103C8Tx.cpu] halted due to debug-request, current mode: Handler HardFault
    xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffd8
    Info : device id = 0x20030410
    Info : flash size = 128 KiB
    shutdown command invoked
    Info : dropped 'gdb' connection

     

     

    [STM32F103C8Tx.cpu] halted due to debug-request, current mode: Handler HardFault
    xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffd8

    facing this error in

    STM32F103C8T6 board

    could not verify the st device