<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NCS 3.4.0: Cannot disable mbed TLS / TF-M Crypto partition with modem-offloaded sockets</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/128800/ncs-3-4-0-cannot-disable-mbed-tls-tf-m-crypto-partition-with-modem-offloaded-sockets</link><description>Summary: CONFIG_MBEDTLS is force-enabled and won&amp;#39;t compile without PSA_CRYPTO, costing ~31 KB of secure RAM for unused functionality 
 I&amp;#39;ve just migrated my project from v.3.3.1 to v3.4.0 
 Since our application uses modem-offloaded TLS exclusively, we</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Aug 2026 09:18:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/128800/ncs-3-4-0-cannot-disable-mbed-tls-tf-m-crypto-partition-with-modem-offloaded-sockets" /><item><title>RE: NCS 3.4.0: Cannot disable mbed TLS / TF-M Crypto partition with modem-offloaded sockets</title><link>https://devzone.nordicsemi.com/thread/569990?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2026 09:18:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a20da99-2c23-455d-933c-e7711ae504ba</guid><dc:creator>Tomi Fontanilles</dc:creator><description>&lt;p&gt;Hi, developer here. It would be best if you would provide the full folder of an application that can be built in order for me to reproduce the issue you are seeing, investigate and fix it appropriately.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.4.0: Cannot disable mbed TLS / TF-M Crypto partition with modem-offloaded sockets</title><link>https://devzone.nordicsemi.com/thread/569662?ContentTypeID=1</link><pubDate>Wed, 29 Jul 2026 22:36:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28301aa0-e783-4d4c-986d-7004c9d5f119</guid><dc:creator>Regan0</dc:creator><description>&lt;p&gt;The Build fails with&amp;nbsp;&lt;span&gt;CONFIG_TFM_PROFILE_TYPE_MINIMAL=y&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;It also fails if I try&amp;nbsp;CONFIG_TFM_CMAKE_BUILD_TYPE_MINSIZEREL=y, unless I useCMake to strip out PSA_CRYPTO.&lt;/p&gt;
&lt;p&gt;Here are the warnings I get:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;warning: TFM_PARTITION_CRYPTO (defined at C:/ncs/v3.4.0/nrf/modules/..\modules/trusted-
firmware-m/Kconfig.tfm_minimal.defconfig:20, C:/ncs/v3.4.0/nrf/modules/trusted-
firmware-m\Kconfig.tfm.defconfig:86, C:/ncs/v3.4.0/zephyr/modules/trusted-
firmware-m/Kconfig.tfm.partitions:31, modules\trusted-firmware-m\Kconfig.tfm.partitions:31) was
assigned the value &amp;#39;n&amp;#39; but got the value &amp;#39;y&amp;#39;. See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_TFM_PARTITION_CRYPTO and/or look up
TFM_PARTITION_CRYPTO in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.


warning: UPDATEABLE_IMAGE_NUMBER (defined at
C:/ncs/v3.4.0/nrf/modules/..\samples\common\mcumgr_bt_ota_dfu/Kconfig:87, subsys/dfu/Kconfig:97) was
assigned the value &amp;#39;1&amp;#39; but got the value &amp;#39;&amp;#39;. Check these unsatisfied dependencies:
(((BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS) &amp;amp;&amp;amp; SOC_SERIES_NRF53 &amp;amp;&amp;amp;
NCS_SAMPLE_MCUMGR_BT_OTA_DFU) || (!MCUBOOT &amp;amp;&amp;amp; IMG_MANAGER)) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_UPDATEABLE_IMAGE_NUMBER and/or look up
UPDATEABLE_IMAGE_NUMBER in the menuconfig/guiconfig interface. The Application Development Primer,
Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be
helpful too.


warning: MCUBOOT_UPDATE_FOOTER_SIZE (defined at subsys/dfu/Kconfig:55) was assigned the value &amp;#39;0x30&amp;#39;
but got the value &amp;#39;&amp;#39;. Check these unsatisfied dependencies: MCUBOOT_IMG_MANAGER (=n), IMG_MANAGER
(=n). See http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MCUBOOT_UPDATE_FOOTER_SIZE and/or
look up MCUBOOT_UPDATE_FOOTER_SIZE in the menuconfig/guiconfig interface. The Application
Development Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of
the manual might be helpful too.

