<?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>MCUBoot erases flash area defined as &amp;quot;custom&amp;quot;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112147/mcuboot-erases-flash-area-defined-as-custom</link><description>Hello all, 
 I&amp;#39;m hoping you can help me with this problem, hopefully it&amp;#39;s just a matter of wrong configuration. 
 I&amp;#39;m using an NRF52840 (uBlox) and so far everything has worked pretty well. To store some non volatile (NV) variables like the BLE name and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Jun 2024 14:33:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112147/mcuboot-erases-flash-area-defined-as-custom" /><item><title>RE: MCUBoot erases flash area defined as "custom"</title><link>https://devzone.nordicsemi.com/thread/489137?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 14:33:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e34fd383-6e36-4dcf-8e81-23867dd7c0ec</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>[quote user="Albert_0"]- Both mcuboot areas need to have the same size apparently, otherwise the &amp;quot;new&amp;quot; firmware gets stuck in the &amp;quot;pending&amp;quot; state and it&amp;#39;s impossible to get it out of there.[/quote]
&lt;p&gt;Yep, this is very important. Changing partition size can cause undefined behaviour.&lt;/p&gt;
[quote user="Albert_0"]- For the new memory layout to take effect and work, the whole flash needs to be erased, otherwise we get the same issues as before.[/quote]
&lt;p&gt;Yes, meaning that you cannot fix partitioning in DFU (with only one bootloader)&lt;/p&gt;
&lt;p&gt;And a third point:&lt;/p&gt;
&lt;p&gt;- There is a known issue (working to get it on the list), that you cannot use more than 95% of available application space, because MCUboot uses the last ~5% of mcuboo_secondary for stuff&lt;/p&gt;
&lt;p&gt;Bonus tip:&lt;/p&gt;
[quote user="Albert_0"]For reference, the new layout is:[/quote]
&lt;p&gt;You can use VS Code -&amp;gt; Memory Layout -&amp;gt; Parititons to view a nice version of the layout.&lt;br /&gt;Or if your prefer the CLI. &amp;quot;west build -t partition_manager_report&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot erases flash area defined as "custom"</title><link>https://devzone.nordicsemi.com/thread/489128?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 13:46:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a49f406a-3a3c-49eb-9910-6d757ee2a2dc</guid><dc:creator>Albert_0</dc:creator><description>&lt;p&gt;Hi Sigurd, thanks for the response.&lt;/p&gt;
&lt;p&gt;After writing the question and changing the memory areas&amp;nbsp;removing&amp;nbsp;the overlap now it all works without having to go into the advanced settings.&lt;/p&gt;
&lt;p&gt;Two things I noticed (also based on other posts, from other users)&lt;/p&gt;
&lt;p&gt;- Both mcuboot areas need to have the same size apparently, otherwise the &amp;quot;new&amp;quot; firmware gets stuck in the &amp;quot;pending&amp;quot; state and it&amp;#39;s impossible to get it out of there.&lt;/p&gt;
&lt;p&gt;- For the new memory layout to take effect and work, the whole flash needs to be erased, otherwise we get the same issues as before.&lt;/p&gt;
&lt;p&gt;For reference, the new layout is:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;mcuboot: 0x0 -&amp;gt; 0xC000
mcuboot_pad: 0xC000 -&amp;gt; 0xC200
app: 0xC200 -&amp;gt; 0x84000
mcuboot_primary: 0xC000 -&amp;gt; 0x84000
empty_0: 0x84000 -&amp;gt; 0x85000
custom: 0x85000 -&amp;gt; 0x86000
mcuboot_primary_app: 0xC200 -&amp;gt; 0x84000
mcu_boot_secondary: 0x86000 -&amp;gt; 0xFE000
empty_1: 0xFE000 -&amp;gt; 0x100000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Alberto&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCUBoot erases flash area defined as "custom"</title><link>https://devzone.nordicsemi.com/thread/489070?ContentTypeID=1</link><pubDate>Mon, 17 Jun 2024 11:15:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4539517-f38e-47c3-9a09-b9c6628b2874</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is a &amp;quot;feature&amp;quot; in the nRF Device Manager app.&lt;br /&gt;Go to &amp;quot;advanced&amp;quot; settings and unselect the &amp;quot;delete storage&amp;quot; when doing OTA.&lt;/p&gt;
&lt;p&gt;Does that fix the issue?&lt;/p&gt;
&lt;p&gt;That being said, if any of the mcuboot partitions overlay your empty partition, they may at any time overwrite it, so I recommend not having overlap&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>