1848850_en-US

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

1848850_en-US

1848850_en-US

LPC804 Stuck or crash on IAP_ReadUniqueID

I'm trying to read the Unique ID of a LPC804 but, I think it was working before, now I cannot access the UID any longer.


The following function makes the whole process stop and not continue. In the debugger I find that IAP_ReadUniqueID is executed (although maybe not with success?) but a breakpoint on the status check is never reached.


    uint32_t UIDValue = 0x00;
    status_t UIDStatus = kStatus_Fail;
    //  Read the UID
    UIDStatus = IAP_ReadUniqueID(&UIDValue);
    
    // Return when failed
    if(UIDStatus != kStatus_Success) return;
    
    // insert UID into message
    data[3] = (uint8_t)((UIDValue >> (8 * 3)) & 0xFF);
    data[4] = (uint8_t)((UIDValue >> (8 * 2)) & 0xFF);
    data[5] = (uint8_t)((UIDValue >> (8 * 1)) & 0xFF);
    data[6] = (uint8_t)(UIDValue & 0xFF);



Since I think it was working prior, might the flash memory have been emptied or reset? What could it be or what can I check?

Re: LPC804 Stuck or crash on IAP_ReadUniqueID

Thanks, amazing! That solved my issue.

I could, indeed, have figured that out by checking the function.



In my defense though, this documentation could be updated to fit that explenation?

https://mcuxpresso.nxp.com/api_doc/dev/2167/a00070.html#ga258d8c49d494cbd0d18321af56e11440


Seems an important requirement that isn't mentioned directly.

Re: LPC804 Stuck or crash on IAP_ReadUniqueID

IAP_ReadUniqueID() expects a pointer to 128bits (4 x 32bit values).

You see this if you step into IAP_ReadUniqeID().

You are passing only a pointer to 32bits, so memory gets overwritten. Fix that and it should work.


タグ(1)
評価なし
バージョン履歴
最終更新日:
‎11-21-2025 04:04 PM
更新者: