I am using the LPCOpen library at the moment with MCU LPCExpresso IDE for the LPC1830 chip.
For a project I need to read the UID of the CPU. I tried it with the following functions:
But it crashes and I don't know why. Maybe someone can help me?
I increased the cpuUID size to 5, but 4 is enough.
Program counter has weird number: 0x12345678
uint32_t cpuUID[5] = {0};
Chip_IAP_ReadUID(&cpuUID[0]);
uint32_t Chip_IAP_ReadUID(uint32_t uid[])
{
uint32_t command[5], result[5], i;
command[0] = IAP_READ_UID_CMD;
iap_entry(command, result);
for(i = 0; i < 4; i++) {
uid[i] = result[i + 1];
}
return result[0];
}
Note in this picuture: uint32 needs to be uint32_t (line 103)
