<?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>Compile error trying to use nrfx NVMC library with nRF54L15</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/124712/compile-error-trying-to-use-nrfx-nvmc-library-with-nrf54l15</link><description>Hello! 
 I would like to use OTP storage on the nRF54L15, as explained here: https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/security/key_storage.html 
 That page says to use the nrfx NVMC library: https://docs.nordicsemi.com/bundle/ncs-latest</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Oct 2025 08:29:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/124712/compile-error-trying-to-use-nrfx-nvmc-library-with-nrf54l15" /><item><title>RE: Compile error trying to use nrfx NVMC library with nRF54L15</title><link>https://devzone.nordicsemi.com/thread/550436?ContentTypeID=1</link><pubDate>Thu, 02 Oct 2025 08:29:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1264e9a-4825-4d39-88ec-29d7f0b5adfe</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Happy to help! The&amp;nbsp;HW (RRAM controller)&amp;nbsp;requires you to explicitly set the write enable bit before performing any writes and it is recommended to clear it immediately after. This&amp;nbsp;to&amp;nbsp;mitigate the risk of memory corruption. A stack overflow, for example, could easily lead to corruption of RRAM if the write enable bit were kept enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile error trying to use nrfx NVMC library with nRF54L15</title><link>https://devzone.nordicsemi.com/thread/550432?ContentTypeID=1</link><pubDate>Thu, 02 Oct 2025 08:22:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6a12aec-2475-4c8a-b1bb-11424c5e8ed6</guid><dc:creator>Tom Weber</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;I assumed that &amp;quot;write&amp;quot; functions in the API would not be usable unless write was enabled, but I see now that they enable the write flag temporarily.&lt;/p&gt;
&lt;p&gt;What does the write flag protect against then - the application trying to write directly to an RRAM address without the API?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile error trying to use nrfx NVMC library with nRF54L15</title><link>https://devzone.nordicsemi.com/thread/550430?ContentTypeID=1</link><pubDate>Thu, 02 Oct 2025 08:11:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b4f4a4c-e00f-4cd5-891b-9f72603c712f</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="Tom Weber"]OTP can be written even if writing is disabled.[/quote]
&lt;p&gt;The write enable bit is being set inside the nrfx_rramc_otp_word_write() before the actual write, then it&amp;#39;s cleared again. See implementation here&amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/hal_nordic/blob/979a58d0829108b57f10e90b6c3fc35ab6206e4b/nrfx/haly/nrfy_rramc.h#L406"&gt;https://github.com/zephyrproject-rtos/hal_nordic/blob/979a58d0829108b57f10e90b6c3fc35ab6206e4b/nrfx/haly/nrfy_rramc.h#L406&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tom Weber"]The nrfx_rramc_otp_word_write() function&amp;nbsp;does not behave according to documentation.[/quote]
&lt;p&gt;The behavior described in the API documentation does not correspond with the datasheet which states that you can only write once after an Erase All. I will forward this to the developers. Thank you for reporting this.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1759392452835v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Ref.&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/uicr.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf54L15/page/uicr.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile error trying to use nrfx NVMC library with nRF54L15</title><link>https://devzone.nordicsemi.com/thread/550384?ContentTypeID=1</link><pubDate>Wed, 01 Oct 2025 14:53:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8128ba5-1b18-4f39-b48d-52b79cffa0c2</guid><dc:creator>Tom Weber</dc:creator><description>&lt;p&gt;I have two possible bugs to report in the RRAMC driver:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;OTP can be written even if writing is disabled.&lt;/li&gt;
&lt;li&gt;The nrfx_rramc_otp_word_write() function&amp;nbsp;does not behave according to documentation.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;My code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static int test_otp(void)
{
    nrfx_rramc_config_t config = NRFX_RRAMC_DEFAULT_CONFIG(0);
    nrfx_err_t err;

    err = nrfx_rramc_init(&amp;amp;config, NULL);
    if (err != NRFX_SUCCESS &amp;amp;&amp;amp; err != NRFX_ERROR_ALREADY)
    {
        LOG_ERR(&amp;quot;Failed to initialize RRAMC: 0x%x&amp;quot;, err);
        return -ENODEV;
    }
    LOG_INF(&amp;quot;RRAMC write enabled: %d&amp;quot;, (int) nrfx_rramc_write_enable_check());
    LOG_INF(&amp;quot;OTP[0]: 0x%08x&amp;quot;, nrfx_rramc_otp_word_read(0));
    LOG_INF(&amp;quot;Write to OTP[0]: %d&amp;quot;, (int) nrfx_rramc_otp_word_write(0, 0x5a5a5a5a));
    LOG_INF(&amp;quot;OTP[0]: 0x%08x&amp;quot;, nrfx_rramc_otp_word_read(0));
    LOG_INF(&amp;quot;Write to OTP[0]: %d&amp;quot;, (int) nrfx_rramc_otp_word_write(0, 0x00000000));
    LOG_INF(&amp;quot;OTP[0]: 0x%08x&amp;quot;, nrfx_rramc_otp_word_read(0));
    return 0;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The output:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:52:20.486,731] &amp;lt;inf&amp;gt; uicr_test: RRAMC write enabled: 0
