cancel
Showing results for 
Search instead for 
Did you mean: 

Blue pill (STM32F1) board gets programmed through Arduino IDE but not using Keil, chip ID:0x2BA01477

IMumt.1
Associate II

I am trying to program STM32 Blue pill board using Keil, and it gives the following error: "Connection refused due to device mismatch; Device connected to debug unit is different from device selected for project target STMicroelectronics STM32F103C8." I am using ST-Link debugger for programming as it does not have on-board ST-debugger. The issue is that it reads chip ID:0x2BA01477, which, I have read on other forums, is the ID read when your board uses clone instead of real STM32F103C8T6. Still, I want to program it using Keil. When I program the same setup using Arduino IDE, it is gets programmed in a perfectly fine way. Is there any other way to resolve this error in Keil using the same board or there is no other option left but to replace the board?

39 REPLIES 39

Oo....serial nr. 4   🙂

You have also a fake /non STM chip on the st-link - thats why its not working !

If you feel a post has answered your question, please click "Accept as Solution".

@AScha.3 wrote:

You have also a fake /non STM chip on the st-link - that's why its not working !


😂😅😂😅😂😅😂😅😂😅😂😅😂😅😂😅😂😅😂😅

@IMumt.1 this is what real ST-Link serial numbers look like:

AndrewNeil_0-1714476631641.png

 

So another benefit of getting a e NUCLEO-F103RB is that it comes complete with a genuine ST-Link.

You really are reaping all the benefits of all this fake/clone kit !

Peter BENSCH
ST Employee

It's always the same: if you buy cheap, you buy twice. Or even more often.

 

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.
IMumt.1
Associate II

I tried reading the serial number of st link using st-link utility and got this.

 

IMumt1_1-1714478780052.png

I was able to see a similar or the same serial number in keil however, now i only see "4".

IMumt1_2-1714478897721.png

I also tried to flash a blink file (compiled using arduino IDE) using st-link utility and was successful.

IMumt1_3-1714479168479.png

 

So are you using a genuine ST-Link, or a fake/clone?

Note that anything looking like this is a fake/clone:

 

AndrewNeil_1-1714483166044.png

Another one of the "benefits" (sic) of these fake/clone ST-Links is that do not have consistent pinouts - they can be different, even when bought from the same place!

See: https://community.st.com/t5/stm32-mcus-products/debug-problem-with-clone-st-linkv2/m-p/661306/highlight/true#M240845 

 

#FakeSTLink #CloneSTLink

xisco
Associate III

Hello,

I will tell you my short history with microcontrollers.

I started with a Raspberry Pi bought around 2016. I made big projects with it, but there's no need a complete computer for most projects.

Around 2020, I tried Arduino. I thought it wasn't bad... but I soon found it had many limitations and errors.

And I heard about ST.

I bought a two blue pills (f103c8t6 and f103c6t6). In those days, the chips were STM32 originals.

I started to love this brand. Thousands of chips, you can select the features you need, 32 bits, fast, ... perfect.

I bought some f103c6t6 and lots of g030f6p6 with adapter boards. All working fine.

BUT THE PIRATES ARRIVED :(

I bought some blue pills more and began with programming problems. Bought on other sellers, but none original.

The solution was buying a nucleo board. I bought the NUCLEO F446RE for developing projects without limitations, and later make a board with a mcu adapted to project requirements.

 

So, my answer for your question is:

Replace the board and you won't waste as much time and money as I did.

Buying on official ST sellers is cheaper, faster and safer than big internet sellers.

 

I agree to your suggestion and I have borrowed a Nucleo board, from my friend, for experimentation. Anyways, xisco, thanks!


@IMumt.1 wrote:

I agree to your suggestion 


I think it might also have been suggested by others ... ?

🤔

 


@IMumt.1 wrote:

 I have borrowed a Nucleo board, from my friend, for experimentation. 


Excellent choice!

👍👏

Now please mark the solution.

 

PS

I don't think you ever answered this question:

 


@Andrew Neil wrote:

@IMumt.1 wrote:

 When I program the same setup using Arduino IDE, it is gets programmed in a perfectly fine way. 


Is that using an ST-Link (or any other SWD programmer), or the Arduino serial bootloader ?



https://community.st.com/t5/stm32-mcus-products/blue-pill-stm32f1-board-gets-programmed-through-arduino-ide-but/m-p/667932/highlight/true#M242510

 

If you were using the Arduino serial bootloader, that would explain why the Arduino IDE could program successfully.

 

Arduino IDE is using ST-Link for programming. The same debugger setup using ST-link which is not being programmed, is being programmed using Arduino IDE.I repeat, the hardware setup is exactly the same in Keil and Arduino IDE but one works and other does not!

It's been established that the reason Keil won't program the board is exactly as it says in its error message - you have the wrong chip on the board!

https://community.st.com/t5/stm32-mcus-products/blue-pill-stm32f1-board-gets-programmed-through-arduino-ide-but/m-p/668310/highlight/true#M242621 

 

Presumably, the Arduino IDE just doesn't make that check.

The Arduino IDE forum would be the bast place to ask about that:

https://forum.arduino.cc/c/software/ide-2-x/93