美文网首页
mbed嵌入式编程(二):mbed读取UID,读取Flash数据

mbed嵌入式编程(二):mbed读取UID,读取Flash数据

作者: 光均 | 来源:发表于2020-04-25 18:47 被阅读0次

    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);
           }
    }
    

    相关文章

      网友评论

          本文标题:mbed嵌入式编程(二):mbed读取UID,读取Flash数据

          本文链接:https://www.haomeiwen.com/subject/zmnkwhtx.html