[00:52:20.486,741] &amp;lt;inf&amp;gt; uicr_test: OTP[0]: 0xffffffff
[00:52:20.486,800] &amp;lt;inf&amp;gt; uicr_test: Write to OTP[0]: 1
[00:52:20.486,805] &amp;lt;inf&amp;gt; uicr_test: OTP[0]: 0x5a5a5a5a
[00:52:20.486,809] &amp;lt;inf&amp;gt; uicr_test: Write to OTP[0]: 0
[00:52:20.486,813] &amp;lt;inf&amp;gt; uicr_test: OTP[0]: 0x5a5a5a5a
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Regarding bug 1, the write should not produce a change in the OTP register since according to the API, write is disabled, but the value is changed after the attempted write.&lt;/p&gt;
&lt;p&gt;Regarding bug 2, the way I interpret the documentation, given that write is possible (which it happens to be),&amp;nbsp;&lt;span&gt;nrfx_rramc_otp_word_write() should&amp;nbsp;perform the write unless a 0 to 1 transition is requested in any bit, so both calls should succeed, but the second call fails. There is no 0 to 1 transition in 0xffffffff to 0x5a5a5a5a, and none in 0x5a5a5a5a to 0x00000000. Apparently it instead fails unless the existing value is all 1s?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://docs.nordicsemi.com/bundle/nrfx-apis-latest/page/group_nrfx_rramc.html#ga037f9f7abb5b51e07a61005ab57dd14c"&gt;documentation &lt;/a&gt;&lt;span&gt;says:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;The OTP is only able to write &amp;#39;0&amp;#39; to bits in the UICR that are erased (set to &amp;#39;1&amp;#39;).
It cannot rewrite a bit back to &amp;#39;1&amp;#39;. This function checks if the value currently residing
at the specified index can be transformed to the desired value without any &amp;#39;0&amp;#39; to &amp;#39;1&amp;#39; 
transitions. If yes, then perform the write operation.

Return values
true	Word can be written into the specified OTP index address.
false	Word cannot be written into the specified OTP index address. 
        Erase UICR or change index address.&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile error trying to use nrfx NVMC library with nRF54L15</title><link>https://devzone.nordicsemi.com/thread/550349?ContentTypeID=1</link><pubDate>Wed, 01 Oct 2025 12:09:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b34c874-8077-471a-8ba6-5113652db150</guid><dc:creator>Tom Weber</dc:creator><description>&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;Set&amp;nbsp;CONFIG_NRFX_RRAMC=y and include nrfx_rram.h instead.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thank you, this compiles and the init function seems to work.&lt;/p&gt;
&lt;p&gt;I would like a way to clear the UICR.&lt;/p&gt;
&lt;p&gt;The NVMC API has&amp;nbsp;nrfx_nvmc_uicr_erase() which erases only the UICR.&lt;/p&gt;
&lt;p&gt;The RRAMC API has only&amp;nbsp;nrfx_rramc_all_erase() which says it erases the whole RRAM. Doesn&amp;#39;t it mean it will erase the program calling the function as well, including the driver code doing the erasing? Or have I misunderstood the documentation?&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;&lt;span&gt;For key storage I recommend&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Yes, I use the KMU for encryption keys but would like to use OTP for device identity.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile error trying to use nrfx NVMC library with nRF54L15</title><link>https://devzone.nordicsemi.com/thread/550298?ContentTypeID=1</link><pubDate>Wed, 01 Oct 2025 07:59:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98cde633-466e-4468-8aac-1287d7f411ba</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The nrf54L&amp;nbsp;is using RRAM instead of&amp;nbsp;FLASH technology for non-volatile storage and has a different controller. Unfortunately, I see this part of the documentation has not yet been updated to reflect this.&lt;/p&gt;
[quote user=""]It seems I need to set&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;CONFIG_NRFX_NVMC=y&lt;/span&gt;&lt;br /&gt;and use:&lt;br /&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;#include &amp;lt;nrfx_nvmc.h&amp;gt;&lt;/span&gt;[/quote]
&lt;p&gt;Set&amp;nbsp;CONFIG_NRFX_RRAMC=y and include nrfx_rram.h instead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For key storage I recommend&amp;nbsp;having a look at this section of the SDK documentation&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf54l/kmu_basics.html"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/app_dev/device_guides/nrf54l/kmu_basics.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>