Read UniqueID on I.MX RT1060 and related questions

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

Read UniqueID on I.MX RT1060 and related questions

1,894 Views
matteo_merlin
Contributor II

Hello,

I'm quite new to ARM and I.MX RT1060 mcu but I already got familiar with MCU EXpresso.

I'm working with an MIMXRT1062CVL5A and I need a UniqueID to bind to it the license system for my company.

I found the OCOTP register which has OTP Bank0 Word1 (CFG0) and OTP Bank0 Word2 (CFG1) with probably the UniqueID.

1)Including <MIMXRT1062.h> in my code I can read them simply using

        uuid1 = OCOTP->CFG0;
        uuid2 = OCOTP->CFG1;

Is this correct or should I do it in another way?

2) Is possible to have a more specific explanation of the values in CFG0 ---- CFG7 fields of OCOTP? I mean, usually some bytes in the hwID reflect the Manufacturer, CPU family, etc.... since we could also check for exact MCU family before proceeding with the licensing subsystem, I'd need how to extract that info.

In the reference manual of the MCU there's nothing about that.

3) We are providing the licensing system as a static library, while the final user will always have the possibility to write its custom firmware.

I see that OCOTP CFG0 and CFG1 areas are R/W. So a user can alter them by writing its own values on them?

If so, those fields are unuseful for us (since a user can always rewrite them with the same ID for every board and use the same licence key, bypassing our licencing policies), then what other Unique ID can I use to be sure the ID is unique and not modifiable by user?

Thank you and best regards.

Matteo

Labels (1)
5 Replies

1,521 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Matteo,

Regarding your questions please see my comments below.

1)Including <MIMXRT1062.h> in my code, I can read them simply using

        uuid1 = OCOTP->CFG0;
        uuid2 = OCOTP->CFG1;

Is this correct or should I do it in another way?

This procedure is incorrect. Please refer section 22.4.1.2 from the reference manual, here you will find six steps that you need to follow in order to read the unique ID.

2) Is possible to have a more specific explanation of the values in CFG0 ---- CFG7 fields of OCOTP?...

All this is explained in Table 21-9 Fusemap Descriptions of the reference manual.

3) We are providing the licensing system as a static library, while the final user will always have the possibility to write its custom firmware...

You can prohibit this register from being written by setting TESTER_LOCK = 1. This way, the user won't be allowed to write anything to these registers. But, you have to keep in mind that setting TESTER_LOCK to one also affects other registers.

I'm currently checking with the applications team if there's a way to read the fuse directly on run-time.

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.
-------------------------------------------------------------------------------

0 Kudos

1,521 Views
matteo_merlin
Contributor II

Hello Victor,

thank you for your answer, regarding point number 3 I have another question.

We are providing only a static library to our customer, and that static library must read a UUID that the customer send us and we provide a valid licence key.

So if the OTP Bank0 Word1 (CFG0) and OTP Bank0 Word2 (CFG1) are writable, the whole thing is useless. (Since the customer can buy a single licence and then write the same UUID on all his devices, so he can use the same licence key)

Moreover the OCOTP is writable only one time and never more in the whole life of the MCU chip, or maybe it can be rewritten more times?

Anyway, if it's writable, even one time outside of the factory, at this point the UniqueID in CFG0 and CFG1 is useless, what could we use to have a read-only unique code that the user cannot alter in any way?

Or maybe I misunderstand something?

P.S.

To read and write the OCOTP I found this example: https://community.nxp.com/thread/487294 

It seems applicable to my i.MXRT RT1060 but can you confirm me that?

Thanks a lot.

0 Kudos

1,521 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Matteo,

If you set the fuse TESTER_LOCK = 1, the user will be able to read the default Unique ID but they won't be able to write anything to these registers, not even once. Just keep in mind that modifying TESTER_LOCK  also affects other registers and this change cannot be undone.

Regards,

Victor

0 Kudos

1,521 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Matteo,

Just to continue with this thread. I just received the confirmation from the design team that the fuse (TESTER_LOCK) is already programmed from the factory. So, the UNIQUE_ID OTP cannot be modified.

Hope it helps!

Victor

1,521 Views
matteo_merlin
Contributor II

Nice to know that, thanks!

0 Kudos