Page 1 of 1

Is it possible to use mutex on secure_element atecc608_ecdsa code?

Posted: Tue May 25, 2021 10:59 am
by Ismael
Hello,
I want to know is is there any possibility to add a mutex usage to this component.
The reason I want to do this is because on my board development I2C is shared with an ATECC608, an GPIO expansion board with an RTC timer. This components are implemented using UncleRus/esp-idf-lib (https://github.com/UncleRus/esp-idf-lib) components.

Is I2C library protected itself to avoid multiple access? or has secure element any mechanism to use same mutex created for esp-idf-lib?

Thanks.

Re: Is it possible to use mutex on secure_element atecc608_ecdsa code?

Posted: Mon Jul 05, 2021 11:17 am
by AngelVer
The only way we found to do that in my company is modifying the sdk. Will be awesome if espressif include the mutex to the ATECC608 usage on i2c bus. Is not a hard task.

Re: Is it possible to use mutex on secure_element atecc608_ecdsa code?

Posted: Tue Jul 06, 2021 7:29 am
by Ismael
Hello AngelVer,
Did you add this functionality directly to hal_esp32_i2c.c file? (esp-cryptoauthlib/cryptoauthlib/third_party/hal/esp32/hal_esp32_i2c.c)

Making some search into the cryptoauthlib files I found that there is a implementation to use mutex over esp32 (defined in esp-cryptoauthlib/cryptoauthlib/lib/hal/hal_freertos.c). This implementation is only used on function "pkcs11_os_lock_mutex" (esp-cryptoauthlib/cryptoauthlib/lib/pkcs11/pkcs11_os.c).