Skip to main content
Visitor II
April 29, 2024
Solved

Blue pill (STM32F1) programs OK via Arduino IDE but not Keil. Chip ID:0x2BA01477

  • April 29, 2024
  • 13 replies
  • 20870 views

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?

    This topic has been closed for replies.
    Best answer by Andrew Neil

    @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 ?



    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.

     

    13 replies

    IMumt.1Author
    Visitor II
    April 30, 2024

    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

     

    Super User
    April 30, 2024

    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 

     

     

    Graduate II
    May 2, 2024

    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.

     

    IMumt.1Author
    Visitor II
    May 2, 2024

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

    Super User
    May 2, 2024

    @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 ?



    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.

     

    Visitor II
    October 6, 2024

    I encountered the same problem today. I searched the community and found that it was because I bought a counterfeit chip.
    But it can also be burned using ST-LINK. Just remove the √ sign from the options marked in the picture.

     

    This post has been translated from Chinese to comply with the ST Community guidelines.

     
     
    Explorer
    November 25, 2024

    Thanks!