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?
解決済! 解決策の投稿を見る。
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.
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.
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.