<?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>Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126439/decrease-rom-footprint-of-tfm</link><description>Hi! I am trying to find the optimal configuration of TFM for our project with the nrf9160. I am using NCS 2.6.1. I want to be able to use the internal trusted storage and crypto operations preferably. with this config: i get this when building the tfm</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Feb 2026 08:29:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126439/decrease-rom-footprint-of-tfm" /><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/560082?ContentTypeID=1</link><pubDate>Mon, 02 Feb 2026 08:29:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:095ee27f-189c-4d9e-be84-037382a9b84f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I got an update today on this ticket. The only other thing we can think of is changing the TF-M modes. If you use the IPC mode, that uses a bit more space. This is configured with CONFIG_TFM_IPC. You can disable this and switch to SFN mode if you&amp;#39;re okay with having less security isolation. SFN will be inferior in security but it&amp;#39;s still better than not using Trustzone at all.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/559437?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2026 08:31:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a306d389-fd82-489b-b93f-821d42d8a95b</guid><dc:creator>mackz</dc:creator><description>&lt;p&gt;Hi again, at the moment it is not possible for me to migrate to a newer version but i will keep it in mind if it becomes possible in the future.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/559430?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2026 06:47:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f9bfa42-a8a3-4545-8dfe-1418de375727</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again Marcus&lt;/p&gt;
&lt;p&gt;And migrating to a newer version of nRF Connect SDK was not an option for you, was it so? I have asked for more suggestions, but can&amp;#39;t guarantee we have more to come with. With static key slots you should be able to save close to 1kb I think.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/559266?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2026 13:01:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:266c0852-0924-4a56-807f-1d18a9466383</guid><dc:creator>mackz</dc:creator><description>&lt;p&gt;I got:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;tfm_memory_testing/prj.conf:49: warning: attempt to assign the value &amp;#39;y&amp;#39; to the undefined symbol MBEDTLS_PSA_STATIC_KEY_SLOTS&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It seems like&amp;nbsp;&lt;strong&gt;CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS&lt;/strong&gt; is a newer configuration that does not exist in NCS 2.6.1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And only setting:&lt;br /&gt;&lt;strong&gt;CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=4&lt;br /&gt;&lt;/strong&gt;did not do any difference to the flash size of TFM.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/559219?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2026 06:35:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32ecea5c-7ff2-42c2-8b8b-64287c66961f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;I got a suggestion today to save some more space on your end. Try enabling static key slots by tweaking the following configs to these values:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CONFIG_MBEDTLS_PSA_KEY_SLOT_COUNT=4 # Affects how many keys can be used at the same time&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/559182?ContentTypeID=1</link><pubDate>Tue, 20 Jan 2026 14:30:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63eda59a-ebd3-47b1-86a5-f62423d3500f</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Because of security fixes, as well as if you want to update your application yourself with features in the futures, if you have very little room left, you might render yourself unable to do any firmware updates for any reasons.&lt;/p&gt;
&lt;p&gt;If you are certain that you won&amp;#39;t make updates, it should be fine to cut it close, but it still isn&amp;#39;t something we recommend.&lt;/p&gt;
&lt;p&gt;I have asked the developers now, but it might take some time to get more suggestions on how to reduce the TF-M size further.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/559134?ContentTypeID=1</link><pubDate>Tue, 20 Jan 2026 09:59:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98bd370f-8bad-4ae9-b820-1de92dd57e72</guid><dc:creator>mackz</dc:creator><description>&lt;p&gt;&amp;nbsp;When i use the MINIMAL profile of TFM this is what i get as memory usage:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;Memory region         Used Size  Region Size  %age Used
           FLASH:       31592 B      32256 B     97.94%
             RAM:       14392 B        32 KB     43.92%&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Is your recommendation that the flash memory should not be capped to 32kB since it is so close to that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/559047?ContentTypeID=1</link><pubDate>Mon, 19 Jan 2026 14:18:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73c5d131-222b-46d4-8e90-0aca3c7480b4</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;Because security fixes may only be available for new versions. And new versions may come with more flash/ram usage.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/559006?ContentTypeID=1</link><pubDate>Mon, 19 Jan 2026 12:22:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2274a020-582c-4886-99d5-422f66f1682b</guid><dc:creator>mackz</dc:creator><description>&lt;p&gt;If there is any possibility to get under i would like to know.&lt;br /&gt;And i do not really understand what you mean when you say that future updates to the application might break the configuration. Does the tfm image size change with the application? If i can find a configuration that works and gives me the ability to use the features i need i do not see any particular reason to why i would change that.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/558982?ContentTypeID=1</link><pubDate>Mon, 19 Jan 2026 10:12:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16c72fc5-9e97-4020-94f4-34d1fcdb0799</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Marcus&lt;/p&gt;
