mbed嵌入式编程(二):mbed读取UID,芯片的全球唯一ID,,读取Flash数据
电路板:NUCLEO H743ZI2;编程环境:Arm Compiler V6.13.1
#include "mbed.h"
//unsigned long *uid = (unsigned long *)0x1FFF7A10; //stm32F1,F2,F4
//unsigned long *uid = (unsigned long *)0x1FF1E800; //stm32H7
unsigned long *uid = (unsigned long *)UID_BASE;
unsigned long *rom = (unsigned long *)FLASH_BANK1_BASE;
Serial pc(USBTX, USBRX); // tx, rx
int main() {
pc.baud(115200);
while(1)
{
pc.printf("\r\nUnique ID: %08X %08X %08X \n", uid[0], uid[1], uid[2]);
pc.printf("\r\nFlash Bank1 Data: %08X %08X %08X %08X\n", rom[0], rom[1], rom[2], rom[3]);
wait_ms(1000);
}
}
网友评论