cancel
Showing results for 
Search instead for 
Did you mean: 

Black Pill: Debugging STM32F103RCT6 in Keil Fails to Enter main()

merose
Associate

Title edited to highlight that this is a "Black Pill" board


  • MCU: STM32F103RCT6

  • Toolchain: Keil MDK v5.31 + DAPLink debugger

  • Behavior:

    • Program flashes successfully via DAPLink.

    • Debug session starts but never enters main() – halts at address 0x200001E0 (check Disassembly/Register window).

    • All debug buttons (Step, Run) are grayed out except Reset/Stop.

  • Key Observations:

    • Same code runs correctly on another STM32F103 board.

    • Rebuild/Clean did not resolve the issue.

merose_0-1743582902994.png

The "Option for target" as below.

merose_1-1743583253545.png

merose_2-1743583272480.pngmerose_3-1743583294382.png

merose_4-1743583305233.png

merose_0-1743583956883.png

16 REPLIES 16

From the image you shared I bet this is not a genuine STM32.

mALLEm_0-1743598375796.png

- No "ARM " marking

- There is a notch and a hole-like on one of the corners.

- QR code for newer package versions?

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.

I can't comment on the MCUs itself or the boards, I have no access to those here, nor can I distinguish 'fakes'. But ...

Seeing the connection being made with single patch wires, are you sure it was the same both times ?
And using a black wire to connect to the positive supply voltage will surely confuse anyone "skilled in the art".

And in case this blackpill board has an onboard voltage regulator, you could try with +5V supply as well.

Yeah it has an onboard voltag regulator.

If the MCU itself is indeed a "fake", you don't know whats in it. And thus you can't predict it's behavior.
I don't know where these fake MCUs come from and how they they created. But obviously they work partially.

My suspicion is these chips are rejects from original ST production, bough up for next to nothing and housed professionally by some shady elements. Cloning an IC via reverse engineering is expensive and time consuming, and clones thus cannot undercut the original - if they share a market.

I would cut the losses, stop wasting time, and get proper MCUs.
If you have the equipment, you can unsolder the fakes from the boards and replace them with proper one's.


@Ozone wrote:

If the MCU itself is indeed a "fake", you don't know whats in it. And thus you can't predict it's behavior..


@merose  You might be able determine something using the this previously-mentioned utility:

https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-diags-v1.640.html

 


@Ozone wrote:

I don't know where these fake MCUs come from and how they they created. 


Some of them are bona-fide 3rd-party "compatible" chips - much like a huge number of manufacturers had (some still have) "8051-compatible" products.

Some of them might even be "enhanced" versions (again, like 8051/2).

Others may be just plain duds

See: https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-diags-v1.640.html#clones

and: https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-diags-v1.640.html#bluepill-mcu-candidates

Also: STM32 - Originals, Clones and Counterfeits

 

Another problem with buying from places like ali express, amazon, ebay is that you have no guarantee that any two boards will actually use the same chip.

That's one reason why they are cheap. You gets what you pays for!

 


@Ozone wrote:

I would cut the losses, stop wasting time, and get proper MCUs.


Absolutely!

@merose Get a genuine Nucleo board - which comes complete with a genuine ST-Link; eg,

https://www.st.com/en/evaluation-tools/nucleo-f103rb.html

At least, use that to get familiar with the part and the tools - then, maybe, you will be equipped to dig into what's going on with these fake/clone chips

 

#Fake #Clone #FakeSTM32 #CloneSTM32 #BlackPill #BluePill #Pill


@merose wrote:

Another board are the same as this one.


As already noted, there's no guarantee that a similar-looking board will actually have the same chip.

So, when one board like this works and another doesn't, all you can say is that one works and the other doesn't.

 

> Some of them are bona-fide 3rd-party "compatible" chips - much like a huge number of manufacturers had (some still have) "8051-compatible" products.

> Some of them might even be "enhanced" versions (again, like 8051/2).

> Others may be just plain duds

While it is kinda going off on a tangent ...

"Proper" clones, made by e.g. reverse engineering and copying the silicon, would make sense technically.
Quality/parameter issues would be a separate matter, as are legal issues. Some companies buy licences to use designs of other manufacturers, as AMD started out with licensing Intel's x86 designs. Putting a product/device in circulation with the same name as the original is never legal.

For reason of export restrictions, the Eastern Bloc reverse-engineered a lot of IC, including many 8-bit, 16-bit and 32-bit processor designs. Some were even modified. But those never shared a market with the original.

Partial duds are the most likely to expect, I think.
To make money with fakes they must be cheap. But 100% duds would be busted quickly.