error: Aborting due to Kconfig warnings

CMake Error at C:/ncs/v3.4.0/zephyr/cmake/modules/kconfig.cmake:424 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  C:/ncs/v3.4.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
  C:/ncs/v3.4.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
  C:/ncs/v3.4.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
  CMakeLists.txt:15 (find_package)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I get this additional warning if _MINSIZEREL is y&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;warning: PSA_WANT_ALG_HMAC_DRBG (defined at C:/ncs/v3.4.0/nrf/modules/..\subsys\nrf_security\src/drivers/Kconfig:49) has direct dependencies PSA_WANT_GENERATE_RANDOM &amp;amp;&amp;amp; PSA_CRYPTO &amp;amp;&amp;amp; NRF_SECURITY with value n, but is currently being y-selected by the following symbols:
 - TFM_PROFILE_TYPE_MINIMAL (defined at C:/ncs/v3.4.0/nrf/modules/trusted-firmware-m/Kconfig:329), with value y, direct dependencies &amp;lt;choice TFM_PROFILE_TYPE&amp;gt; (value: y), and select condition &amp;lt;choice TFM_PROFILE_TYPE&amp;gt; (value: y)
Parsing C:/Github/myproject/Kconfig
Loaded configuration &amp;#39;C:/ncs/v3.4.0/zephyr/boards/nordic/nrf9151dk/nrf9151dk_nrf9151_ns_defconfig&amp;#39;
Merged configuration &amp;#39;C:/Github/myproject/prj.conf&amp;#39;
Merged configuration &amp;#39;C:/Github/myproject/debug.conf&amp;#39;
Merged configuration &amp;#39;C:/Github/myproject/extra.conf&amp;#39;
Merged configuration &amp;#39;C:/Github/myproject/build/myproject/zephyr/misc/generated/extra_kconfig_options.conf&amp;#39;
Merged configuration &amp;#39;C:/Github/myproject/build/myproject/zephyr/.config.sysbuild&amp;#39;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here is my conf file (I have a separate one just for TFM):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# TF-M and app overlay (NCS 3.4.0 / Zephyr 4.4)
#
# This build consumes CONFIG_TFM_* symbols from the app configuration path.
# Keep TF-M partition/module settings here rather than in sysbuild/tfm.conf.

CONFIG_BUILD_WITH_TFM=y

# nRF Cloud uses modem-managed TLS credentials and socket offload, so the app
# itself never calls into MBEDTLS/PSA Crypto. MBEDTLS cannot be disabled here:
# BUILD_WITH_TFM has `imply MBEDTLS if !TFM_USE_NS_APP` (Kconfig.tfm), and
# because MBEDTLS&amp;#39;s prompt is conditional (&amp;quot;bool ... if !MBEDTLS_PROMPTLESS&amp;quot;),
# an explicit `# CONFIG_MBEDTLS is not set` is silently ignored by Kconfig -
# MBEDTLS gets forced to &amp;#39;y&amp;#39; regardless (see the &amp;quot;assigned &amp;#39;n&amp;#39; but got &amp;#39;y&amp;#39;&amp;quot;
# warning). The forced-on mbed TLS 4.x library then fails to compile with
# PSA_CRYPTO off (mbedtls_error_pair_t only exists under
# MBEDTLS_PSA_CRYPTO_CLIENT, which is &amp;quot;def_bool y depends on PSA_CRYPTO&amp;quot;).
# Kconfig-level workarounds are dead ends in NCS 3.4.0 (MBEDTLS_CUSTOM is
# blocked by an nrf_security CMake FATAL_ERROR; select of
# MBEDTLS_PSA_CRYPTO_CLIENT is a hard Zephyr Kconfig error). Instead,
# MYPROJECT_STRIP_MBEDTLS (project Kconfig + CMakeLists.txt) stubs out the
# unused mbed TLS library target at the CMake level so PSA_CRYPTO and
# TFM_PARTITION_CRYPTO can stay off (saves ~24 KiB secure SRAM + ~33 KB
# TF-M flash vs. letting the Crypto partition back in).
# CONFIG_ENTROPY_PSA_CRYPTO_RNG is not set

