We've added these compile definitions
Code: Select all
add_compile_definitions(MBEDTLS_ECDH_GEN_PUBLIC_ALT)
add_compile_definitions(MBEDTLS_ECDH_COMPUTE_SHARED_ALT)
We always had 2 connections, one to our iot cloud and one to a file upload server.
We've recently added a third connection to a local device. But when we open https requests to that server during a file upload. It's common to see that the function calib_genkey_base is called with a invalid ATCADevice pointer.
After some digging we found out that every time a request is opened to a server ,the function atcab_init_device and atcab_release are called. The atcap_release function releases the only _gDevice instance that is used for all the communication to the server. So if one thread calls this function and the other thread is still talking to the secure element. the second thread fails.
Is there a reason the secure element is initialized/deinitialized on every https call?
How can we work arround this issue?