LPC804 Stuck or crash on IAP_ReadUniqueID

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

LPC804 Stuck or crash on IAP_ReadUniqueID

ソリューションへジャンプ
551件の閲覧回数
MHMart
Contributor I

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?

0 件の賞賛
返信
1 解決策
530件の閲覧回数
ErichStyger
Specialist I

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.

 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
531件の閲覧回数
ErichStyger
Specialist I

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.

 

0 件の賞賛
返信
508件の閲覧回数
MHMart
Contributor I

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.

0 件の賞賛
返信