听说stm32每一个芯片只有一个全球唯一的ID

[复制链接]
12013|13
 楼主| kq800 发表于 2008-7-15 15:26 | 显示全部楼层 |阅读模式
上次在研讨会上,ST公司的专家说的,有没有人知道怎么读出这个ID。
ST_ARM 发表于 2008-7-15 15:35 | 显示全部楼层

请参阅STM32的参考手册

在最后一章有详细的描述。
 楼主| kq800 发表于 2008-7-15 16:16 | 显示全部楼层

谢谢楼上关心,但是参考手册的ID不是芯片自身的

谢谢楼上关心,但是参考手册的ID不是芯片自身的,我要的是每个芯片全球唯一的也许叫序列号。这样即使芯片的程序被读出了,盗版的写到其他芯片上也不会工作。
香水城 发表于 2008-7-15 16:31 | 显示全部楼层

请参阅STM32的参考手册,第642页、第25章

starm 发表于 2008-7-15 17:12 | 显示全部楼层

usb开发包中 hw_config.c 文件中有这个函数

/*******************************************************************************
* Function Name  : Get_SerialNum.
* Description    : Create the serial number string descriptor.
* Input          : None.
* Output         : None.
* Return         : None.
*******************************************************************************/
void Get_SerialNum(void)
{
  u32 Device_Serial0, Device_Serial1, Device_Serial2;

  Device_Serial0 = *(vu32*)(0x1FFFF7E8);      //12 Bytes Serial Number
  Device_Serial1 = *(vu32*)(0x1FFFF7EC);
  Device_Serial2 = *(vu32*)(0x1FFFF7F0);

  if (Device_Serial0 != 0)
  {
    LOADER_StringSerial[2] = (u8)(Device_Serial0 & 0x000000FF);
    LOADER_StringSerial[4] = (u8)((Device_Serial0 & 0x0000FF00) >> 8);
    LOADER_StringSerial[6] = (u8)((Device_Serial0 & 0x00FF0000) >> 16);
    LOADER_StringSerial[8] = (u8)((Device_Serial0 & 0xFF000000) >> 24);

    LOADER_StringSerial[10] = (u8)(Device_Serial1 & 0x000000FF);
    LOADER_StringSerial[12] = (u8)((Device_Serial1 & 0x0000FF00) >> 8);
    LOADER_StringSerial[14] = (u8)((Device_Serial1 & 0x00FF0000) >> 16);
    LOADER_StringSerial[16] = (u8)((Device_Serial1 & 0xFF000000) >> 24);

    LOADER_StringSerial[18] = (u8)(Device_Serial2 & 0x000000FF);
    LOADER_StringSerial[20] = (u8)((Device_Serial2 & 0x0000FF00) >> 8);
    LOADER_StringSerial[22] = (u8)((Device_Serial2 & 0x00FF0000) >> 16);
    LOADER_StringSerial[24] = (u8)((Device_Serial2 & 0xFF000000) >> 24);
  }
}

starm 发表于 2008-7-15 17:16 | 显示全部楼层

STM32的参考手册(22-May-2008 Rev 4),第643页、第25章

25.2 Unique device ID register (96 bits)
The unique device identifier is ideally suited:
● for use as serial numbers (for example USB string serial numbers or other end
applications)
● for use as security keys in order to increase the security of code in Flash memory while
using and combining this unique ID with software cryptographic primitives and
protocols before programming the internal Flash memory
● to activate secure boot processes, etc.
The 96-bit unique device identifier provides a reference number which is unique for any
device and in any context. These bits can never be altered by the user.
The 96-bit unique device identifier can also be read in single bytes/half-words/words in
different ways and then be concatenated using a custom algorithm.
phoenixmy 发表于 2008-7-15 18:10 | 显示全部楼层

不是PID吗?




问问
pheavecn 发表于 2008-7-16 11:36 | 显示全部楼层

不过st想要出来2颗ID一样的芯片也不是难事。

这个ID是在下载BootLoader的时候一起存储在特殊的flash区域里。
这个flash区域的烧录方法st保密了。
不知牢靠不。。。。
香水城 发表于 2008-7-16 12:42 | 显示全部楼层

8楼的猜测不对

这个ID肯定不是在下载BootLoader的时候放进去的。

如果你怀疑是否牢靠,那就是你的自由了,要我说就是杞人忧天,哈哈~~~~
pheavecn 发表于 2008-7-16 14:35 | 显示全部楼层

不可能是掩模的!!!

只可能是在flash里面。

至于是不是下载Bootloader 的时候放进去的,这个真是我的猜测。
phoenixmy 发表于 2008-7-16 17:46 | 显示全部楼层

为啥读不出来呢?



难道只能用JTAG/SWD方式读?ISP读不出来?
不过也不对啊,怎么有的板子能读,有的则不行呢?
失败的是个别现象?还是information block被保护了?


问问
香水城 发表于 2008-7-16 18:59 | 显示全部楼层

请注意芯片版本

A版本是功能测试样片,有些功能可能不全。Z版本的是量产版本,包含所有手册上的功能。现在应该买不到A版本的芯片了。
yxs1977 发表于 2009-6-24 17:12 | 显示全部楼层

我的STM32F103VBT6就是A版本

原来是测试用的啊 是以前力源开发板上的
haozix521 发表于 2015-11-10 15:07 | 显示全部楼层
kq800 发表于 2008-7-15 16:16
谢谢楼上关心,但是参考手册的ID不是芯片自身的,我要的是每个芯片全球唯一的也许叫序列号。这样即使芯片的 ...

这是不可能的。除非是芯片。不然中国人什么拿不出来。我们正在破
您需要登录后才可以回帖 登录 | 注册

本版积分规则

10

主题

54

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部