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.
解決済! 解決策の投稿を見る。
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.
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.
-------------------------------------------------------------------------------
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.
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.
-------------------------------------------------------------------------------
Thank you so much!
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