Read UID(Unique ID) on i.MXRT RT1050

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Read UID(Unique ID) on i.MXRT RT1050

Jump to solution
2,959 Views
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 Kudos
Reply
1 Solution
2,947 Views
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.
-------------------------------------------------------------------------------

View solution in original post

3 Replies
2,948 Views
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.
-------------------------------------------------------------------------------

2,932 Views
dynamix
Contributor II

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

0 Kudos
Reply
2,938 Views
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