Read UID for LPC82x

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Read UID for LPC82x

跳至解决方案
1,422 次查看
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 项奖励
回复
1 解答
1,388 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

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

Best Regards

Jun Zhang

在原帖中查看解决方案

2 回复数
1,389 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

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

Best Regards

Jun Zhang

1,379 次查看
Athos88
Contributor I

Ok I got it.

Thanks for the info.

0 项奖励
回复