Chip configuration APIs. More...

Functions

gos_result_t gos_atca_lock_data_zone (void)
gos_result_t gos_atca_data_zone_is_locked (bool *is_locked)
gos_result_t gos_atca_write_data_zone (uint16_t slot_id, const void *data, uint32_t length)
gos_result_t gos_atca_read_data_zone (uint16_t slot_id, void *data, uint32_t length)
gos_result_t gos_atca_lock_config_zone (void)
gos_result_t gos_atca_config_zone_is_locked (bool *is_locked)
gos_result_t gos_atca_write_config_zone (const void *config)
gos_result_t gos_atca_read_config_zone (void *config)
gos_result_t gos_atca_compare_config_zone (const void *expected_config, bool *is_same_config)

Detailed Description

Chip configuration APIs.

Function Documentation

gos_atca_compare_config_zone()

gos_result_t gos_atca_compare_config_zone ( const void * expected_config,
bool * is_same_config
)

Compares a specified configuration zone with the configuration zone currently on the SE

This only compares the static portions of the configuration zone and skips those that are unique per SE (first 16 bytes) and areas that can change after the configuration zone has been locked (e.g. LastKeyUse).

Parameters
[in] expected_config Full configuration data to compare the SE against
[out] is_same_config Result is returned here. True if the static portions on the configuration zones are the same
Returns
gos_result_t result of API
Examples:
demo/secure_element/se_utils.c .

gos_atca_config_zone_is_locked()

gos_result_t gos_atca_config_zone_is_locked ( bool * is_locked )

Executes Read command, which reads the configuration zone to see if the specified zone is locked

Parameters
[out] is_locked Lock state returned here. True if locked
Returns
gos_result_t result of API
Examples:
demo/secure_element/se_utils.c .

gos_atca_data_zone_is_locked()

gos_result_t gos_atca_data_zone_is_locked ( bool * is_locked )

Executes Read command, which reads the data zone to see if the specified zone is locked.

Parameters
[out] is_locked Lock state returned here. True if locked.
Returns
gos_result_t result of API

gos_atca_lock_config_zone()

gos_result_t gos_atca_lock_config_zone ( void )

Unconditionally (no CRC required) lock the config zone

Returns
gos_result_t result of API
Examples:
demo/secure_element/se_utils.c .

gos_atca_lock_data_zone()

gos_result_t gos_atca_lock_data_zone ( void )

Unconditionally (no CRC required) lock the data zone (slots and OTP).

ConfigZone must be locked and DataZone must be unlocked for the zone to be successfully locked.

Returns
gos_result_t result of API
Examples:
demo/secure_element/se_utils.c .

gos_atca_read_config_zone()

gos_result_t gos_atca_read_config_zone ( void * config )

Executes Read command to read the complete SE configuration zone

Parameters
[out] config onfiguration zone data is returned here. 128 bytes for ATECC
Returns
gos_result_t result of API

gos_atca_read_data_zone()

gos_result_t gos_atca_read_data_zone ( uint16_t slot_id,
void * data,
uint32_t length
)

Used to read an arbitrary number of bytes from data zone configured for clear reads

This function will issue the Read command as many times as is required to read the requested data.

Parameters
[in] slot_id Slot number to read from
[out] data Read data is returned here
[in] length Number of bytes to read starting from the offset
Returns
gos_result_t result of API
Examples:
demo/secure_element/commands.c , and demo/secure_element/se_utils.c .

gos_atca_write_config_zone()

gos_result_t gos_atca_write_config_zone ( const void * config )

Executes the Write command, which writes the configuration zone

First 16 bytes are skipped as they are not writable. LockValue and LockConfig are also skipped and can only be changed via the Lock command.

This API may fail if UserExtra and/or Selector bytes have already been set to non-zero values.

Parameters
[in] config Data to the config zone data. This should be 128 bytes for ECC.
Returns
gos_result_t result of API
Examples:
demo/secure_element/se_utils.c .

gos_atca_write_data_zone()

gos_result_t gos_atca_write_data_zone ( uint16_t slot_id,
const void * data,
uint32_t length
)

Executes the Write command, which writes data into the data zone with a given byte offset and length. Offset and length must be multiples of a word (4 bytes).

If data zone is unlocked, only 32-byte writes are allowed to slots and the offset and length must be multiples of 32 or the write will fail.

Parameters
[in] slot_id the slot number to write to
[in] data Data to be written
[in] length Number of bytes to be written. Must be a multiple of a word (4 bytes)
Returns
gos_result_t result of API
Examples:
demo/secure_element/commands.c .