&lt;p&gt;We&amp;#39;re struggling to find more suggestions to optimize flash more for you here. But after discussing this with my colleagues I want to reiterate that it is not recommended to just barely have enough room for your application in the device&amp;#39;s flash, so even if you are able to optimize flash to fit into the flash with a few bytes to spare, as that will mean that any kind of update in the future of this application will likely reintroduce this issue, so we can&amp;#39;t recommend going ahead with this.&lt;/p&gt;
&lt;p&gt;If you still want to move forward with it, we&amp;#39;ll try to keep assisting you with what we can of course.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/558906?ContentTypeID=1</link><pubDate>Fri, 16 Jan 2026 14:27:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24a10108-01d9-467f-912d-7218d07589c5</guid><dc:creator>mackz</dc:creator><description>&lt;p&gt;Right now i am trying to optimize for flash, i have gotten the ram footprint to where i want it.&lt;br /&gt;Yes the configs that i have mentioned above is me trying to get a custom build to fit my needs.&lt;br /&gt;and the size i get when i have the the partitions i need ( crypto and ITS) is the result i mentioned in a previous answer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The only reason for me wanting to get it below 64kB is because i am already so close to it and it would make it easier to create the static partitioning if i could cap it at that.&lt;br /&gt;&lt;br /&gt;My application is already close to the limit if i let TFM use 96kB since i use mcuboot and want to be able to do ota updates with swap. So that is the reason for me trying to optimize it as much as i can.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/558802?ContentTypeID=1</link><pubDate>Thu, 15 Jan 2026 13:04:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6494a29-2f87-4b48-bea2-dfa6237c9a29</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi mackz,&lt;/p&gt;
&lt;p&gt;So to be on the same page, are you optimizing RAM or Flash footprint?&lt;/p&gt;
&lt;p&gt;Either way, have you looked into custom profile build?&lt;br /&gt;I see that you have a case where that topic is brought up:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/120457/crypto-operations-to-generate-key-pair-when-tfm-profile-is-set-to-minimal"&gt;Crypto operations to generate key pair when TFM profile is set to minimal.&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please refer to &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/tfm/tfm_building.html"&gt;this guide&lt;/a&gt; and determine which TF-M partitions you need. We first build with only the Partition you need, then we also start taking away unused features from those partition. Please give me an update on what size you have.&lt;/p&gt;
&lt;p&gt;Also, as&amp;nbsp;PaKa and Achim mentioned, having TF-M barely fit is not a good idea. It&amp;#39;s better to have plenty of space reserved to it. Do you absolutely needs it to occupy only 64kB? Can you not give it a little more? If so, why, in case we can find alternatives there?&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/558479?ContentTypeID=1</link><pubDate>Mon, 12 Jan 2026 09:19:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06304c8e-37ed-4c01-93c6-2243d29956aa</guid><dc:creator>mackz</dc:creator><description>&lt;p&gt;If i change the ram size from:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;tfm:
  address: 0x8200
  end_address: 0x20000
  region: flash_primary
  size: 0x17e00  # 95.5KB for TFM&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;to 64KB i get flash overflow when building the tfm image.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/558435?ContentTypeID=1</link><pubDate>Sat, 10 Jan 2026 12:15:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c551dbb6-26a9-486b-8a37-bc85280e19e5</guid><dc:creator>Achim Kraus</dc:creator><description>&lt;p&gt;FMOPV, not only for the TF-M part, a that small amount of free space will come with a high risk. The last NCS updates always increased the sizes of apps (I haven&amp;#39;t analyzed it, but from 2.9.2 to 3.1.0 my apps have increased theirs size, so I had to disable functions.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/558409?ContentTypeID=1</link><pubDate>Fri, 09 Jan 2026 13:55:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:943d21ff-e6b5-40fb-bbfd-25cabad6a1fe</guid><dc:creator>PaKa</dc:creator><description>&lt;p&gt;Remember 64kB is 65536 bytes so you are below 64kB today but better to have some margin if you need to make fixes to the code later.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/558401?ContentTypeID=1</link><pubDate>Fri, 09 Jan 2026 13:09:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2468930-aa11-4976-8b6d-c711ceed185b</guid><dc:creator>mackz</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;config MBEDTLS_PSA_CRYPTO_STORAGE_C
	bool &amp;quot;PSA storage for persistent keys&amp;quot; if !BUILD_WITH_TFM
	default y if BUILD_WITH_TFM
	help
	  Corresponds to MBEDTLS_PSA_CRYPTO_STORAGE_C setting in mbed TLS config file.&lt;/pre&gt;&lt;br /&gt;i got this when trying to disable&amp;nbsp;CONFIG_MBEDTLS_PSA_CRYPTO_STORAGE_C:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;warning: MBEDTLS_PSA_CRYPTO_STORAGE_C (defined at /home/marcus/ncs/v2.6.1/nrf/modules/trusted-
firmware-m/Kconfig.mbedtls_minimal.defconfig:68,
/home/marcus/ncs/v2.6.1/nrf/subsys/nrf_security/Kconfig.psa:53) 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_MBEDTLS_PSA_CRYPTO_STORAGE_C and/or look up
MBEDTLS_PSA_CRYPTO_STORAGE_C 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.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and using these configs:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_TFM_CRYPTO_RNG_MODULE_ENABLED=y
CONFIG_TFM_CRYPTO_KEY_MODULE_ENABLED=y
CONFIG_TFM_CRYPTO_CIPHER_MODULE_ENABLED=y
CONFIG_TFM_CRYPTO_HASH_MODULE_ENABLED=n
CONFIG_TFM_CRYPTO_MAC_MODULE_ENABLED=n
CONFIG_TFM_CRYPTO_AEAD_MODULE_ENABLED=n
CONFIG_TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED=n
CONFIG_TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED=n
CONFIG_TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED=n&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;gave me the same result:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;[190/194] Linking C executable bin/tfm_s.axf
Memory region         Used Size  Region Size  %age Used
           FLASH:       64360 B      97792 B     65.81%
             RAM:       21684 B        32 KB     66.17%&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;Thanks for continuing to assist me with this!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Decrease rom footprint of TFM</title><link>https://devzone.nordicsemi.com/thread/558384?ContentTypeID=1</link><pubDate>Fri, 09 Jan 2026 11:58:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9592c19a-cd4c-4ba9-98ac-0810e4807f53</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Marcus,&lt;/p&gt;
