cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8T6 Debugging

JLall.2
Associate II

Hello I am trying to move a small io project to smaller chip. I am trying no code project just confirm enter debugger works.

STM32F103C8T6 

STM32Cube IDE 1.9

I Get ST-Link Error When attempting to debug. Reason(18) Could not verify ST device! Abort connection.

Error halting cpu. See attached. Any suggestions?

Open On-Chip Debugger 0.11.0+dev-00443-gcf12591 (2022-02-09-13:33) [ST Internal]

Licensed under GNU GPL v2

For bug reports, read

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

Info : Listening on port 6666 for tcl connections

Info : Listening on port 4444 for telnet connections

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

Info : Target voltage: 3.280321

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

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

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 : STM32F103C8Tx.cpu: external reset detected

Info : accepting 'gdb' connection on tcp/3333

target halted due to debug-request, current mode: Thread 

xPSR: 0x01000000 pc: 0x080000f0 msp: 0x20002800

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

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

Info : device id = 0x10010414

Info : flash size = 256kbytes

O.K.

O.K.:0xE00FFFD0

Info : dropped 'gdb' connection

shutdown command invoked

11 REPLIES 11

Board has counterfeit MCU on it.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Peter BENSCH
ST Employee

Yes, as @Community member​ mentioned, this again looks very much like a fake STM32, because the original STM32F103C8T6 has 64KB flash and reports ID 0x410, while yours reports 256KB flash and ID 0x414. No wonder that the STM32CubeIDE does not want to work with it.

Already wrote in another thread with exactly the same issue:

Unfortunately, the massive current demand, which has been impossible to satisfy for some time, is calling for counterfeiters with fakes on a large scale. They are found particularly often, for example, on the Blue Pill boards popular with beginners. Sometimes the fakes can be recognised by the markings used on the package, but sometimes they can only be recognised by details.

So if you mean the STM32 that is on the BluePill in your photo, then it is almost certainly a fake.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
gbm
Lead III

This is NOT an STM32F103 MCU, so the STLink refuses to talk to it. Real STM32 has an id of 0x1ba01477. You will not be able to debug it using the current version of ST-Link. You may either downgrade to the old version or use another BluePill with the proper firmware as CMSIS-DAP interface for debugging (but not from STM32CubeIDE).

Your MCU will execute the STM32F103 firmware programmed into it but ST tools don't support it since the are made to support only microcontrollers made by STM, not the clones.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
JLall.2
Associate II

Oh thanks for the info. The label make it look quite real.

Is there some way to make sure I get a real chip next time?

Like should I order directly from ST or something?

I guess I could swap out the chips or something.

For the time being did you say there is some older version of STLink that supports these fake ones until I can find some real ones? I have been using a STm32f4-discovery from st up until now. I would like to use a smaller package for a small io project though so It thought I would move to this chip because there was so much info on internet about it. I like using the STM32CubeIDE so I would like to continue to use it. if possible.

I would imagine that open ocd could possibly be modified or slightly different chip used but it would like you said not align with the original project.

I understand if you do not want to help support random chips with official ST stuff like STM32CubeIDE so that would be fine too. Perhaps I could ask open OCD for slight mod or something like that for these 10 dev boards i got.

Then when I make my boards I can order chips directly from ST or something like that to make sure I get real ones?

JLall.2
Associate II

To be honest I got 10 of the cheap boards because there was a good canbus tutorial online that used that board, I ported it to the STM32F4 and it worked so I was like ohh good, and I am making a small 10 node simple can setup to test some software and stuff for future use so I was like i will order some of those blue pill boards from the example with the STM32F103C8T6

The funny thing is I already have STM32F103C8T6 chip on the STm32F4-disovery board as the debugger circuit.....I noticed the STM32F1 has one can bus interface and smaller io count and is cheaper than the STM32F4 on the Discovery board so I thought I would try that for example a simple stand alone push button / gpio canbus device or an analog knob on canbus type thing. I just want to play around with a can network and get the feel for what is possible that type of thing.

The nucleo line looks good....but the example i ran into was blue pill so I was more inclined to do that..it was funny to me that the neucleo basically has a bluepill on there as the debugger...lol...or should I say the blue pill is a copy of that debugger circuit.

If I cannot get this batch to work with STM32CubeIDE or find a good debugger for these or a good source of these chips perhaps I should order 10 nucleos or something like that for small can bus test setup before making my own boards. and go with the nucleo chips STM32L432KC I think those are lower powered so that is nice. is there a good canbus example for the nucleo 32 I think that would be a good option as well.

I just see the STM32F103C8T6 all over the place so it makes me more comfortable to proceed with that one.

Perhaps We should keep this on topic here though. Should I contact Open OCD to see if this chip can be added to some extra unofficial setting that can be used in STM32CubeIDE for the time being or should I consider these chips not valid for the 10 can node test setup using SMT32CubeIDE and try to order some more and hope they have good chips on them lol.

JLall.2
Associate II

I ported this

https://www.youtube.com/watch?v=JfWlIY0zAIc

To my STM32F4 and it worked. So I was like 10 blue pills please for multi node test...lol...now stuck.

Probably would have gone nucleo if there was a comparable nucleo 32 example. I would prefer the lower powered device. ;) oooooooh welll..... again is see the STM32F103C8T6 everywhere...like every board with an stlink built onto it...the maple dev board...the blue pills...I think they are all copies of the stlink v2 scematic lol...ohhhh welll...

I think it would be entertaining to fix the compiler for the random ones I got but I am not sure if that is official or if I should even put it on here or over at the ocd forum now so as not to annoy st themselves into supporting other peoples products...I am still a little confused as to how the label ended up so official looking though lol.

@JLall.2​  "Is there some way to make sure I get a real chip next time?"

I don't think there's any 100% foolproof way - even famous names have been caught out; eg, https://blog.adafruit.com/2011/08/11/counterfeit-parts-are-a-big-headache/

The main thing is to only buy from reputable sources - which probably, sadly, rules out the BluePill. :\

JLall.2
Associate II

Well I think that answers that question. I cant find another F1 board with the small package, usb portl and crystal populated at the moment so I will probably try and order some STM32F103C8T6 from the st link to digi key and swap them out and see how that goes. Thanks for the help. I see another forum post where someone looks to have success with that so it sounds like I am in a similar situation and will try that route when I get some time.

JLall.2
Associate II

I can only flash these by jumping the boot pins and sending data over a usb to ttl uart adapter like this example here. Obviously that does not allow for debugging though so I will try and order some genuine chips for that.

https://circuitdigest.com/microcontroller-projects/programming-stm32f103c8-board-using-usb-port

I would imagine I could also setup open ocd to use the other chips but I think that is for another forum since these are not ST parts so I will leave that discussion for some other place. Thanks again for the help.