Read UID(Unique ID) on i.MXRT RT1050

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Read UID(Unique ID) on i.MXRT RT1050

跳至解决方案
1,855 次查看
dynamix
Contributor II

Hello everyone,

I am trying to read the unique ID on i.MXRT RT1050. First I read it like below:

uint32_t id1 = OCOTP->CFG0; uint32_t id2 = OCOTP->CFG1;

Then, I found in the forum that the right way to do so is:

OCOTP_ClearErrorStatus(OCOTP);
OCOTP_ReloadShadowRegister(OCOTP);
uid_read_data[0] = OCOTP_ReadFuseShadowRegister(OCOTP, fuse_address[0]);
uid_read_data[1] = OCOTP_ReadFuseShadowRegister(OCOTP, fuse_address[1]);

However, the second approach gives me only zero while the first one gives something more meaningful. Could anyone please tell me why reading directly from the register is not right, and why the second method does not work properly?

 

Thanks in advance.

0 项奖励
1 解答
1,843 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I adapt the evkbimxrt1050_ocotp_example demo in the SDK library and run it, I find these two approaches both can get the unique ID successfully.
I attach the test result below and the attachment is the demo code, please give it a try.

jeremyzhou_0-1608605646140.png

 


Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

在原帖中查看解决方案

3 回复数
1,844 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I adapt the evkbimxrt1050_ocotp_example demo in the SDK library and run it, I find these two approaches both can get the unique ID successfully.
I attach the test result below and the attachment is the demo code, please give it a try.

jeremyzhou_0-1608605646140.png

 


Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,828 次查看
dynamix
Contributor II

Thank you so much! I realized that I did not initialize OCOTP in my code.

0 项奖励
1,834 次查看
mjbcswitzerland
Specialist V

Hi

As reference, it is done like this in the uTasker project:

    POWER_UP_ATOMIC(2, OCOTP_CTRL_CLOCK);
    fnDebugMsg("i.MX RT Unique ID:");
    fnDebugHex(HW_OCOTP_CFG2, (WITH_SPACE | WITH_LEADIN | sizeof(unsigned long)));
    fnDebugMsg("-");
    fnDebugHex(HW_OCOTP_CFG0, (sizeof(unsigned long)));
    fnDebugHex(HW_OCOTP_CFG1, (sizeof(unsigned long) | WITH_CR_LF));
    POWER_DOWN_ATOMIC(2, OCOTP_CTRL_CLOCK);

 

i.MX RT Unique ID: 0x50000020-b96fe9ba916bfa5a

 

Regards

Mark