CH32V307RCT6如何获取UUID(唯一ID)

根据手册取了三个地址:


    uint8_t buf[12];

    uint32_t uuid[3];

    uint32_t code;


    uuid[0] = *(__IO uint32_t*) (0x1FFFF7E8);

    uuid[1] = *(__IO uint32_t*) (0x1FFFF7EC);

    uuid[2] = *(__IO uint32_t*) (0x1FFFF7F0);


    code = uuid[0];

    buf[0] = (uint8_t) code;

    buf[1] = (uint8_t) (code >> 8);

    buf[2] = (uint8_t) (code >> 16);

    buf[3] = (uint8_t) (code >> 24);


    code = uuid[1];

    buf[4] = (uint8_t) code;

    buf[5] = (uint8_t) (code >> 8);

    buf[6] = (uint8_t) (code >> 16);

    buf[7] = (uint8_t) (code >> 24);


    code = uuid[2];

    buf[8] = (uint8_t) code;

    buf[9] = (uint8_t) (code >> 8);

    buf[10] = (uint8_t) (code >> 16);

    buf[11] = (uint8_t) (code >> 24);

-----------------------------------
第三个【0x1FFFF7F0】这里面的地址都是 FF 的吗?这个代码获取出来后:
buf[0-7]是有值的,但buf[8-11]都是 0xFF 。

请问第三个地址正常的吗?还是我用错了?

您好,UID寄存器3目前为保留位,读出值为0xFF是正常的


只有登录才能回复,可以选择微信账号登录