Service Hotline
Recently, embedded ARM shared an article "GD32 has also begun to be flooded with fakes.》Article, Stronger Huang, an old friend of embedded ARM, also said that his technical exchange group is discussingChip prices riseandSell chips on salted fishtopic and wrote an article revealing the background and methods of identifying refurbished fakes. It is hereby reproduced for your reference.
1
Background of chip price increaseThe Sino-US war in the past two years has affected some large domestic technology companies, such as Huawei. However, most electronics-related companies have been minimally affected.
In 2020, an epidemic caused a big blow to some semiconductor companies, such as workers' strikes.
Then, the prices of some raw materials began to rise to varying degrees. Especially since the beginning of this year, the prices of most raw materials such as metals and plastics have increased. Prices for everything from resistors and capacitors to consumer electronics such as TVs and refrigerators have increased to varying degrees.
(Picture source from the Internet, infringement and deletion)The same is true for chips. The prices of the MCUs we are familiar with have increased to varying degrees. I believe everyone knows it. In particular, the prices of some STM32 models have even increased several times.
In the context of this price increase, there must be some unscrupulous merchants, and then the probability of fake products increases.
2
STM32/GD32 refurbished or fakeExperienced engineers may have encountered the problem of refurbished or fake STM32/GD32, including me before, who erased the GD32 logo and then made it STM32, or refurbished STM32 removed from the old board.
Let’s talk about some situations of chip refurbishment or fake products:
1. Erase flag
The chip erasure mark is very common, including the products we sometimes develop. In order to prevent others from copying the chip, the mark on the surface of the chip may also be erased to prevent copycats.
Some businesses will use this "civet cat for prince" method to make profits. Some compatible chips, such as STM32 in the early days, I knew that many of them were fake GD32.
2.Fake model
The actual size of the Flash inside the STM32 may not match the model. For example: the standard capacity of STM32F103RF is 768K, but the actual Flash size is more than 768K.
This extends the topic: Is the FLASH capacity of your STM32 chip really as good as ST’s official selection manual?
1 Let’s talk about something else first
Generally, for beginners, the internal FLASH is completely sufficient. Running a simple bare metal Demo, or a RTOS plus two task Demo, has no pressure on current MCUs at all.
However, once you come into contact with actual projects, you will find thatMany places will spend FLASH, and some projects take up a lot of FLASH. For example: a specific algorithm, loading a font library, or even putting two pictures in FLASH.
Take another example of IAP application programming: Generally, those that do a better job of upgrading this function will have a FLASH area (backup area) that is about the same size as the application. That is to say: To ensure safety, save your program download in a backup area, and then update the application after the download is successful. The purpose of doing this:This is to prevent the download from being disconnected midway, causing failure.。
I found a picture, roughly as follows, which divides FLASH into three areas (boot program FLASH area, application FLASH area, and backup program FLASH area). Think about it.
2 STM32 chip selection
Generally, after our project puts forward the requirements, we will choose a suitable MCU. The first thing that comes to mind is to check the [Selection Manual]. In addition to selecting peripheral resources, there is also the selection of a suitable FLASH capacity. STM32 product command rules are as follows:
Selection manual address: https://www.stmcu.com.cn/upload/selection_Guide.pdf (WeChat official account does not support external links, copy the URL to open)
3 Verify how big the internal FLASH of STM32 is
After talking about some topics about FLASH, let’s come back to the key points of this article:Our STM32 internal FLASH may be larger than what is stated in the selection manual above.。
For example: The specific model of my MCU chip is STM32F103RF. Looking at the manual, I can see that its capacity is 768K, but it actually has a FLASH capacity of 1M.
Here I will talk about two simple verification methods:
1. Verify through programming
Simply put, it is through erasing, writing, and reading the specified address (that is, the address exceeding the FLASH size).
FLASH_EraseSector FLASH_ProgramWord
2. Read FLASH data through tools
This method is the most direct and simplest method. Take the STM32 ST-LINK Utility download tool as an example:
The key points are actually described in the picture:If the address exceeds 768K, the data can actually be read out.. (The picture above is what I read out with the STM32F103RF real MCU. The starting address of the application is 0x080C0000, and the application is actually running)
Having said so much, what I actually want to say is: there are many STM32 chips that are similar, not just the STM32F103RF I gave an example above, the 103RC is nominally 256K, but it actually has more than 256K space. If you find that your FLASH space is insufficient, you can use the above method to see if there is more space than that.
3. Refurbished to original and authentic productsThis kind is the most common on certain products. The kind that looks cheap. If you buy a few at retail, they will be shipped. These are likely to be refurbished chips.
If you buy a refurbished chip, you can write an LED running light to test it and there will be no problem. However, after you join a project, especially a project that requires more peripherals and has more complex functions, your original shape may soon be revealed.
If you are unlucky, the following situations may occur:
-
The software worked overtime for several days without any results, and the hardware was blamed;
-
Various tests on hardware flying wires, replacing a chip to solve the problem;
- Software and hardware engineers fight;
- ······
Therefore, it is not surprising that there are many fakes or defective chips on the market now, including embedded ARM saying that "GD32 has also begun to flood with fakes." I think it must exist.
3
Identify refurbished or fake productsTo identify refurbished or fake STM32/GD32, the conventional operation is to first solder it on the PCB board (or on the tooling fixture), then power it on to see if it is normal. If it is hot, has excessive current, or even smokes, be careful.Then read the chip information, such as Flash capacity, UID information, option bytes, etc.
Sharing previous articles here:Do you know about these registers of STM32?
The specific method of reading is as follows:
1 Flash capacity register
1. By reading the register
In the "Reference Manual" of STM32, there is a register such as Flash size data register (usually at the end of the manual), and the base address of the register is clearly written.
hint: Different chip models may have different register addresses. For example, the base address of F103 is: 0x1FFFF7E0.
is a 16-bit value, written at the factory, and can only be read by the program. The reading method is very simple and can be as follows:
uint16_t Flash_size; Flash_size = *(uint16_t *)0x1FFFF7E0;
2. Read directly through STM32 ST-LINK Utility
Connect the chip through ST-Link and read it directly, you can see the capacity information:
2 UID register
Someone asked me before, can I encrypt through the UID of STM32? This is definitely possible.
But asked me another question, I don’t want to read all (96 bits),Can only part of the register be read as an identifier? Will the read parts be repeated?
STM32 UID unique identifierApplicable to:
- Used as serial number.
- It is used as a password. When writing flash memory, this unique identifier is used in combination with the software encryption and decryption algorithm to improve the security of the code in the flash memory.
- Used to activate the boot process with safety mechanism.
The UID of STM32 has a total of 96 bits (32 x 3). All, there are friends, can I read only a certain part of it as a unique identifier?
This question, strictly speaking, is not possible. But if it’s not particularly strict, it’s still okay. Because this UID is numbered by wafer, batch, etc. If you buy the same batch, you will find that the numbers may be consecutive.
I have read several produced boards before (the MCUs purchased are from the same batch). The UIDs of the chips are consecutive. If you are interested, you can try it.
so,By reading part of the UID as an identifier, it can only be said that it is not strict.。
3 Register offset address
There are still many beginners who are learning some low-level knowledge. For example, there are friends who want to program through registers themselves, but they don’t know what a register base address is and what a register offset address is.
1.Base address
Each on-chip and on-chip device has a corresponding base address, which is determined by the manufacturer and cannot be modified. As shown below:
In the program, you will find the code corresponding to the above:
2. Offset address
The offset address is the offset based on the base address (usually increased by 4 bytes), such as the offset address of the TIM timer:
Similarly, the corresponding code in the program implements offset through the structure:
Regarding the base address and offset address, whether it is the standard peripheral library or the HAL library, they are implemented by the base address + offset method shown above.
As mentioned in the article many times before, if you want to understand the principle of registers, or implement them through registers, it is best to refer to the "Standard Peripheral Library" routines. The HAL library is relatively complex to encapsulate and is not suitable for studying the lowest-level registers.
Further verification, writing data (RAM, Flash) test, basic function test of various peripherals, etc.
4
Recommended formal channelsThe price you pay for buying fake or knock-off goods is very high. It’s okay if problems are discovered in the early development stage, but you are afraid that the problems will be discovered after mass production.What’s even more frightening is the situation where products are shipped in large quantities and have problems in the hands of customers because of fake chips.
Today, someone in the communication group was discussing the situation of selling chips on salted fish. I think,You can just buy chips for fun, but you'd better be cautious when making products.
For example, the STM32 found on Taobao for more than ten yuan is still imported and original. Do you believe it?
For chips purchased through regular channels, there is still a certain probability that the problem is caused by the chip itself, let alone a platform like Xianyu.I have encountered problems before with the STM32 I bought from a regular and relatively large agent. The FAE went to the company many times and failed to find the problem. Finally, I took the original factory chip back and dissected it, and found that it was really a problem with the chip itself.
Therefore, don’t buy chips from Taobao or Xianyu just because they are cheap. It is recommended to go through formal channels. Otherwise, it could be costly.
Disclaimer: This article is reproduced from "strongerHuang", which supports the protection of intellectual property rights. Please indicate the original source and author of the reprint. If there is any infringement, please contact us to delete it.
Company phone number: +86-0755-83044319
Fax/FAX: +86-0755-83975897
Email: 1615456225@qq.com
QQ: 3518641314 Manager Li
QQ: 332496225 Manager Qiu
Address: Room 809, Building C, Zhantao Technology Building, No. 1079 Minzhi Avenue, Longhua New District, Shenzhen




粤公网安备44030002007346号