Issue combining sample that uses CONFIG_NRF_SECURITY and CONFIG_MBEDTLS_BUILTIN

I have two projects, project MQTT, that was built around the Secure MQTT Sensor/Actuator sample and project CRYPTO, that was built around the Crypto AES-CCM sample. I am trying to combine both codebases into a single project. But when I append the prj.conf from project CRYPTO to project MQTT and build, there are build errors. It seems to be related to the fact that the CRYPTO project uses `CONFIG_NRF_SECURITY=y` which selects `DISABLE_MBEDTLS_BUILTIN `, whereas the MQTT sets `CONFIG_MBEDTLS_BUILTIN=y`. My code does not directly call mbedtls functions, but it uses Zephyr's MQTT library with TLS (e.g.: `client->transport.type = MQTT_TRANSPORT_SECURE;`).

Here's the combined proj.conf file:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
######## MQTT PROJECT CONFIG ###########
# Enable network stack
CONFIG_NETWORKING=y
# CONFIG_NET_LOG=y
# Enable IPv4
CONFIG_NET_IPV4=y
# Enable IPv6
CONFIG_NET_IPV6=n
# Enable TCP
CONFIG_NET_TCP=y
# Enable DHCP
# CONFIG_NET_DHCPV4=y
# Enable Sockets (used by MQTT lib)
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Build error:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
* Executing task: nRF Connect: Build [pristine]: myproj-firmware/build
Building myproj-firmware
west build --build-dir /Users/redacted/code/redacted/myproj/myproj-firmware/build /Users/redacted/code/redacted/myproj/myproj-firmware --pristine --board nrf52840dk/nrf52840 --sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=/Users/redacted/code/nordic/myboards;/Users/redacted/code/redacted/myproj/myproj-firmware
-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /opt/nordic/ncs/toolchains/b8efef2ad5/opt/python@3.12/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
-- Cache files will be written to: /Users/redacted/Library/Caches/zephyr
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf52840dk, qualifiers: nrf52840
Parsing /opt/nordic/ncs/v2.9.1/zephyr/share/sysbuild/Kconfig
Loaded configuration '/Users/redacted/code/redacted/myproj/myproj-firmware/build/_sysbuild/empty.conf'
Merged configuration '/Users/redacted/code/redacted/myproj/myproj-firmware/build/_sysbuild/empty.conf'
Configuration saved to '/Users/redacted/code/redacted/myproj/myproj-firmware/build/zephyr/.config'
Kconfig header saved to '/Users/redacted/code/redacted/myproj/myproj-firmware/build/_sysbuild/autoconf.h'
--
*************************************
* Running CMake for myproj-firmware *
*************************************
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Any idea how to fix this?