Core2 for AWS IoT EduKit BSP 1.5.1
Atecc608_GetSerialString
ATCA_STATUS Atecc608_GetSerialString(char * sn);
ATCA_STATUS Atecc608_GetSerialString(char *sn)
Retrieves the unique serial number from the ATECC608.
Definition: atecc608.c:56

Retrieves the unique serial number from the ATECC608.

The serial number of the ATECC608 is stored as a uint8 with the length defined in the macro ATCA_SERIAL_NUM_SIZE. It might take a little time to wake the secure element and retrieve the serial number.

Example:

Create a variable named clientId with enough dynamically allocated memory to store the ATECC608 serial number.

char * clientId = malloc(ATCA_SERIAL_NUM_SIZE * 2 + 1); // ATCA_SERIAL_NUM_SIZE returns the 8-bit serial number size.
// Need double for 16-bit and one more for the null terminator
// for the end of the char.
ATCA_STATUS ret = Atecc608_GetSerialString(clientId);
Parameters
[out]snThe unique serial number of the chip.
Returns
Status of serial number retrieval operation. 0 is success. View the list of possible return status codes here.