UID:unique id差异于单片机的Deveice ID(区别是stm32f103仍是stm32f030的单片机)
stm32f103系列单片机都有UID,96位,放在3个32位寄存器里边,base address:是0x1ffff7e8,偏移地址分别是:0,4,8;
//下面这3个是stm32f103的uid
printf(” 0x1ffff7e8 id:0x%X”,(*(volatile uint32_t *)0x1ffff7e8));
printf(” 0x1ffff7ec id:0x%X”,(*(volatile uint32_t *)0x1ffff7ec));
printf(” 0x1ffff7f0 id:0x%X”,(*(volatile uint32_t *)0x1ffff7f0));
STM32F0x1/STM32F0x2/STM32F0x8里边Device electronic signature找到了!
基地址:-0x1ffff7ac
stm32f030单片机发现STM32F030x4/6/8/C and STM32F070x6/B的reference manual里边Device electronic signature没有找到Unique device ID register!!!怎么办?想用stm32f030的UID做模块辨认!直接硬件测验,用3个f030单片机测验STM32F0x1/STM32F0x2/的UID,发现只要基地址有个24位或许20位的不同的值,4和8都是相同的!所以能够判定:0x1ffff7ac寄存的32位数据便是stm32f030UID!
引证他人的***************
最新的STM32F0 Reference manual有 Device electronic signature章节:Base address: 0x1FFF F7AC
STM32F0 uid Base address: 0x1FFF F7AC
偏移地址,00 04 08
stm32f030是有ID号的,是个32位的ID号, 详细见芯片手册.