Nucleo L031K6 is low memory target, because of that it is not supported in MbedOS6+ and with MbedOS lower than 6 it was probably supported only with bare metal profile or Mbed2 = no network connectivity.
Thanks, I do remember reading that. But I am not trying to use it with network connectivity. I just need mbedtls for the hashing functions so that I can authenticate to a secure I2C device.
So you will need to add to mbed_app.json something like this
{
"requires": ["bare-metal","mbedtls"]
}
I am not sure if this will be enough but the compiler will tell you what will be necessary to add from another mbed_lib.json files, I think. You must to try.
That has helped but has not completely solved the issue. I tried variations of “mbedtls” in the modules line but thought it was not working as the examples I found used nonexistent headers. I am now able to import mbedtls/sha1.h and define a structure of type mbedtls_sha1_context however the supporting functions are not linked in.
/main.cc:90: undefined reference to `mbedtls_sha1_init'
collect2: error: ld returned 1 exit status
From:
mbedtls_sha1_context dg;
mbedtls_sha1_init(&dg);
I can’t find any more guidance in getting it working via the modules system. I see bits and pieces of answers to other similar questions (usually about getting the networking or PKA code working) that solve the issue by putting mbedtls into the project directory and compiling it there. As far as I can tell this is not the intended method, and in my case it leads to a lot of compilation errors that I don’t think I should spend time fixing just yet.