STM32ÿ¸öϵÁж¼»áÓÐΨһµÄÒ»¸öоƬÐòÁкţ¨96λbit£©£¬¸ÃÐòÁкŴæ·ÅÔÚоƬµÄflashµÄÐÅÏ¢ÇøÀ
STM32F10X µÄµØÖ·ÊÇ 0x1FFFF7E8
STM32F20X µÄµØÖ·ÊÇ 0x1FFF7A10
STM32F30X µÄµØÖ·ÊÇ 0x1FFFF7AC
STM32F40X µÄµØÖ·ÊÇ 0x1FFF7A10
STM32L1XX µÄµØÖ·ÊÇ 0x1FF80050
¿ÉÒÔ°´×Ö½Ú¡¢°ë×Ö¡¢×Ö·ÃÎÊ
ÒÔÎÒÊÖÉϵÄÐͺÅΪstm21f103c8t6ΪÀý£¬»ñÈ¡¸ÃоƬµÄоƬÐòÁкš£
#include "stdio.h" #define UniqueID_ADDR_Base 0x1FFFF7E8 int main(void) { u32 Device_ID[3];
//С¶Ë´æ´¢£ºµÍµØÖ·´æµÍ×Ö½Ú£¬¸ßµØÖ·´æ¸ß×Ö½Ú //´ó¶Ë´æ´¢£ºµÍµØÖ·´æ¸ß×Ö½Ú£¬¸ßµØÖ·´æµÍ×Ö½Ú //µ±Ç°ÊÇС¶Ë´æ´¢ Device_ID[0]=*(u32 *)UniqueID_ADDR_Base; //µÍ×Ö½Ú Device_ID[1]=*(u32 *)(UniqueID_ADDR_Base+4); Device_ID[2]=*(u32 *)(UniqueID_ADDR_Base+8);//¸ß×Ö½Ú printf("0X%08x%08x%08x\r\n",Device_ID[2],Device_ID[1],Device_ID[0]); while(1) { } } |