<?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>Reading UICR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/118064/reading-uicr</link><description>Hello, 
 is it possible to read UICR at address FF8000 from a non secure application for nrf(160. 
 If yes, can you provide sample code and CONFIG to enable in prj.conf. 
 Best Regards</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Jan 2025 14:06:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/118064/reading-uicr" /><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/519329?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 14:06:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5873208e-5908-4e00-8e23-a75ecad8ec7a</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;The error code is NRF_ERROR_INVALID_PARAMS.&lt;/p&gt;
&lt;p&gt;I thought it was address but I cheched and it is &amp;amp;UICR-&amp;gt;OTP[0], The same define in ranges. In 2.9.0 I have only one ranges file, while in 2.7.0 there are many.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now I went back to 2.7.0 because of many problems on intellisense. But I did not check if in 2.7.0 it works. I have to modify all ranges file because i do not know which is used.&lt;/p&gt;
&lt;p&gt;Anyway i do not like The idea to modifica sdk, and was looking to a way to override those ranges. But it is quite difficult to find information about.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/519309?ContentTypeID=1</link><pubDate>Tue, 21 Jan 2025 13:24:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b48c2438-24cb-4310-bb32-1b897c371c37</guid><dc:creator>Sigurd</dc:creator><description>[quote user="Marbro1965"] I rebuild all but it does not read the OTP[0].[/quote]
&lt;p&gt;Did you get any error codes? What did it read?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/518911?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2025 19:19:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d21c249-6df8-4f77-81ad-5f5222f72e4b</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;I applied to nrf9160. Modified the ranges in C:\ncs\v2.9.0\zephyr\modules\trusted-firmware-m\nordic\include\tfm_read_ranges.h. In my case &amp;amp;UICR-&amp;gt;OTP[0] is 0xFF8100. I rebuild all but it does not read the OTP[0].&lt;/p&gt;
&lt;p&gt;How do I know that it is compiling the new ranges?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/518776?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2025 07:18:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1d6d8bf-ea90-4d76-ada8-890bde4b5a3d</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;As I promised, this is a quote from Ask AI.&lt;/p&gt;
&lt;div class="mantine-Group-root mantine-1qj7haw"&gt;You mentioned that since 2.8.0 it is easier to read UICR register in nrf9160&lt;/div&gt;
&lt;div&gt;
&lt;div class="mantine-Text-root mantine-15qlng1"&gt;Yes, that&amp;#39;s correct. According to the nRF Connect SDK v2.8.0 Release Notes, there has been an improvement in reading UICR registers for Trusted Firmware-M (TF-M). Specifically:&lt;/div&gt;
&lt;ul class="mantine-List-root mantine-jevmf3"&gt;
&lt;li class="mantine-List-item mantine-1trgrnu"&gt;
&lt;div class="___ref-itemWrapper mantine-iwg4hh mantine-List-itemWrapper"&gt;&lt;span&gt;A possibility to read UICR.OTP registers through platform services has been added.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class="mantine-List-item mantine-1trgrnu"&gt;
&lt;div class="___ref-itemWrapper mantine-iwg4hh mantine-List-itemWrapper"&gt;&lt;span&gt;The TF-M version has been updated to v2.1.0.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="mantine-Text-root mantine-15qlng1"&gt;This change makes it easier to access UICR (User Information Configuration Registers) OTP (One-Time Programmable) registers in the nRF9160.&lt;/div&gt;
&lt;div class="mantine-Text-root mantine-15qlng1"&gt;&lt;a class="mantine-Text-root mantine-Anchor-root mantine-157keyv" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/releases_and_maturity/releases/release-notes-2.8.0.html#trusted_firmware-m" rel="noopener noreferrer" target="_blank"&gt;nRF Connect SDK v2.8.0 Release Notes&lt;/a&gt;&lt;/div&gt;
&lt;div class="mantine-Text-root mantine-15qlng1"&gt;This improvement should simplify the process of reading these registers during runtime for applications using the nRF9160.&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/518757?ContentTypeID=1</link><pubDate>Fri, 17 Jan 2025 05:42:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22af29a4-daa3-4ca5-8541-1bc29e71453c</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;Hello Sigurd.&lt;/p&gt;
&lt;p&gt;I was using 2.7.0 and moved to 2.9.0 because in the site somewhere (I will look for this quote later and attach) it was written it was easier to read ucir without modifying tfm_read_ranges.h&lt;/p&gt;
&lt;p&gt;My client wants to save some data unique for every board in production.&lt;/p&gt;
&lt;p&gt;They must be read only.&lt;/p&gt;
&lt;p&gt;They must be programmed using nrfjprog as I mentioned before&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/518730?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2025 21:00:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0ad54ed-bb1e-4d5c-beef-fdda4ecb93d3</guid><dc:creator>Sigurd</dc:creator><description>[quote user="Marbro1965"]&lt;p&gt;is that enough to write&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_TFM_PARTITION_PLATFORM&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;in prj.conf and call&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;uint32_t&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span&gt;secure_read_word&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;intptr_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;ptr&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;[/quote]
&lt;p&gt;As mentioned in the post I linked to, you would also need to modify the&amp;nbsp;&lt;span&gt;tfm_read_ranges.h&lt;/span&gt;&lt;/p&gt;
[quote user="Marbro1965"]Can you please tell me how call for address 0x00FF8000?[/quote]
&lt;p&gt;&lt;span&gt;This is the APPROTECT register.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you explain what you are trying to achieve ?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/518655?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2025 13:57:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8e625af-60dc-459f-b4a8-a56cbbc16578</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;is that enough to write&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_TFM_PARTITION_PLATFORM&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;in prj.conf and call&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;uint32_t&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span&gt;secure_read_word&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;intptr_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;ptr&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;uint32_t&lt;/span&gt;&lt;span&gt; err &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;uint32_t&lt;/span&gt;&lt;span&gt; val;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;enum&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tfm_platform_err_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;plt_err&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; plt_err &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;tfm_platform_mem_read&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;val, ptr, &lt;/span&gt;&lt;span&gt;4&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;err);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;if&lt;/span&gt;&lt;span&gt; (plt_err &lt;/span&gt;&lt;span&gt;!=&lt;/span&gt;&lt;span&gt; TFM_PLATFORM_ERR_SUCCESS &lt;/span&gt;&lt;span&gt;||&lt;/span&gt;&lt;span&gt; err &lt;/span&gt;&lt;span&gt;!=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;printk&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;quot;tfm_..._mem_read failed: plt_err: 0x&lt;/span&gt;&lt;span&gt;%x&lt;/span&gt;&lt;span&gt;, err: 0x&lt;/span&gt;&lt;span&gt;%x&lt;/span&gt;&lt;span&gt;\n&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; plt_err, err);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;return&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;-&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;return&lt;/span&gt;&lt;span&gt; val;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Can you please tell me how call for address 0x00FF8000?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;And&amp;nbsp;for programming, can I make a hex file (MyHex.hex) with this content:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;:0200000400FFFB&lt;br /&gt;:1080000031323334353637380000000000000000CC&lt;br /&gt;:00000001FF&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;and use&amp;nbsp;&lt;br /&gt;&lt;br /&gt;nrfjprog --program MyHex.hex --chiperase --reset&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Best Regards&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/518647?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2025 13:37:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d61f1337-6132-4d6f-9cc2-e4794e1b1e4e</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;looks a little bit complicated. Does it change my not secure application in a secure application?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/518637?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2025 13:00:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:439975f9-0ce8-4e67-8905-b369a6b7cff6</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;See this post, it&amp;#39;s for nRF54, but the same&amp;nbsp;methods apply to nRF91 as well.&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/113714/static-partition-alignment/497777"&gt;RE: Static Partition Alignment&lt;/a&gt;&amp;nbsp;&lt;br /&gt;see also&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/main/samples/tfm/tfm_hello_world/src/main.c"&gt;https://github.com/nrfconnect/sdk-nrf/blob/main/samples/tfm/tfm_hello_world/src/main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/518519?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2025 19:55:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88172230-170d-4e1e-9d61-ee4000af59a7</guid><dc:creator>Marbro1965</dc:creator><description>&lt;p&gt;Unfortunately does not work in this way.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading UICR</title><link>https://devzone.nordicsemi.com/thread/518514?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2025 19:32:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1948cc4-47ad-4548-af98-13c1f314e458</guid><dc:creator>qarnet</dc:creator><description>&lt;p&gt;You can just read the register directly. For example, reading out the first entry in the one time programmable memory (&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf9160/page/uicr.html#register.OTP"&gt;Source of registers&lt;/a&gt;):&lt;br /&gt;uint32_t reg_val = *(volatile uint32_t *) 0x00FF8108;&lt;br /&gt;&lt;br /&gt;That is at least what I used to be able to do with something like the nRF52840. I don&amp;#39;t know if the nRF9160 has extra security measures.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>