2024-04-29 05:11 AM - last edited on 2024-11-26 01:28 AM by Andrew Neil
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?
Solved! Go to Solution.
2024-04-30 03:51 AM
Oo....serial nr. 4 :)
You have also a fake /non STM chip on the st-link - thats why its not working !
2024-04-30 04:34 AM
@AScha.3 wrote:You have also a fake /non STM chip on the st-link - that's why its not working !
:face_with_tears_of_joy::grinning_face_with_sweat::face_with_tears_of_joy::grinning_face_with_sweat::face_with_tears_of_joy::grinning_face_with_sweat::face_with_tears_of_joy::grinning_face_with_sweat::face_with_tears_of_joy::grinning_face_with_sweat::face_with_tears_of_joy::grinning_face_with_sweat::face_with_tears_of_joy::grinning_face_with_sweat::face_with_tears_of_joy::grinning_face_with_sweat::face_with_tears_of_joy::grinning_face_with_sweat::face_with_tears_of_joy::grinning_face_with_sweat:
@IMumt.1 this is what real ST-Link serial numbers look like:
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 !
2024-04-30 04:49 AM
It's always the same: if you buy cheap, you buy twice. Or even more often.
2024-04-30 05:15 AM
I tried reading the serial number of st link using st-link utility and got this.
I was able to see a similar or the same serial number in keil however, now i only see "4".
I also tried to flash a blink file (compiled using arduino IDE) using st-link utility and was successful.
2024-04-30 06:27 AM - edited 2024-07-31 03:08 AM
So are you using a genuine ST-Link, or a fake/clone?
Note that anything looking like this is a fake/clone:
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!
2024-05-01 06:41 PM
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.
2024-05-02 02:13 AM
I agree to your suggestion and I have borrowed a Nucleo board, from my friend, for experimentation. Anyways, xisco, thanks!
2024-05-02 02:20 AM
@IMumt.1 wrote:I agree to your suggestion
I think it might also have been suggested by others ... ?
:thinking_face:
@IMumt.1 wrote:I have borrowed a Nucleo board, from my friend, for experimentation.
Excellent choice!
:thumbs_up::clapping_hands:
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 ?
If you were using the Arduino serial bootloader, that would explain why the Arduino IDE could program successfully.
2024-05-02 02:25 AM
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!
2024-05-02 02:44 AM - edited 2024-05-02 02:48 AM
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!
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