<?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>program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/125162/program-crashes-on-nvs-sample</link><description>using the nvs sample from here: https://github.com/nrfconnect/sdk-zephyr/tree/v3.4.99-ncs1-1/samples/subsys/nvs and configured for my board, the program crashes on the 323rd reboot (see terminal output below). 
 When I try to reflash at the point, the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Dec 2025 21:20:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/125162/program-crashes-on-nvs-sample" /><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/556186?ContentTypeID=1</link><pubDate>Wed, 03 Dec 2025 21:20:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5de52029-0afb-47f8-b3ff-db624a1aeacc</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;I&amp;#39;m now able to write to UICR programmatically, so all the PowerShell problems go away.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/556166?ContentTypeID=1</link><pubDate>Wed, 03 Dec 2025 16:29:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08dd8d9c-2337-4260-a6ba-c90a10973f59</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;Vidar,&lt;/p&gt;
&lt;p&gt;Thank you for the link, but I still don&amp;#39;t know what code ranges you want me to print out (other than UICR).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve discovered more strange behavior. As I mentioned earlier, erasing UICR wipes out my program. Also, if I read from UICR with: nrfjprog --memrd 0x10001080, my program stops running. It comes back after pressing the reset button.&lt;/p&gt;
&lt;p&gt;Any ideas as to what might be going on?&lt;/p&gt;
&lt;p&gt;Keith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/556031?ContentTypeID=1</link><pubDate>Tue, 02 Dec 2025 15:26:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:795be5ed-e14c-4857-aab1-338b66fc7705</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Here&amp;#39;s a direct link to the UICR chapter of the product specification:&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ps_nrf52833/page/uicr.html"&gt;https://docs.nordicsemi.com/bundle/ps_nrf52833/page/uicr.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/556026?ContentTypeID=1</link><pubDate>Tue, 02 Dec 2025 14:51:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9f6d33a-51ae-4cae-b006-0a8834bd1a19</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;I don&amp;#39;t see it. Please be more specific.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/555961?ContentTypeID=1</link><pubDate>Tue, 02 Dec 2025 09:40:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:261719af-cdfe-474b-b716-429ff9677cce</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Please refer to the documentation&amp;nbsp;available at&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/"&gt;https://docs.nordicsemi.com/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/555915?ContentTypeID=1</link><pubDate>Mon, 01 Dec 2025 17:16:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4e18a82-c1ab-472c-9b6b-fc34d5314336</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;I can&amp;#39;t find a datasheet for the nrf52833 SOC. please tell me what range I should check.&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/555904?ContentTypeID=1</link><pubDate>Mon, 01 Dec 2025 16:10:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:061675e3-83b4-41c9-a5c4-fcc540b5e972</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;You can read out the UICR and code memory ranges using nrfjprog --memread &amp;lt;start address &amp;gt; --n &amp;lt;bytes to read&amp;gt; before and after the &amp;quot;erase UICR&amp;quot; to find out what is being erased.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/555891?ContentTypeID=1</link><pubDate>Mon, 01 Dec 2025 14:45:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51ae2b77-60d1-4a99-bea1-fcc66ae308d8</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;I&amp;#39;m not purposely putting anything in UICR. But after I enter that command (nrfjprog --eraseuicr) my program no longer runs. I tried the reset button and the power switch. The only thing that brings the program up is re-flashing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/555250?ContentTypeID=1</link><pubDate>Mon, 24 Nov 2025 14:44:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78fa4390-0b2a-4f2d-a7e1-0ddfeb6e2fe3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I see. I don&amp;#39;t see why the&amp;nbsp;&lt;span&gt;eraseuicr operation should require you to re-program the FW again afterwards. Do you have anything else stored in UICR apart from this serial number?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/555073?ContentTypeID=1</link><pubDate>Fri, 21 Nov 2025 14:53:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3f80bfc-43ba-4b1b-8e89-8f0b2d4b6070</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;The UICR should be fine for our purposes because the serial number will be entered before deployment. I&amp;#39;m just concerned that someone could make a mistake typing it in.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/555016?ContentTypeID=1</link><pubDate>Fri, 21 Nov 2025 09:36:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d486c17-8354-4d2b-b6a7-f87248ebeeb9</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;UICR is good for&amp;nbsp;keeping one time configurations such as serial numbers and mac addresses, but for anything that needs to be updated during the lifetime of the product it&amp;nbsp;is usually best to store it in&amp;nbsp;internal flash using NVS or similar. This is assuming the values are to be updated&amp;nbsp;&lt;span&gt;programmatically. Will the end user have access to re-program the chip through the debug interface using nrfjprog or similar?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/554959?ContentTypeID=1</link><pubDate>Thu, 20 Nov 2025 18:49:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bf2373a-35bf-4e60-ae06-6af3de73e2e3</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;Vidar,&lt;/p&gt;
&lt;p&gt;I&amp;#39;d like to allow the customer to rewrite their (serial) number if they make a mistake. But that requires &amp;#39;nrfjprog &amp;ndash;eraseuicr&amp;#39; before another &amp;#39;nrfjprog --memwr&amp;#39; is allowed. However, &lt;span&gt;&amp;#39;&lt;/span&gt;&lt;span&gt;nrfjprog &amp;ndash;eraseuicr&amp;#39; appears to&amp;nbsp;&lt;/span&gt;erase program memory, because I need to re-flash after that operation. Is there another way to allow re-writes to that register?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/554957?ContentTypeID=1</link><pubDate>Thu, 20 Nov 2025 18:16:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4b68934-714a-4964-bc48-90c18c944888</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;That works, thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/554950?ContentTypeID=1</link><pubDate>Thu, 20 Nov 2025 16:55:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7acef458-55c8-4c43-91b5-7a7814ada1d5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;If you include the &amp;lt;soc.h&amp;gt; you will be able to access the register definitions directly.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;soc.h&amp;gt;

