STM32 之 Unique_Device_ID
包含函數(shù):
本文引用地址:http://m.butianyuan.cn/article/201612/325140.htm(1)Main
C語(yǔ)言:Codee#14694
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 實(shí)驗(yàn)平臺(tái) : ST 官方三合一套件
+ 硬件 : STM32F103C8T6
+ 開(kāi)發(fā)平臺(tái) : IAR For ARM 5.40
+ 仿真器 : J-Link
+ 日期 : 2010-10-28
+ 頻率 :HSE = 8MHz ,主頻 = 72MHz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#include "includes.h"
/*******************************************************************************
== 變量聲明 ==
*******************************************************************************/
/*******************************************************************************
== Main 函數(shù) ==
*******************************************************************************/
voidmain(void)
{
RCC_Configuration();//配置系統(tǒng)時(shí)鐘
NVIC_Configuration();//配置 NVIC 和 Vector Table
SysTick_Config();//配置SysTick的精確延時(shí)
GPIO_Configuration();
UART1_Configuration();
LED1_HIGH;LED2_HIGH;LED3_HIGH;LED4_HIGH;// 初始化讓燈全滅
//=== 通過(guò)串口發(fā)送芯片ID號(hào) ======================================
Uart1_PutString(" The Unique Device ID is : ",27);
Show_Unique_Device_ID();
while(1);
}
+ 實(shí)驗(yàn)平臺(tái) : ST 官方三合一套件
+ 硬件 : STM32F103C8T6
+ 開(kāi)發(fā)平臺(tái) : IAR For ARM 5.40
+ 仿真器 : J-Link
+ 日期 : 2010-10-28
+ 頻率 :HSE = 8MHz ,主頻 = 72MHz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#include "includes.h"
/*******************************************************************************
== 變量聲明 ==
*******************************************************************************/
/*******************************************************************************
== Main 函數(shù) ==
*******************************************************************************/
voidmain(void)
{
RCC_Configuration();//配置系統(tǒng)時(shí)鐘
NVIC_Configuration();//配置 NVIC 和 Vector Table
SysTick_Config();//配置SysTick的精確延時(shí)
GPIO_Configuration();
UART1_Configuration();
LED1_HIGH;LED2_HIGH;LED3_HIGH;LED4_HIGH;// 初始化讓燈全滅
//=== 通過(guò)串口發(fā)送芯片ID號(hào) ======================================
Uart1_PutString(" The Unique Device ID is : ",27);
Show_Unique_Device_ID();
while(1);
}
()Unique_Device_ID.c
C語(yǔ)言:Codee#14695
#include "includes.h"
voidShow_Unique_Device_ID(void)
{
u32Dev_Serial0,Dev_Serial1,Dev_Serial2;
Dev_Serial0=*(vu32*)(0x1FFFF7E8);
Dev_Serial1=*(vu32*)(0x1FFFF7EC);
Dev_Serial2=*(vu32*)(0x1FFFF7F0);
// 至此 已經(jīng)從內(nèi)存獲取了Unique_Device_ID 用3個(gè)32位的變量
u8HEX[6]={A,B,C,D,E,F};
u8Unique_Device_ID[25];
Unique_Device_ID[24]=
voidShow_Unique_Device_ID(void)
{
u32Dev_Serial0,Dev_Serial1,Dev_Serial2;
Dev_Serial0=*(vu32*)(0x1FFFF7E8);
Dev_Serial1=*(vu32*)(0x1FFFF7EC);
Dev_Serial2=*(vu32*)(0x1FFFF7F0);
// 至此 已經(jīng)從內(nèi)存獲取了Unique_Device_ID 用3個(gè)32位的變量
u8HEX[6]={A,B,C,D,E,F};
u8Unique_Device_ID[25];
Unique_Device_ID[24]=