&lt;p&gt;It is hard to say or suggest without knowing your use case. Do you save PSA keys persistently? If not you may disable that storage library (&lt;span&gt;CONFIG_MBEDTLS_PSA_CRYPTO_STORAGE_C=n&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Keep only those backends that you use and disable others. For example if you are using AES+RNG then just keep&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;CONFIG_TFM_CRYPTO_RNG_MODULE_ENABLED=y&lt;br /&gt;CONFIG_TFM_CRYPTO_KEY_MODULE_ENABLED=y&lt;br /&gt;CONFIG_TFM_CRYPTO_CIPHER_MODULE_ENABLED=y&lt;/p&gt;
&lt;p&gt;Disable other unused modules.&amp;nbsp;&lt;br /&gt;CONFIG_TFM_CRYPTO_HASH_MODULE_ENABLED=n&lt;br /&gt;CONFIG_TFM_CRYPTO_MAC_MODULE_ENABLED=n&lt;br /&gt;CONFIG_TFM_CRYPTO_AEAD_MODULE_ENABLED=n&lt;br /&gt;CONFIG_TFM_CRYPTO_ASYM_ENCRYPT_MODULE_ENABLED=n&lt;br /&gt;CONFIG_TFM_CRYPTO_ASYM_SIGN_MODULE_ENABLED=n&lt;br /&gt;CONFIG_TFM_CRYPTO_KEY_DERIVATION_MODULE_ENABLED=n&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I will ask my colleague who has much deeper knowledge than me in crypto to have a brief look at this and comment if he has any inputs.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>