<?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>Why can&amp;#39;t TF-M RAM partition on NRF9151 be smaller than 32KB?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127224/why-can-t-tf-m-ram-partition-on-nrf9151-be-smaller-than-32kb</link><description>Using: 
 
 NRF9151 
 TF-M enabled 
 NCS 3.2.2 
 
 I&amp;#39;m trying to find more space for my heap on the nrf9151 and I&amp;#39;m disappointed that with a minimal implementation of TF-M I can&amp;#39;t get the RAM footprint lower than 32KB. I&amp;#39;m not too fussed about the flash</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Mar 2026 23:14:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127224/why-can-t-tf-m-ram-partition-on-nrf9151-be-smaller-than-32kb" /><item><title>RE: Why can't TF-M RAM partition on NRF9151 be smaller than 32KB?</title><link>https://devzone.nordicsemi.com/thread/562971?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2026 23:14:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a46f9a36-28aa-4bfa-800a-179fe9e7dd3c</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Regan0,&lt;/p&gt;
&lt;p&gt;Thank you for your patience.&lt;/p&gt;
&lt;p&gt;After discussing with some colleagues,&amp;nbsp;I reached the conclusion that as TF-M, at least in the minimal profile, doesn&amp;#39;t use dynamic memory allocation. Therefore, it should not use more RAM than&amp;nbsp;reported in the build log.&lt;/p&gt;
&lt;p&gt;Thus, you can reduce the RAM size. The only concern would be for &lt;a href="https://docs.nordicsemi.com/bundle/ncs-3.2.3/page/nrf/security/tfm/tfm_building.html#tf-m-partition-alignment-requirements"&gt;the memory alignment requirement&lt;/a&gt;, which 16kB would satisfy for the nRF9151.&lt;/p&gt;
&lt;p&gt;On another note,&amp;nbsp;a colleague also pointed out that the application&amp;nbsp;can override the Kconfig definition in its own Kconfig file, so that&amp;#39;s another alternative to reconfigure TF-M RAM size.&lt;/p&gt;
&lt;p&gt;However, I think using pm_static.yml is the better way, since you will eventually want to have bootloaders and DFU, for which having a static partitioning is highly recommended&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't TF-M RAM partition on NRF9151 be smaller than 32KB?</title><link>https://devzone.nordicsemi.com/thread/562591?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2026 22:35:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47f9f30c-6bea-425f-8086-55085ad0650f</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;You are right. I can&amp;#39;t believe I forgot that we can always use pm_static.yml to&amp;nbsp;enforce a fixed memory partitioning.&lt;/p&gt;
&lt;p&gt;Regarding measuring&amp;nbsp;maximum usage and how safe it is to reduce the RAM use, I have&amp;nbsp;started in internal inquiry. I will keep you updated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't TF-M RAM partition on NRF9151 be smaller than 32KB?</title><link>https://devzone.nordicsemi.com/thread/562484?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2026 22:18:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e67c062-3082-45d0-8afe-0edd82c3c10e</guid><dc:creator>Regan0</dc:creator><description>&lt;p&gt;Thanks, I&amp;#39;m not prepared to fork sdk-nrf. I&amp;#39;ve found another way around it if anyone&amp;#39;s interested.&lt;/p&gt;
&lt;p&gt;In my pm_static.yml file, I&amp;#39;ve put:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;# Force TF-M secure SRAM reservation&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;# This overrides CONFIG_PM_PARTITION_SIZE_TFM_SRAM defaults from Kconfig.tfm.pm&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;# even when TFM minimal profile fixes that symbol to 0x8000.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;tfm_sram:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; address: 0x20000000&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; size: 0x6000&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&amp;nbsp; region: sram_primary&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;This has lowered TF-M RAM allocation to 24KB. I&amp;#39;m still trying to get to grips with TF-M. Currently, TF-M indicates only 10KB of static RAM use at start-up. &lt;em&gt;Is there a way that I can measure a high-water mark for it?&amp;nbsp; With a minimal implementation, can I get away with only 16KB of RAM set aside?&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;It seems ridiculous that of a SoC promoted as having 256KB RAM available, 32KB+ disappears to the mandatory TF-M and 17KB+ disappears to modem libraries immediately. That&amp;#39;s &amp;gt;16%&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why can't TF-M RAM partition on NRF9151 be smaller than 32KB?</title><link>https://devzone.nordicsemi.com/thread/562471?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2026 17:11:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fc4fd33-f4c4-4804-9838-9a5b0438e66d</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi Regan0,&lt;/p&gt;
&lt;p&gt;I found that&amp;nbsp;the&amp;nbsp;root cause is in this line:&lt;br /&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v3.2.3/modules/trusted-firmware-m/Kconfig.tfm.pm#L11"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v3.2.3/modules/trusted-firmware-m/Kconfig.tfm.pm#L11&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;While using&amp;nbsp;CONFIG_TFM_PROFILE_TYPE_MINIMAL, CONFIG_PM_PARTITION_SIZE_TFM_SRAM doesn&amp;#39;t have a prompt and therefore can only use the default value.&lt;/p&gt;
&lt;p&gt;It seems to be the idea is that the minimal profile is provided&amp;nbsp;as is, without any configuration&amp;nbsp;possible.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The alternative would be to change the SDK file there.&amp;nbsp;Version control of the project might get a little complicated with this approach, because you will need to fork&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/"&gt;sdk-nrf&lt;/a&gt;.&amp;nbsp;Below are some links that&amp;nbsp;will be helpful should you choose this approach.&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-3.2.3/page/zephyr/develop/application/index.html"&gt;Application Development&lt;/a&gt;&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-3.2.3/page/nrf/dev_model_and_contributions/adding_code.html#workflow_4_workspace_application_repository_recommended"&gt;Adding your own code&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>