3

trying to program and debug STM32F103 (Bluepill) from Atollic TrueStudio 9.3 I got following message:

STMicroelectronics ST-LINK GDB server. Version 5.1.0 Copyright (c) 2018, 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

Vendor = 0x55

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

Trying to do the same thing in St-Link utility works without any problems (also erasing and programming):

enter image description here

What could be the problem with this, why does it have problems with verification ?

Tnx for helping in advance!

Blue
  • 820
  • 4
  • 17
user505160
  • 1,176
  • 8
  • 25
  • 44

2 Answers2

4

The problem is that the ID of the STM32F103 on the BluePill and the ID, defined the debugger config files are different. Often the BluePills have counterfeit ICs on them in order to keep the price low, but these do not have the same ID as genuine ICs.

The Instructions/video below are made for STM32CubeIDE however they should also work for TrueSTUDIO.

Video about a workaround: https://youtu.be/bJYp8o7FoYo

  1. Open the Debug Configuration Window Open the Debug Configuration Window

  2. Select ST-LINK(OpenOCD) in the Debug Probe Dropdown Select ST-LINK(OpenOCD) in the Debug Probe Dropdown

  3. Search stm32f1x.cfg file the C:\ST\STM32CubeIDE_1.2.0\STM32CubeIDE and open it using notepad.

  4. Search for this Line Search for this Line

  5. Now change the ID from 0x1ba01477 to 0x2ba01477 as shown here Now change the ID from 0x1ba01477 to 0x2ba01477 as shown here

  6. Save the file, now debugging should work

rkta
  • 3,959
  • 7
  • 25
  • 37
Mampfi
  • 43
  • 5
  • 1
    Please edit your answer to summarize the workaround. While links for more information are welcome, answers should stand on their own without them—and especially since external links often end up changing or the content deleted. Without that, you are summarizing the problem, but aren’t offering a solution. – Jeremy Caney May 15 '20 at 03:40
0

this solution also works for clone chips like CH32F103 which is in some cases on BluePill

the other solution is to change a parameter in "stm32f1x.cfg" open it with a text editor and find this line: swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

change "$_CPUTAPID" to zero at the end of line it should be like this: swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0

after that :Open the Debug Configuration Window like picture above and choose "Select ST-LINK(OpenOCD)" in the Debug Probe Dropdown then click "Show generator options…” and in Mode setup change"Reset Mode”For“Software system reset”.

both of ways works and i've tested them with CubeIDE and CH32f103c8t6.

remember to change jumper on board jumpers : up = 0 ; down = 1