Skip to content

Commit 3de6098

Browse files
committed
Merge branch 'fix/menuconfig_option_esp_cryptoauthlib' into 'master'
esp_tls_mbedtls.c: Fix esp-idf integration of esp-cryptoauthlib See merge request espressif/esp-idf!18373
2 parents 2acab7c + 2ea419d commit 3de6098

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

components/esp-tls/esp_tls_mbedtls.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
#endif
2626

2727
#ifdef CONFIG_ESP_TLS_USE_SECURE_ELEMENT
28-
29-
#define ATECC608A_TNG_SLAVE_ADDR 0x6A
30-
#define ATECC608A_TFLEX_SLAVE_ADDR 0x6C
31-
#define ATECC608A_TCUSTOM_SLAVE_ADDR 0xC0
3228
/* cryptoauthlib includes */
3329
#include "mbedtls/atca_mbedtls_wrap.h"
3430
#include "tng_atca.h"
@@ -900,12 +896,12 @@ static esp_err_t esp_set_atecc608a_pki_context(esp_tls_t *tls, const void *pki)
900896
(void)cert_def;
901897
#if defined(CONFIG_ATECC608A_TNG) || defined(CONFIG_ATECC608A_TFLEX)
902898
#ifdef CONFIG_ATECC608A_TNG
903-
esp_ret = esp_init_atecc608a(ATECC608A_TNG_SLAVE_ADDR);
899+
esp_ret = esp_init_atecc608a(CONFIG_ATCA_I2C_ADDRESS);
904900
if (ret != ESP_OK) {
905901
return ESP_ERR_ESP_TLS_SE_FAILED;
906902
}
907903
#elif CONFIG_ATECC608A_TFLEX /* CONFIG_ATECC608A_TNG */
908-
esp_ret = esp_init_atecc608a(ATECC608A_TFLEX_SLAVE_ADDR);
904+
esp_ret = esp_init_atecc608a(CONFIG_ATCA_I2C_ADDRESS);
909905
if (ret != ESP_OK) {
910906
return ESP_ERR_ESP_TLS_SE_FAILED;
911907
}
@@ -925,7 +921,7 @@ static esp_err_t esp_set_atecc608a_pki_context(esp_tls_t *tls, const void *pki)
925921
return ESP_ERR_ESP_TLS_SE_FAILED;
926922
}
927923
#elif CONFIG_ATECC608A_TCUSTOM
928-
esp_ret = esp_init_atecc608a(ATECC608A_TCUSTOM_SLAVE_ADDR);
924+
esp_ret = esp_init_atecc608a(CONFIG_ATCA_I2C_ADDRESS);
929925
if (ret != ESP_OK) {
930926
return ESP_ERR_ESP_TLS_SE_FAILED;
931927
}

0 commit comments

Comments
 (0)