This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

libmbedcrypto seems to be missing functions

I am attempting to use libmbedcrypto.a from the Thread/Zigbee SDK version 3.2.0.  I am linking it from:

external/openthread/lib/nrf52840/gcc/libmbedcrypto.a

and yet I am getting undefined reference errors for the function mbedtls_pk_write_key_der.  What do I need to do in order to have this mbedtls function available?  It appears in the corresponding pk.h file in /external/openthread/include/mbedtls.

Thanks in advance

  • Hi,

    The libmbedcrypto library is used by all the Thread examples, so it should be already linked inside the example projects. For example in SES you will find it under the Openthread folder:

    But the function mbedtls_pk_write_key_der() is not compiled inside the library, see mbedtls-config.h. You will need to clone the openthread repo from Github and configure and build the mbedtls library again with the functions your would want to use. If you want to include the mbedtls_pk_write_key_der function you need to define MBEDTLS_PK_WRITE_C in the config file.

    Please take a look at Building the latest OpenThread libraries in the infocenter, and remember to check the right commit before you build the libraries, see the Readme.txt file inside SDK_root/external/openthread/project/

    Best regards,

    Marjeris