<?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>Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94523/downsizing-the-tfm-with-psa-support</link><description>Hi, 
 I am developing application on NRF9160 right now. 
 When I trying to enable AES CTR enc/dec follow the aes_ctr sample in my application, I got the FLASH overflow error. 
 I realized it cause by the TFM size increase from 48kB to 256kB after enable</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Feb 2024 08:07:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94523/downsizing-the-tfm-with-psa-support" /><item><title>RE: Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/thread/469159?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2024 08:07:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49d0535a-4676-41e1-a7dd-1d1e396ead83</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;That is correct, you will need&amp;nbsp;&lt;span&gt;RSA-2048 for that.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/thread/469094?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2024 15:31:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e907152-c927-42d1-9734-5297afa6772e</guid><dc:creator>GilDev</dc:creator><description>&lt;p&gt;Thanks for the information. If I&amp;rsquo;m not mistaken though, using AWS IoT (like with the Nordic&amp;rsquo;s aws_iot sample) requires RSA?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/thread/469093?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2024 15:30:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:642563b6-220d-4714-bc36-975eaa560609</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There are no major improvements on TF-M size optimization and configurability, but we are working on it. There have been one recent optimization though, which is disabling RSA to save 30 kB (it can still be enabled if needed). See &lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/13729/files#diff-9460bd2e76b8fe433e47a738942f77d38f18d5967374101c756a015372b8cc22R862"&gt;this PR&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/thread/468991?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2024 10:57:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c45a219-39df-4cb5-a783-6a9c91dbc60b</guid><dc:creator>GilDev</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Any &amp;ldquo;good news&amp;rdquo; on this matter?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/thread/399556?ContentTypeID=1</link><pubDate>Thu, 08 Dec 2022 02:14:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f267103d-fbaf-487f-9a0a-7813aa349ae3</guid><dc:creator>Tim Chao</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Actually, I already did.&lt;/p&gt;
&lt;p&gt;Before I know how to use&amp;nbsp;&lt;span&gt;CONFIG_PSA_DEFAULT_OFF, I did compare the .config with minial build, and disable the features one-by-one. But the TF-M image size still &amp;gt; 200kB.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;For now, I think I will use mbedtls crypt functions instead of PSA API in my project. And wait for good news from Nordic TF-M team.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/thread/399369?ContentTypeID=1</link><pubDate>Wed, 07 Dec 2022 10:16:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3449758-ab1d-459d-af9e-c50ae7350886</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The team working with our TF-M implementation have optimization on their agenda but it is an ongoing process. However, for now there is no straight-forward way to do this and the suggestion at this time is to&amp;nbsp;do a graphical diff of the build before and after minimal config was changed and first look for changes in build/zephyr/.config. Maybe some of the TF-M features aren&amp;#39;t needed by the application. After that I would inspect the CMakeCache.txt of the TF-M build, and after that the .map file of TF-M.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/thread/399231?ContentTypeID=1</link><pubDate>Tue, 06 Dec 2022 14:45:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52941b9f-ea4a-43ad-a35d-abb108f11967</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I was too quick yesterday, the approach I suggested there is flawed and will not reduce the size of TF-M. I am checking with the TF-M team to see if I can find a way and will get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/thread/399076?ContentTypeID=1</link><pubDate>Tue, 06 Dec 2022 02:51:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22aeb83b-b8a0-40d0-993a-d80f500374b4</guid><dc:creator>Tim Chao</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;When I enable&amp;nbsp;&lt;span&gt;CONFIG_PSA_DEFAULT_OFF with&amp;nbsp;CONFIG_TFM_PROFILE_TYPE_NOT_SET=y, the TF-M image become even larger. I need to set&amp;nbsp;&lt;/span&gt;&lt;span&gt;CONFIG_PM_PARTITION_SIZE_TFM to 320kB to make build successed.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you double check if there is anything wrong?&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;(I&amp;#39;m using ncs 2.1.2)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/thread/399075?ContentTypeID=1</link><pubDate>Tue, 06 Dec 2022 02:29:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e928496-f57f-419a-bf39-ba728ea3927e</guid><dc:creator>Tim Chao</dc:creator><description>&lt;p&gt;Hi Einar,&lt;/p&gt;
&lt;p&gt;Thanks for reply.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I just test to build the example with NCS 2.1.2, but get FLASH overflow error, too.&lt;/p&gt;
&lt;p&gt;And when I look into the project, it set CONFIG_TFM_PROFILE_TYPE_NOT_SET=y in&amp;nbsp;nrf9160dk_nrf9160_ns.conf just like aes_ctr examlpe do. This config will disable the CONFIG_TFM_PROFILE_TYPE_MINIMAL and them the partition manager will arrange 256KB partition for TFM image.&lt;/p&gt;
&lt;p&gt;flash_primary (0x100000 - 1024kB): &lt;br /&gt;+---------------------------------------------+&lt;br /&gt;+---0x0: tfm_secure (0x40000 - 256kB)---------+&lt;br /&gt;| 0x0: tfm (0x40000 - 256kB) |&lt;br /&gt;+---0x40000: tfm_nonsecure (0xb8000 - 736kB)--+&lt;br /&gt;| 0x40000: app (0xb8000 - 736kB) |&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I had try to disable&amp;nbsp;&lt;span&gt;CONFIG_TFM_PROFILE_TYPE_NOT_SET to keep minimal setting of TFM. But seems most feattures cannot be enable with&amp;nbsp;CONFIG_TFM_PROFILE_TYPE_MINIMAL on. I will keep looking into it.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Downsizing the TFM with PSA support</title><link>https://devzone.nordicsemi.com/thread/399006?ContentTypeID=1</link><pubDate>Mon, 05 Dec 2022 14:22:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae912f25-cefc-440a-b425-fcd7bd544579</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is possible to enable only certain features in TF-M and get the size down. It is not entirely straight-forward though, but my&amp;nbsp;colleague &lt;a href="https://devzone.nordicsemi.com/members/sigurd-hellesvik"&gt;Sigurd Hellesvik&lt;/a&gt;&amp;nbsp; have looked into this in the past. That has not been public, so I am&amp;nbsp;sharing his suggestions here:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Firstly, Trusted Firmware-M builds as a Minimal Build by default, but you could double check that &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.2/kconfig/index.html#CONFIG_TFM_PROFILE_TYPE_MINIMAL"&gt;CONFIG_TFM_PROFILE_TYPE_MINIMAL&lt;/a&gt; is set in your project. Inn addition, i&lt;/span&gt;&lt;span style="font-family:inherit;"&gt;t is possible to set CONFIG_PSA_DEFAULT_OFF and enable algorithms specifically by using &lt;/span&gt;&lt;a style="font-family:inherit;" href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_security/doc/driver_config.html#nrf-security-driver-config"&gt;CONFIG_PSA_WANT_ALG_XXXX&lt;/a&gt;&lt;span style="font-family:inherit;"&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To show how the CONFIG_PSA_DEFAULT_OFF can be used, Sigurd created a custom version of our Crypto: Chacha20-Poly1305 example (&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2185.chachapoly_5F00_custom_5F00_psa_5F00_includes.zip"&gt;devzone.nordicsemi.com/.../2185.chachapoly_5F00_custom_5F00_psa_5F00_includes.zip&lt;/a&gt;). This shows how to include only the PSA drivers you need.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>