Read UID(Unique ID) on i.MXRT RT1050

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Read UID(Unique ID) on i.MXRT RT1050

ソリューションへジャンプ
2,960件の閲覧回数
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 解決策
2,948件の閲覧回数
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 返答(返信)
2,949件の閲覧回数
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,933件の閲覧回数
dynamix
Contributor II

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

0 件の賞賛
返信
2,939件の閲覧回数
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