Chip_IAP_ReadUID() code has a bug? Yes.

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

Chip_IAP_ReadUID() code has a bug? Yes.

ソリューションへジャンプ
1,507件の閲覧回数
chrispflieger
Contributor IV

The user manual says this:

Return Code CMD_SUCCESS followed by four 32-bit words of a unique serial number in ASCII format. The word sent at the lowest address is sent first

But the code in the LPC5411x package is this:

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

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

    return result[1];
}

I'm not sure is that's just buggy code that just keeps floating around, but it clearly won't work. Digging around in the forums I see that this exist in several LPCOpen packages.

ラベル(2)
タグ(1)
0 件の賞賛
返信
1 解決策
1,255件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Chris,

   This is not the code problem, it is the same as the ISP UID read problem.

This is a known issue and documented in the LPC5411x Errata sheet.

The workaround documented in the Errata sheet:-

The unique serial number (four 32-bit words) can be directly read from address locations

0x0100 0100 to 0x0100 010C

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

2 返答(返信)
1,256件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Chris,

   This is not the code problem, it is the same as the ISP UID read problem.

This is a known issue and documented in the LPC5411x Errata sheet.

The workaround documented in the Errata sheet:-

The unique serial number (four 32-bit words) can be directly read from address locations

0x0100 0100 to 0x0100 010C

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,255件の閲覧回数
chrispflieger
Contributor IV

I'd appreciate if anyone could tell me how to actually read the UID from the part.

I tried to look at the result register (uint32_t [4]) and got:

0x0

0xFFFF

0x0

0x0

0 件の賞賛
返信