Skip to main content
Associate II
January 24, 2021
Solved

IAR on a Blue Pill: "Fatal Error: The selected device Does not match the target device"

  • January 24, 2021
  • 4 replies
  • 2932 views

Good day, everyone.

I'm trying to learn the tools for programming the STM devices.

I've purchased a BluePill development board on AliExpress. The chip on it says STM32F103C8, but when I use the CubeMX, it replies the CPUID is 0x2ba01477.

I've been trying to flash this particular chip using an IAR workbench (ver. 8.50.9), but I keep getting the above message.

I'm doing a simple code, blinking the PC13 once per 1M cycles.

Can anyone help me with this issue?

I'll happily share any info related.

This topic has been closed for replies.
Best answer by Peter BENSCH

This thread relates to a so-called Blue Pill, which uses illegally cloned STM32F103. ST resources are only dedicated to supporting genuine ST products. We are not committed to ensuring that clones/fakes products work properly with the firmware we provide.

We recommend to purchase genuine products from STMicroelectronics and purchase them from known and trusted distributors.

This thread will now be locked. However, if you face difficulties while using genuine ST products, we’re here to assist you. Please feel free to start a new thread, and our team, along with community members, will be ready to help you with any issues/questions you encounter.

Thank you for your understanding.

Regards
/Peter

4 replies

Vangelis Fortounas
Associate II
January 24, 2021

Hello

first go to MENU->project-> options and check the connected device

0693W000007CRlBQAW.jpgUse STLink utility from here

Upgrade firware of stlink to the latest version from within utility

use utility to check the type of mcu.

BGor.1Author
Associate II
January 24, 2021

Hi, Vangelis Fortounas, thanks for answering!

My IAR project is set to compile for STM32F103C8:

I've upgraded my ST-Link utility from 4.5.5 to the latest 4.6.0 and then checked my ST-LINK V2.0 dongle's version. It was the latest: "V2.J37.S7".

I've reflashed it just in case.

The board seem to have the chip in question:

Can I do anything to make it work with IAR?

waclawek.jan
Super User
January 24, 2021

> The chip on it says STM32F103C8, but when I use the CubeMX, it replies the CPUID is 0x2ba01477.

It's not an STM32, but a counterfeit.

https://www.eevblog.com/forum/microcontrollers/cheap-bluepill-very-likely-it-has-fake-stm32-right/

JW

BGor.1Author
Associate II
January 27, 2021

Yeap, I saw this post earlier.

Looks like you're right, I got the remarked CKS chip instead of STM..

Do you know of a way to make IAR work with this chip?

Vangelis Fortounas
Associate II
January 25, 2021

I just observed the id in my Keil's debug tab and did some search in Ref Manuals

0x2BA01477 is the DEVID for SW_DP of Cortex M4 as per 32F407VE RM0090

0x1BA01477 is the DEVID for SW_DP of Cortex M4 as per 32L4xxx RM0351

0x1BA01477 is the DEVID for SW_DP of Cortex M3 as per 32F10x RM0008

BGor.1Author
Associate II
January 27, 2021

The same DEVID for F10x and for L4xxx?

Or should it be the same for true ST chips and counterfeit chips are made with different DEVID?

Peter BENSCH
Peter BENSCHBest answer
Technical Moderator
April 25, 2025

This thread relates to a so-called Blue Pill, which uses illegally cloned STM32F103. ST resources are only dedicated to supporting genuine ST products. We are not committed to ensuring that clones/fakes products work properly with the firmware we provide.

We recommend to purchase genuine products from STMicroelectronics and purchase them from known and trusted distributors.

This thread will now be locked. However, if you face difficulties while using genuine ST products, we’re here to assist you. Please feel free to start a new thread, and our team, along with community members, will be ready to help you with any issues/questions you encounter.

Thank you for your understanding.

Regards
/Peter