2025-04-02 1:51 AM - last edited on 2025-04-02 3:18 AM by Andrew Neil
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.
The "Option for target" as below.
2025-04-02 2:00 AM
Hello @merose and welcome to the ST community,
Are you using Blue pill or Black pill board?
2025-04-02 2:03 AM
Welcome to the forum.
Please give details of your two boards - see: How to write your question to maximize your chances to find a solution.
@merose wrote:
MCU: STM32F103RCT6
Are you sure it's a genuine ST chip?
@merose wrote:
Debug session starts but never enters main() – halts at address 0x200001E0
So somewhere in the startup code.
Look at the startup code to see what should be happening ?
2025-04-02 2:08 AM
As usual, try to locate the "Run to main" setting in your debugging environment, and disable it.
The code obviously fails in the init code, most probably during clock setup.
If the same code runs properly on "another board", memory size and lication issues are unlikely - unless these are not the same kind of board.
Differently placed jumpers that affect settings might be another reason.
2025-04-02 2:10 AM
It's Black Pill. What's the difference between them?
2025-04-02 2:12 AM - edited 2025-04-02 2:23 AM
They at 99% contain a counterfeit STM32.
And this may confirm my saying:
Same code runs correctly on another STM32F103 board.
2025-04-02 2:22 AM
Thanks.I will try this.
2025-04-02 2:34 AM - edited 2025-04-02 2:35 AM
@mƎALLEm wrote:They at 99% contain a counterfeit STM32.
and that's being generous!
@merose read about it here: https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-diags-v1.640.html
And here's an example of the grief they can cause:
searching the forum will find many more!
@mƎALLEm wrote:And this may confirm my saying:
Same code runs correctly on another STM32F103 board.
Indeed.
@merose you still haven't said what the "other STM32F103 board" is.
2025-04-02 2:42 AM - edited 2025-04-02 3:26 AM
@Andrew Neil wrote:
@merose you still haven't said what the "other STM32F103 board" is.
Even if the "other STM32 board" is a black/blue pill, still the same thing: on one board is working on another not because it's, simply, contain a counterfeit MCU (not tested in the factory) ;).
2025-04-02 5:46 AM
This is what I use.Another board are the same as this one.