<?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>TF-M NV Counters API</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91933/tf-m-nv-counters-api</link><description>Hi, 
 
 Is it correct that nrf-sdk does not support (or have any implementation for) the &amp;quot;NV Counters&amp;quot; API in TF-M ? (needed for rollback protection in the Protected Storage service). 
 
 Thanks, 
 Jeremy</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Sep 2022 23:12:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91933/tf-m-nv-counters-api" /><item><title>RE: TF-M NV Counters API</title><link>https://devzone.nordicsemi.com/thread/386472?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 23:12:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33a88b96-e650-4d6f-b9db-4bf6ee00613e</guid><dc:creator>jeremyherbert</dc:creator><description>&lt;p&gt;Hi Dejan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I ended up checking with the TF-M mailing list and indeed the external protected storage (PS - PSS was a typo sorry) is limited by the flash endurance of a single page in the internal flash regardless of the endurance of external storage, which is 10k writes for the nrf53/nrf91. So after 10k writes, one must assume that the NV counters fail to zero and then the various rollback protections in TF-M will then fail insecure.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jeremy&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TF-M NV Counters API</title><link>https://devzone.nordicsemi.com/thread/386386?ContentTypeID=1</link><pubDate>Thu, 15 Sep 2022 12:09:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca44a65f-5260-48e2-8cb3-932dc6bdfaec</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Jeremy,&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="jeremyherbert"]So based on this, is it correct that only 10k writes to the PSS are possible before the device internal flash is considered to be worn out (ie past the guaranteed number of writes)[/quote]
&lt;p&gt;Based on what? &lt;br /&gt;What do you refer to as PSS?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TF-M NV Counters API</title><link>https://devzone.nordicsemi.com/thread/386268?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 23:16:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:205c29d5-67de-42b4-811f-2c87aa0b4359</guid><dc:creator>jeremyherbert</dc:creator><description>&lt;p&gt;Thank you! So based on this, is it correct that only 10k writes to the PSS are possible before the device internal flash is considered to be worn out (ie past the guaranteed number of writes)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TF-M NV Counters API</title><link>https://devzone.nordicsemi.com/thread/386237?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 15:11:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f39d442-7f3f-4676-affa-b6340a4e1fbf</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Jeremy,&lt;br /&gt;&lt;br /&gt;We are using default TF-M implementation which should be usable for development/production.&amp;nbsp;&lt;br /&gt;In the code, relevant file is ncs/modules/tee/tf-m/trusted-firmware-m/platform/ext/common/template/nv_counters.c (&lt;a href="https://github.com/nrfconnect/sdk-trusted-firmware-m/blob/master/platform/ext/common/template/nv_counters.c"&gt;github link&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TF-M NV Counters API</title><link>https://devzone.nordicsemi.com/thread/386113?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 09:09:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3447ee0f-ecfd-4083-b231-3e6592407ac3</guid><dc:creator>jeremyherbert</dc:creator><description>&lt;p&gt;Hi Dejan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes, I found that documentation, but it says:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;The system integrators&amp;nbsp;&lt;/span&gt;&lt;strong&gt;may&lt;/strong&gt;&lt;span&gt;&amp;nbsp;implement this interface based on the target capabilities and set the&amp;nbsp;&lt;/span&gt;&lt;code class="docutils literal notranslate"&gt;&lt;span class="pre"&gt;PS_ROLLBACK_PROTECTION&lt;/span&gt;&lt;/code&gt;&lt;span&gt;&amp;nbsp;flag to compile in the rollback protection code.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am wondering if nordic has indeed implemented this interface or not for the nrf91/nrf53, because I can&amp;#39;t seem to find the code for it in the TF-M source. (I can find it for the Cypress PSOC64 for example)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: TF-M NV Counters API</title><link>https://devzone.nordicsemi.com/thread/386111?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 08:50:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb5672d6-7094-4676-b574-f349c0f4b862</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi Jeremy,&lt;br /&gt;&lt;br /&gt;Platform Service Integration Guide provides information about&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/tfm/integration_guide/services/tfm_platform_integration_guide.html#non-volatile-counters"&gt;non-volatile counters&lt;/a&gt;&amp;nbsp;(NVC). Additionally, you could have a look at&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/tfm/integration_guide/services/tfm_ps_integration_guide.html#tf-m-nv-counter-interface"&gt;TF-M NVC interface&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/tfm/integration_guide/services/tfm_ps_integration_guide.html#ps-service-build-definitions"&gt;PS Service Build definitions&lt;/a&gt;. Finally, you can read more about Trusted NVC and rollback protection in&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/tfm/technical_references/design_docs/secure_boot_rollback_protection.html"&gt;Rollback protection in TF-M secure boot&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>