服务热线
如何鉴别STM32/GD32是否为翻新仿品?
2022-03-16
261
最近,嵌入式ARM分享了一篇文章“GD32 has also begun to be flooded with fakes.》文章中,嵌入式ARM的老朋友黄强也表示,他的技术交流小组正在讨论……芯片价格上涨和出售咸鱼薯条我撰写了一篇关于翻新假货鉴别背景和方法的文章,现转载供您参考。
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 fake经验丰富的工程师可能遇到过翻新或假冒的 STM32/GD32 的问题,包括我以前也遇到过这种情况:擦掉了 GD32 的标志,然后把它变成了 STM32,或者从旧板上拆下来的翻新 STM32。
Let’s talk about some situations of chip refurbishment or fake products:
1. 擦除标志
芯片擦除标记非常常见,包括我们有时开发的产品中也包含这种标记。为了防止他人复制芯片,芯片表面的标记也可能被擦除,以防止仿冒。
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.
这进一步引出了一个问题:您的 STM32 芯片的 FLASH 容量真的像 ST 官方选型手册中描述的那样好吗?
我们先聊点别的吧。
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.
然而,一旦你接触到实际项目,你就会发现……Many places will spend FLASH有些项目会占用大量 Flash 空间。例如:特定的算法、加载字体库,甚至在 Flash 中插入两张图片。
再举一个应用内购买 (IAP) 应用程序编程的例子:通常,那些升级功能做得更好的程序会设置一个与应用程序大小大致相同的闪存区域(备份区域)。也就是说:为了确保安全,请将程序下载保存到备份区域中,然后在下载成功后更新应用程序。这样做的目的是:这是为了防止下载过程中途断开连接,导致下载失败。。
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芯片选择
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:
选型手册地址:https://www.stmcu.com.cn/upload/selection_Guide.pdf (微信公众号不支持外部链接,请复制链接打开)
3 Verify how big the internal FLASH of STM32 is
在讨论了一些关于Flash的话题之后,让我们回到本文的要点: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. 通过编程验证
简单来说,就是通过擦除、写入和读取指定的地址(即超出 FLASH 大小的地址)来实现的。
闪存擦除扇区 闪存编程字
2. 通过工具读取 FLASH 数据
这种方法是最直接、最简单的方法。以STM32 ST-LINK Utility下载工具为例:
The key points are actually described in the picture:如果地址超过 768K,则可以实际读取数据。. (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. 翻新为原装正品这种芯片在某些产品上最常见,看起来很廉价。如果你在零售店购买一些,它们会一起发货。这些很可能是翻新芯片。
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.
如果你运气不好,可能会出现以下情况:
-
The software worked overtime for several days without any results, and the hardware was blamed;
-
对硬件飞线进行各种测试,更换芯片以解决问题;
- 软件工程师和硬件工程师之间会发生争执;
- ······
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
识别翻新或假冒产品To 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.
这里分享之前的文章:Do you know about these registers of STM32?
The specific method of reading is as follows:
1. 闪存容量寄存器
1. 通过查阅登记册
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.
暗示: 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
之前有人问过我,能否通过STM32的UID进行加密?这当然可以。
但他又问我另一个问题,我不想读取全部(96 位),寄存器中只能读取一部分信息作为标识符吗?读取的部分会重复吗?
STM32 UID unique identifier适用于:
- 用作序列号。
- 它被用作密码。在写入闪存时,这个唯一标识符与软件加密和解密算法结合使用,以提高闪存中代码的安全性。
- 用于激活带有安全机制的启动过程。
STM32的UID总共有96位(32 x 3)。各位朋友,我能只读取其中的一部分作为唯一标识符吗?
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.
因此,By reading part of the UID as an identifier, it can only be said that it is not strict.。
3 寄存器偏移地址
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.基地址
每个片上元件和片上器件都有一个对应的基地址,该地址由制造商确定,无法修改。如下图所示:
In the program, you will find the code corresponding to the above:
2. Offset address
偏移地址是基于基地址的偏移量(通常增加 4 个字节),例如 TIM 定时器的偏移地址:
类似地,程序中的相应代码通过结构体实现了偏移量:
关于基地址和偏移地址,无论是标准外设库还是 HAL 库,它们都是通过上面所示的基地址+偏移方法实现的。
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.
进一步验证、写入数据(RAM、Flash)测试、各种外围设备的基本功能测试等。
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,你可以买薯片来玩,但在制作产品时最好谨慎一些。
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.
因此,不要因为淘宝或闲鱼等平台的芯片价格便宜就购买,建议通过正规渠道购买,否则可能会付出更高的代价。
免责声明:本文转载自“strongerHuang”,该平台支持知识产权保护。转载请注明原出处及作者。如有侵权,请联系我们删除。
公司电话号码:+86-0755-83044319
传真:+86-0755-83975897
电子邮件:1615456225@qq.com
QQ:3518641314 李经理
QQ:332496225 邱经理
地址:深圳市龙华新区民治大道1079号展涛科技大厦C座809室
相关推荐
宋元明在华强讲座上的演讲:Kinghelm和Slkor的全球品牌之路
2026-06-05
755
两连冠之后,我们仍在进步——Slkor专访孙高飞
2026-06-11
543
数万家企业选择中国品牌——金海姆和斯尔科在全球畅销!
2026-06-24
535
射频激情,匠人之路:三十余载的坚定奉献——金海姆首席工程师秦宏祥先生访谈录
2026-06-26
596
明年见!| Slkor 出席 2026 年中国电子音乐节精彩回顾
2026-07-14
299




粤公网安备44030002007346号