Update Cryptoauthlib

This commit is contained in:
Rashed Talukder
2023-04-21 13:40:14 -07:00
parent e5dc9bf393
commit b750c6a7cd
6 changed files with 38 additions and 12 deletions
+11 -2
View File
@@ -1,6 +1,15 @@
**/.pio
**/.vscode
.vscode
**/.DS_Store
.pio
build
sdkconfig
sdkconfig.old
sdkconfig.core2foraws
dependencies.lock
**/__pycache__
*.py[cod]
**/*.key
**/*.pem
+1 -1
View File
@@ -29,7 +29,7 @@ set( COMPONENT_INCLUDEDIRS "${CRYPTOAUTHLIB_DIR}/"
set( COMPONENT_PRIV_INCLUDEDIRS "port/include" )
set( COMPONENT_REQUIRES "mbedtls" "freertos" "driver" "Core2-for-AWS-IoT-EduKit" )
set( COMPONENT_REQUIRES "mbedtls" "freertos" "driver" "Core2-for-AWS-IoT-Kit" )
# Don't include the default interface configurations from cryptoauthlib
set( COMPONENT_EXCLUDE_SRCS "${CRYPTOAUTHLIB_DIR}/atca_cfgs.c" )
+4 -4
View File
@@ -2,12 +2,12 @@
# ESP-CRYPTOAUTHLIB
This is a port of Microchip's [cryptoauthlib](https://github.com/MicrochipTech/cryptoauthlib) to work on the [M5Stack Core2 for AWS IoT EduKit](https://aws.amazon.com/iot/edukit/#Get_started_with_AWS_IoT_EduKit). It contains necessary build support to use cryptoauthlib with ESP-IDF as well as `esp_cryptoauthlib_utility` for configuring and provisiong ATECC608 chip integrated with the Core2 for AWS. The cryptoauthlib folder is a submodule of Microchip's [cryptoauthlib](https://github.com/MicrochipTech/cryptoauthlib). This ported library requires the [Core2 for AWS IoT EduKit board support package](https://github.com/m5stack/Core2-for-AWS-IoT-EduKit/tree/BSP-dev) (BSP) to be included for thread-safe access to the I2C bus using Rop Gonggrijp's I2C Manager, and power to the chip using the ported Mika Tuupola's AXP192 driver.
This is a port of Microchip's [cryptoauthlib](https://github.com/MicrochipTech/cryptoauthlib) to work on the [M5Stack Core2 for AWS IoT Kit](https://shop.m5stack.com/products/m5stack-core2-esp32-iot-development-kit-for-aws-iot-edukit). It contains necessary build support to use cryptoauthlib with ESP-IDF as well as `esp_cryptoauthlib_utility` for configuring and provisiong ATECC608 chip integrated with the Core2 for AWS. The cryptoauthlib folder is a submodule of Microchip's [cryptoauthlib](https://github.com/MicrochipTech/cryptoauthlib). This ported library requires the [Core2 for AWS IoT Kit board support package](https://github.com/m5stack/Core2-for-AWS-IoT-Kit/tree/BSP-dev) (BSP) to be included for thread-safe access to the I2C bus using Rop Gonggrijp's I2C Manager, and power to the chip using the ported Mika Tuupola's AXP192 driver.
## Requirements
* Core2 for AWS IoT EduKit BSP(https://github.com/m5stack/Core2-for-AWS-IoT-EduKit/tree/BSP-dev)
* Configuration in [sdkconfig.defaults](https://github.com/aws-iot-edukit/Project_Template-Core2_for_AWS/blob/main/sdkconfig.defaults)
* Core2 for AWS IoT Kit BSP(https://github.com/m5stack/Core2-for-AWS-IoT-Kit/tree/BSP-dev)
* Configuration in [sdkconfig.defaults](https://github.com/m5stack/Project_Template-Core2_for_AWS/blob/main/sdkconfig.defaults)
* Preferred [ESP-IDF](https://github.com/espressif/esp-idf) tag `release/v4.3` or newer OR use PlatformIO with [Espressif32 platform](https://github.com/platformio/platform-espressif32/) v3.3.1+.
* Environment variable `IDF_PATH` should be set
@@ -27,7 +27,7 @@ There are two ways to use **esp-cryptoauthlib** and the Core2 for AWS BSP in you
* Download **esp-cryptoauthlib** and the **Core2 for AWS BSP** with:
```
git clone https://github.com/espressif/esp-cryptoauthlib.git --recurse-submodules
git clone https://github.com/m5stack/Core2-for-AWS-IoT-EduKit.git --recurse-submodules
git clone https://github.com/m5stack/Core2-for-AWS-IoT-Kit.git --recurse-submodules
```
3) Enable the correct configurations for ESP-IDF using KConfig menu:
```
+5 -4
View File
@@ -29,6 +29,7 @@
#include "atca_cfgs.h"
#include "atca_iface.h"
#include "atca_device.h"
#include "sdkconfig.h"
/** \defgroup config Configuration (cfg_)
* \brief Logical device configurations describe the CryptoAuth device type and logical interface.
@@ -41,13 +42,13 @@ ATCAIfaceCfg cfg_ateccx08a_i2c_default = {
.iface_type = ATCA_I2C_IFACE,
.devtype = ATECC608A,
#ifdef ATCA_ENABLE_DEPRECATED
.atcai2c.slave_address = 0x6A,
.atcai2c.slave_address = CONFIG_ATCA_I2C_ADDRESS,
#else
.atcai2c.address = 0x6A,
.atcai2c.address = CONFIG_ATCA_I2C_ADDRESS,
#endif
.atcai2c.bus = 0,
.atcai2c.baud = 100000,
.wake_delay = CONFIG_I2C_MANAGER_0_TIMEOUT,
.atcai2c.baud = CONFIG_ATCA_I2C_BAUD_RATE,
.wake_delay = 1500,
.rx_retries = 20
};
+16
View File
@@ -3,6 +3,22 @@
#ifndef ATCA_CONFIG_H
#define ATCA_CONFIG_H
#if __has_include("esp_idf_version.h")
#include "esp_idf_version.h"
#endif
/*
This requires the `esp_idf_version.h' to be defined.
*/
#ifdef ESP_IDF_VERSION
#if ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(4, 3, 1)
#define ATCA_ENABLE_DEPRECATED
#endif
#endif
/* Include HALS */
#define ATCA_HAL_I2C
#define ATCA_USE_RTOS_TIMER 1