怎样读取CPU内部唯一的标识ID - NXP i.MX 6
IMX6 芯片内部都有唯一的标识 ID,也就是 UID,它是一个 64 位二进制数,可以作为唯一板子标识,可以直接通过指令直接查看芯片的 UID,使用指令“cat /sys/fsl_otp/HW_OCOTP_CFG0”和“cat /sys/fsl_otp/HW_OCOTP_CFG1”,分别为 UID的低 32 位和高 32 位。
在SBC6U5D-B7A imx6双核单板计算机读到UID如下:
root@imx6qsabresd:/unit_tests# ./memtool OCOTP.CFG0
SOC: i.MX6DL
OCOTP Addr:0x21bc000
OCOTP.CFG0 Addr:0x021BC410 Value:0xF21E6A88 - Copied from the OTP automatically after reset.
OCOTP.CFG0.BITS(0..31) :0xf21e6a88
This register contains 32 bits of the Unique ID and SJC_CHALLENGE field.
root@imx6qsabresd:/unit_tests# ./memtool OCOTP.CFG1
SOC: i.MX6DL
OCOTP Addr:0x21bc000
OCOTP.CFG1 Addr:0x021BC420 Value:0x0A0C89D4 - Copied from the OTP automatically after reset.
OCOTP.CFG1.BITS(0..31) :0xa0c89d4
This register contains 32 bits of the Unique ID and SJC_CHALLENGE field.
