lpcware

Reading LPC UID (s/n): different results

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Jaecko on Thu Sep 27 01:26:03 MST 2012
Hello.

When reading the device serial number of an LPC1769, i often get different results when reading repeatedly.
The most common s/n i get is "0808F715-53560F40-4ECD83F7-F5000001", so i assume that this is the correct one.
But sometimes it looks like "00000015-100011E0-00000002-000007FA", "00000015-100011E0-00000001-00000001" or something like "0808F715-53560F40-4ECD83F7-00000001" which has only one byte difference.

How i read the s/n (relevant code) is attached below.

Does somebody know, why i get different results here?

Regards.



static uint32_t IAP_cmd[5];
static uint32_t IAP_res[5];

#define IAPCMD_READ_UID  58
#define IAP_ENTRY_LOCATION  ((IAP_t)0x1FFF1FF1)

#define IAP_ReadUID() \
{ \
  IAP_cmd[0] = IAPCMD_READ_UID; \
  IAP_Execute(); \
}

void IAP_Execute( void )
{
  IAP_ENTRY_LOCATION(IAP_cmd, IAP_res);
}

void IAP_GetUID(uint32_t *uid)
{
  IAP_ReadUID();
  uid[0] = IAP_res[0];
  uid[1] = IAP_res[1];
  uid[2] = IAP_res[2];
  uid[3] = IAP_res[3];
  uid[4] = IAP_res[4];
}


uint32_t tmp32buffer[5];
IAP_GetUID(tmp32buffer); // <= here, elements 1...4 should contain the s/n, 0 is always 0

Outcomes