# PSA_CRYPTO has a devicetree-gated &amp;quot;default y&amp;quot; (nrf_security/Kconfig) that
# fires whenever a zephyr,psa-crypto-rng node is present, regardless of any
# app Kconfig. Left unset, it silently re-enables PSA_CRYPTO_PROVIDER_TFM,
# which `select`s TFM_PARTITION_CRYPTO back on. Must be explicitly disabled.
# Measured cost of allowing this: TF-M needs ~37,180 B RAM / 56,056 B flash
# with Crypto on, vs. 6,132 B RAM / 23,128 B flash with Crypto off.
# CONFIG_PSA_CRYPTO is not set

# Silence TF-M logs forwarded to NS world
CONFIG_TFM_LOG_LEVEL_SILENCE=y

# Minimal profile pulls in services we no longer want.
CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
# CONFIG_TFM_PROFILE_TYPE_MINIMAL is not set

# Force TF-M to be size-optimized even when app uses debug build.
# This is an app-side Kconfig that controls the TF-M ExternalProject build type.
CONFIG_TFM_CMAKE_BUILD_TYPE_MINSIZEREL=y

# Keep only the platform service needed by current NS reboot paths.
CONFIG_TFM_PARTITION_PLATFORM=y
# CONFIG_TFM_PARTITION_CRYPTO is not set
# CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE is not set
# CONFIG_TFM_PARTITION_PROTECTED_STORAGE is not set
# CONFIG_TFM_PARTITION_INITIAL_ATTESTATION is not set
CONFIG_TFM_ALLOW_NON_SECURE_RESET=y
# CONFIG_TFM_ALLOW_NON_SECURE_FAULT_HANDLING is not set

# CONFIG_TFM_SECURE_UART is not set
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;By default, I&amp;#39;m using CMake to strip out PSA_CRYPTO. If I don&amp;#39;t do that, build fails.&lt;/p&gt;
&lt;p&gt;I also note that I am using a DEBUG build.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.4.0: Cannot disable mbed TLS / TF-M Crypto partition with modem-offloaded sockets</title><link>https://devzone.nordicsemi.com/thread/569638?ContentTypeID=1</link><pubDate>Wed, 29 Jul 2026 12:40:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:607294ee-a8fa-4aa3-b61d-0353ee252fbe</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Regan,&amp;nbsp;&lt;br /&gt;Thanks for the feedback. But I&amp;#39;m not so sure why the modem_shell doesn&amp;#39;t have the same problem ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;From what I can see in the \build\modem_shell\zephyr\.config we do have:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;CONFIG_MBEDTLS=y&lt;/p&gt;
&lt;p&gt;CONFIG_PSA_CRYPTO_PROVIDER_TFM=y&lt;/p&gt;
&lt;p&gt;CONFIG_PSA_CRYPTO=y&lt;/p&gt;
&lt;p&gt;But the TFM partition of the sample takes only&amp;nbsp;6152 B as shown in the previous reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you configured&amp;nbsp;CONFIG_TFM_PROFILE_TYPE_MINIMAL=y ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;What make the modem_shell difference from yours ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.4.0: Cannot disable mbed TLS / TF-M Crypto partition with modem-offloaded sockets</title><link>https://devzone.nordicsemi.com/thread/569600?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2026 22:34:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc48c0af-497e-4907-ad0c-52c8999b2e43</guid><dc:creator>Regan0</dc:creator><description>&lt;p&gt;Here are my current build footprint stats:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[90/92] Linking C executable bin\tfm_s.axf
Memory region         Used Size  Region Size  %age Used
           FLASH:       23128 B      56832 B     40.70%
             RAM:        6132 B        16 KB     37.43%
[25/476] Performing install step for &amp;#39;tfm&amp;#39;
-- Install configuration: &amp;quot;MinSizeRel&amp;quot;
----- Installing platform NS -----
[475/476] Linking C executable zephyr\zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:      405960 B     433978 B     93.54%
             RAM:      221344 B     227968 B     97.09%
        IDT_LIST:           0 B        32 KB      0.00%
