Core2 for AWS IoT EduKit BSP 1.5.1
Functions
atecc608.c File Reference
#include <stdbool.h>
#include "mbedtls/config.h"
#include "cryptoauthlib.h"
#include "mbedtls/atca_mbedtls_wrap.h"
#include "esp_log.h"
#include "i2c_device.h"
#include "atecc608.h"
#include "mbedtls/platform.h"
#include "mbedtls/debug.h"
#include "mbedtls/ssl.h"
#include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h"
#include "mbedtls/pk.h"

Functions

ATCA_STATUS Atecc608_GetSerialString (char *sn)
 Retrieves the unique serial number from the ATECC608. More...
 
ATCA_STATUS Atecc608_Init ()
 Initializes the ATECC608 Trust&GO on the I2C bus. More...
 

Function Documentation

◆ Atecc608_GetSerialString()

ATCA_STATUS Atecc608_GetSerialString ( char *  sn)

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);
ATCA_STATUS Atecc608_GetSerialString(char *sn)
Retrieves the unique serial number from the ATECC608.
Definition: atecc608.c:56
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.

◆ Atecc608_Init()

ATCA_STATUS Atecc608_Init ( )

Initializes the ATECC608 Trust&GO on the I2C bus.

Note
Must initialize the ATECC608 before performing any operations on the secure element.
The Core2ForAWS_Init() calls this function when the hardware feature is enabled.
Returns
Status of initialization. 0 is success. View the list of possible return status codes here.