MbedTLS configuration STD functions

Hello,

I am building an example app that uses MbedTLS and non-offloaded sockets, because offloaded ones do not fit my needs - updating security credentials needs disabling the modem, while I perform a Bootstrap operation being connected to one server and obtain credentials for a Management server connection that need to be applied before Bootstrap connection. Also I intend to do runtime certificate provisioning that could not be achieved with offloaded sockets.

I use nRF9160DK. I had a working application on nCS 2.5 and I am trying to switch to nCS 3.1 but I can't figure out the MbedTLS configuration that will compile, because every time I get these errors:

/home/tomasz/zephyrproject/modules/crypto/mbedtls/include/mbedtls/check_config.h:637:2: error: #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites"
637 | #error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites"
| ^~~~~
/home/tomasz/zephyrproject/modules/crypto/mbedtls/include/mbedtls/check_config.h:643:2: error: #error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites"
643 | #error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites"
| ^~~~~
/home/tomasz/zephyrproject/modules/crypto/mbedtls/include/mbedtls/check_config.h:648:2: error: #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites"
648 | #error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites"
| ^~~~~
/home/tomasz/zephyrproject/modules/crypto/mbedtls/include/mbedtls/check_config.h:653:2: error: #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites"
653 | #error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites"
| ^~~~~
/home/tomasz/zephyrproject/modules/crypto/mbedtls/include/mbedtls/check_config.h:658:2: error: #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites"
658 | #error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites"
| ^~~~~

I have experimented with changes in these switches

CONFIG_NORDIC_SECURITY_BACKEND=y
CONFIG_OBERON_BACKEND=y
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_TLS_LIBRARY=y
CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_PLATFORM_NO_STD_FUNCTIONS=y

but I always get these errors. I can't manually define CONFIG_MBEDTLS_PLATFORM_C, I can't manually set anything like
CONFIG_MBEDTLS_PLATFORM_EXIT_ALT=y
CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT=y
CONFIG_MBEDTLS_PLATFORM_FPRINTF_ALT=y
CONFIG_MBEDTLS_PLATFORM_SNPRINTF_ALT=y
CONFIG_MBEDTLS_PLATFORM_TIME_ALT=y
or
CONFIG_MBEDTLS_PLATFORM_EXIT=y
CONFIG_MBEDTLS_PLATFORM_PRINTF=y
CONFIG_MBEDTLS_PLATFORM_FPRINTF=y
CONFIG_MBEDTLS_PLATFORM_SNPRINTF=y
CONFIG_MBEDTLS_PLATFORM_TIME=y
Using #defines in headers instead of prj.conf didn't work either.

I can't find any example of that in nCS repo. I found a pretty similar issue here Can't build Google IOT MQTT Sample for nRF9160 with nRF Connect SDK 2.3.0
but I found the related file https://github.com/nrfconnect/sdk-nrf/blob/v2.3.0/samples/net/mqtt/overlay-tls-native_posix.conf
and it does not seem to be anyhow related to my problem.
I must be missing something and I ask for help on how to enable non-offloaded, compiled in MbedTLS on nCS 3.1
Parents Reply Children
No Data
Related