LPC824 & LPC845 Unique IDs

cancel
Showing results for 
Search instead for 
Did you mean: 

LPC824 & LPC845 Unique IDs

Jump to solution
111 Views
paulsanders
Contributor III

Hello looking for some information please.


I am using this function on an LPC824

NXP_Unique_ID = Chip_IAP_ReadUID(); //32 bit UID

This returns the first 32bit value from the unique number.

However on a LPC845 this seems to return the least significant byte of each 32 bit value of the unique number.

I use this number as a signature on field devices and was just wondering why it is different between parts?

Also is it documented anywhere what the content of the unique number represent?
Regards Paul

0 Kudos
1 Solution
62 Views
FelipeGarcia
NXP TechSupport
NXP TechSupport

Hi Paul,

You can refer to the LPC824 SDK examples that have latest updates and are constantly been updated unlike LPCOpen libraries. There you will find implementation for the full 128 bit unique ID.

status_t IAP_ReadUniqueID(uint32_t *uniqueID)
{
#if defined(FSL_FEATURE_IAP_READ_UNIQUE_ID_NOWORK) && FSL_FEATURE_IAP_READ_UNIQUE_ID_NOWORK
    uint32_t *result = (uint32_t *)0x01000100;
    uint8_t i        = 0;

    for (i = 0; i < 4; i++)
        uniqueID[i] = result[i];
    return kStatus_IAP_Success;
#else
    uint32_t command[5] = {0x00U};
    uint32_t result[5]  = {0x00U};

    command[0] = (uint32_t)kIapCmd_IAP_ReadUid;
    iap_entry(command, result);
    uniqueID[0] = result[1];
    uniqueID[1] = result[2];
    uniqueID[2] = result[3];
    uniqueID[3] = result[4];

    return translate_iap_status(result[0]);
#endif
}

Best regards,

Felipe

View solution in original post

0 Kudos
5 Replies
81 Views
FelipeGarcia
NXP TechSupport
NXP TechSupport

Hi Paul,

Please be aware that it is not recommended to read only 32 bit of the unique ID, you should read full 128 bit in order to have a guaranteed unique ID. Content of the UID is confidential and cannot be shared. The correct way to read it is the following.

uint32_t unique_id[4];

/* Read Part Unique Identification Number*/
Chip_IAP_ReadUID(unique_id);

Hope it helps!

Have a great day,

Felipe

-------------------------------------------------------------------------------

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
70 Views
paulsanders
Contributor III

Thanks, however the LPC824 function only deals with a single 32 bit number, and can't be passes paramaters?

/* Read the unique ID */
uint32_t Chip_IAP_ReadUID()
{
uint32_t command[5], result[5];

command[0] = IAP_READ_UID_CMD;
iap_entry(command, result);

return result[1];
}

0 Kudos
63 Views
FelipeGarcia
NXP TechSupport
NXP TechSupport

Hi Paul,

You can refer to the LPC824 SDK examples that have latest updates and are constantly been updated unlike LPCOpen libraries. There you will find implementation for the full 128 bit unique ID.

status_t IAP_ReadUniqueID(uint32_t *uniqueID)
{
#if defined(FSL_FEATURE_IAP_READ_UNIQUE_ID_NOWORK) && FSL_FEATURE_IAP_READ_UNIQUE_ID_NOWORK
    uint32_t *result = (uint32_t *)0x01000100;
    uint8_t i        = 0;

    for (i = 0; i < 4; i++)
        uniqueID[i] = result[i];
    return kStatus_IAP_Success;
#else
    uint32_t command[5] = {0x00U};
    uint32_t result[5]  = {0x00U};

    command[0] = (uint32_t)kIapCmd_IAP_ReadUid;
    iap_entry(command, result);
    uniqueID[0] = result[1];
    uniqueID[1] = result[2];
    uniqueID[2] = result[3];
    uniqueID[3] = result[4];

    return translate_iap_status(result[0]);
#endif
}

Best regards,

Felipe

View solution in original post

0 Kudos
52 Views
paulsanders
Contributor III

Thanks Felipe!

0 Kudos
104 Views
carstengroen
Senior Contributor II

On both my 824 and 845 projects, I have:

 

carstengroen_0-1612981988326.png

 

It returns 4 x 32 bit for the ID

0 Kudos