Read UID for LPC82x

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

Read UID for LPC82x

Jump to solution
999 Views
Athos88
Contributor I

Dear All,

Recently I started a work on LPC822 chip. In my project I would like to have a UID to identify each chip. After search from the forum I notice that I can use the IAP readUID function to achieve this.

In the fsl_iap of the SDK I got this part of code:

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
}

What is confusing me is the usage of the define:

FSL_FEATURE_IAP_READ_UNIQUE_ID_NOWORK

Seems in the case it is defined the UID will be directly read from the reserved address. So if I define it by myself, am I able to get the correct UID without actually invoke the IAP function?

Thank you for your time,

Best regards,

0 Kudos
Reply
1 Solution
965 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

Yes, user can define UID by self , thus we don't need IAP functions.

Best Regards

Jun Zhang

View solution in original post

2 Replies
966 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

Yes, user can define UID by self , thus we don't need IAP functions.

Best Regards

Jun Zhang

956 Views
Athos88
Contributor I

Ok I got it.

Thanks for the info.

0 Kudos
Reply