void foo(void)
{
    uint32_t var = NRF_UICR-&amp;gt;CUSTOMER[0];
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/554926?ContentTypeID=1</link><pubDate>Thu, 20 Nov 2025 14:39:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cc1b0bb-b6e6-4b69-8cfd-c3c839298a45</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;Vidar,&lt;/p&gt;
&lt;p&gt;My question is related to your ticket &amp;quot;NVS not compatible with MCUBOOT&amp;quot;. There you recommend using the CUSTOMER register in UICR. I&amp;#39;m able to write and read to a register with nrfjprog, but I don&amp;#39;t know how to read from it programmatically (in C).&amp;nbsp;&lt;span&gt;Is there an example of that, where it&amp;#39;s clear how to specify the register address?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thank you,&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/552313?ContentTypeID=1</link><pubDate>Fri, 24 Oct 2025 05:37:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a4c9426-cd0f-4c2f-87b1-493e7295bfef</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The peak stack usage should be&amp;nbsp;when NVS performs garbage collection after every 322 reboots. After that, it should return to normal until the next garbage collection 322 reboots later. Therefore, whether the test runs for 400 or 4000 reboots shouldn’t make any difference in terms of max. stack usage.&amp;nbsp; But for the final application it will be important to profile the stack usage for each thread (+main stack) and not just for NVS in main(). You can use the t&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/debugging/thread-analyzer.html"&gt;hread analyzer&amp;nbsp;&lt;/a&gt;as mentioned earlier to help with this.The stacks are also initialized to 0xAA with the config below enabled.&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/pastedimage1761283953674v4.png" alt=" " /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/552291?ContentTypeID=1</link><pubDate>Thu, 23 Oct 2025 16:17:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dd6dd49-1b21-4c7c-a342-ea78e63e5c95</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;Vidar,&lt;/p&gt;
&lt;p&gt;One more question. Your suggested change solved the problem for this test (400 reboots). But will this problem resurface in production, with potentially many more reboots?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/552286?ContentTypeID=1</link><pubDate>Thu, 23 Oct 2025 15:08:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:959373f6-e807-4258-847d-d1f0c9223596</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;That worked, thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: program crashes on nvs sample</title><link>https://devzone.nordicsemi.com/thread/552273?ContentTypeID=1</link><pubDate>Thu, 23 Oct 2025 14:08:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93e178bd-8ea2-4d90-99ea-ddf3f36a120c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It seems that the main stack is too small for the NVS garbage collection process, which runs after the sectors are full (I assume this is what happens after the 322nd reboot). Please try doubling the stack size in your project to see if it fixes it (&lt;span&gt;CONFIG_MAIN_STACK_SIZE&lt;/span&gt;&lt;span&gt;=2048).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You may also enable the t&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/debugging/thread-analyzer.html"&gt;hread analyzer&amp;nbsp;&lt;/a&gt;&amp;nbsp;to monitor the stack usage&amp;nbsp;though this would have been more useful if the app did not contentiously reboot.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Vidar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>