[6/221] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.4.0 (C:/ncs/v3.4.0/zephyr), build: ncs-v3.4.0
[221/221] Linking C executable zephyr\zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       28048 B        40 KB     68.48%
             RAM:       16440 B        88 KB     18.24%
        IDT_LIST:           0 B        32 KB      0.00%&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have been able to get my project to build (and happily run) with a hack, using CMake to strip MBEDTLS out and replace it with an empty stub, but it&amp;#39;s an ugly solution. It&amp;#39;s my understanding the modem-offloaded TLS is a requirement for nRFCloud connection and that&amp;#39;s indeed what my project can still do (in v3.3.1 and 3.4.0)&lt;br /&gt;&lt;br /&gt;If it helps your team, I got an AI agent to summarise the problem and temporary solution:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;em&gt;&amp;quot;The forced-on mbed TLS 4.x library then fails to compile with&amp;nbsp;PSA_CRYPTO off (mbedtls_error_pair_t only exists under&amp;nbsp;MBEDTLS_PSA_CRYPTO_CLIENT, which is &amp;quot;def_bool y depends on PSA_CRYPTO&amp;quot;).&amp;nbsp;Kconfig-level workarounds are dead ends in NCS 3.4.0 (MBEDTLS_CUSTOM is&amp;nbsp;blocked by an nrf_security CMake FATAL_ERROR; select of&amp;nbsp;MBEDTLS_PSA_CRYPTO_CLIENT is a hard Zephyr Kconfig error). Instead,&amp;nbsp;MYPROJECT_STRIP_MBEDTLS (project Kconfig + CMakeLists.txt) stubs out the&amp;nbsp;unused mbed TLS library target at the CMake level so PSA_CRYPTO and&amp;nbsp;TFM_PARTITION_CRYPTO can stay off (saves ~24 KiB secure SRAM + ~33 KB&amp;nbsp;TF-M flash vs. letting the Crypto partition back in).&amp;nbsp;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;em&gt;PSA_CRYPTO has a devicetree-gated &amp;quot;default y&amp;quot; (nrf_security/Kconfig) that&amp;nbsp;fires whenever a zephyr,psa-crypto-rng node is present, regardless of any&amp;nbsp;app Kconfig. Left unset, it silently re-enables PSA_CRYPTO_PROVIDER_TFM,&amp;nbsp;which `select`s TFM_PARTITION_CRYPTO back on. Must be explicitly disabled.&amp;nbsp;Measured cost of allowing this: TF-M needs ~37,180 B RAM / 56,056 B flash&amp;nbsp;with Crypto on, vs. 6,132 B RAM / 23,128 B flash with Crypto off.&amp;quot;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;Coming up with a minimal project may take time and I don&amp;#39;t want to slow up your team&amp;#39;s deliberations trying to find a clean workaround. I think you&amp;#39;ll find that others will have the same problem too. I would be glad to know if forcing PSA_CRYPTO on is part of some grand plan that I should be aware of. As you can see from my app footprint, resources are already tight.&lt;/p&gt;
&lt;p&gt;It seems to me that my hack can already show that making PSA_CRYPTO&amp;#39;s inclusion &lt;strong&gt;optional&lt;/strong&gt; doesn&amp;#39;t seem to hurt.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.4.0: Cannot disable mbed TLS / TF-M Crypto partition with modem-offloaded sockets</title><link>https://devzone.nordicsemi.com/thread/569559?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2026 10:52:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ee95b3b-be0b-4e69-bcad-05874480e551</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi again Regan,&amp;nbsp;&lt;br /&gt;Could you send us a minimal project so we can have a look at your configurations and test here ?&amp;nbsp;&lt;br /&gt;Have you used&amp;nbsp;&lt;span&gt;CONFIG_TFM_PROFILE_TYPE_MINIMAL=y ?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;It&amp;#39;s also suggested that you look at the modem_shell sample which also uses socket offloading.&amp;nbsp;&lt;br /&gt;Here is the memory footprint in the sample:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[140/142] Linking C executable bin/tfm_s.axf
Memory region         Used Size  Region Size  %age Used
           FLASH:       32144 B        32 KB     98.10%
             RAM:        6152 B        32 KB     18.77%&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS 3.4.0: Cannot disable mbed TLS / TF-M Crypto partition with modem-offloaded sockets</title><link>https://devzone.nordicsemi.com/thread/569550?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2026 07:55:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83df0120-a3f4-455a-8abd-5072590d1153</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Regan,&amp;nbsp;&lt;br /&gt;I have reported this internally. Will get back when we have more info from the team.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>