读取STM32Fxx系列的96位ID号
用jlink v8读取STM32Fxx系列的96位ID号:
1、连接你的目标板
2、启动J-Flash ARM
3、点击菜单Target-->Connect
4、点击菜单Target-->Read back-->Rang...
5、读取完毕后,点击菜单File-->Save,选择保存的文件格式(我选择的是*.C格式的),输入文件名。
6、查看你最后得到的文件。
或者以下函数串口输出
int getID(void)//获取id
{
char temp[12];
u32 Device_Serial0, Device_Serial1, Device_Serial2;
Device_Serial0 = *(vu32*)(0x1FFFF7E8);
Device_Serial1 = *(vu32*)(0x1FFFF7EC);
Device_Serial2 = *(vu32*)(0x1FFFF7F0);
temp[0] = (u8)(Device_Serial0 & 0x000000FF);
temp[1] = (u8)((Device_Serial0 & 0x0000FF00)>>8);
temp[2] = (u8)((Device_Serial0 & 0x00FF0000)>>16);
temp[3] = (u8)((Device_Serial0 & 0xFF000000)>>24);
temp[4] = (u8)(Device_Serial1 & 0x000000FF);
temp[5] = (u8)((Device_Serial1 & 0x0000FF00)>>8);
temp[6] = (u8)((Device_Serial1 & 0x00FF0000)>>16);
temp[7] = (u8)((Device_Serial1 & 0xFF000000)>>24);
temp[8] = (u8)(Device_Serial2 & 0x000000FF);
temp[9] = (u8)((Device_Serial2 & 0x0000FF00)>>8);
temp[10] = (u8)((Device_Serial2 & 0x00FF0000)>>16);
temp[11] = (u8)((Device_Serial2 & 0xFF000000)>>24);
uartSendString(UARTPORT1,temp,12);
while(1);
}