<?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>randomly happened flash corruption after power cycling only with bootloader flashed (S132 SoftDevice v2.0.0 SDK11.0.0)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66706/randomly-happened-flash-corruption-after-power-cycling-only-with-bootloader-flashed-s132-softdevice-v2-0-0-sdk11-0-0</link><description>Hi, I see an interesting situation. 
 I got flash corruption with values 0xff after random power cycling and it&amp;#39;s happened only if I have flashed the bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Oct 2020 06:57:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66706/randomly-happened-flash-corruption-after-power-cycling-only-with-bootloader-flashed-s132-softdevice-v2-0-0-sdk11-0-0" /><item><title>RE: randomly happened flash corruption after power cycling only with bootloader flashed (S132 SoftDevice v2.0.0 SDK11.0.0)</title><link>https://devzone.nordicsemi.com/thread/273929?ContentTypeID=1</link><pubDate>Fri, 09 Oct 2020 06:57:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8c453e0-0aa5-4524-866a-af6e8c4e7509</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="ivnn"]unexpectedly erased pages are placed in between &lt;em&gt;Bootloader&lt;/em&gt; and &lt;em&gt;Application&lt;/em&gt; (marked with red &lt;em&gt;User Data&lt;/em&gt;)[/quote]
&lt;p&gt;I see in this case it is a page in the middle of the user data section. Is the&amp;nbsp;data before and after the erased pages intact, or is that corrupted somehow (either just written to, or erased and written to)?&lt;/p&gt;
[quote user="ivnn"] seems it&amp;#39;s enough to present &lt;em&gt;Bootloader&lt;/em&gt; but it&amp;#39;s happened only after power cycle and not so often[/quote]
&lt;p&gt;I see. The bootloader should never write to the flash unless there is a DFU update, or unless the bootloader settings page is corrupt (but that is only for resent SDK versions, and in that case it should only write to the bootloader settings page, which is not the case here).&lt;/p&gt;
&lt;p&gt;Seeing the defines from your last post is relevant, but I must admit I am stuck and do not see any sensible explanation for this, so I would very much like to see your complete bootloader code (full project). Is that possible? Also, which SDK version do you use?&lt;/p&gt;
&lt;p&gt;Can we be confident that this is caused by the bootloader, or could it be that your application only misbehaves in the tests when you have a bootloader? What if you make a test application where you remove&amp;nbsp;&lt;em&gt;all &lt;/em&gt;code that writes to or erases flash. Are you able to reproduce the issue then? Can you share your application code as well?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: randomly happened flash corruption after power cycling only with bootloader flashed (S132 SoftDevice v2.0.0 SDK11.0.0)</title><link>https://devzone.nordicsemi.com/thread/273811?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 14:30:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ab93027-b95f-40c7-821b-bd2e09d33b87</guid><dc:creator>ivnn</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;sorry for the long time reply, it&amp;#39;s so difficult to reproduce. Btw I&amp;#39;ll send you a corrupted memory dump when it&amp;#39;s finally happened &lt;/p&gt;
&lt;p&gt;1. unexpectedly erased pages are placed in between &lt;em&gt;Bootloader&lt;/em&gt; and &lt;em&gt;Application&lt;/em&gt; (marked with red &lt;em&gt;User Data&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;2. seems it&amp;#39;s enough to present &lt;em&gt;Bootloader&lt;/em&gt; but it&amp;#39;s happened only after power cycle and not so often&lt;/p&gt;
&lt;p&gt;3.&amp;nbsp; not to much here is &lt;em&gt;Bootloader&lt;/em&gt; addresses&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define BOOTLOADER_REGION_START 0x0007A000&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define BOOTLOADER_SETTINGS_ADDRESS 0x0007F000&amp;nbsp;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define BOOTLOADER_MBR_PARAMS_PAGE_ADDRESS 0x0007E000&amp;nbsp;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define CODE_PAGE_SIZE 0x1000&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define DFU_REGION_TOTAL_SIZE (BOOTLOADER_REGION_START - CODE_REGION_1_START)&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define DFU_APP_DATA_RESERVED CODE_PAGE_SIZE * 8&amp;nbsp;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define DFU_IMAGE_MAX_SIZE_FULL (DFU_REGION_TOTAL_SIZE - DFU_APP_DATA_RESERVED)&amp;nbsp;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define DFU_IMAGE_MAX_SIZE_BANKED (((DFU_IMAGE_MAX_SIZE_FULL) -&amp;nbsp;(DFU_IMAGE_MAX_SIZE_FULL % (2 * CODE_PAGE_SIZE)))/2) &lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define DFU_BL_IMAGE_MAX_SIZE (BOOTLOADER_SETTINGS_ADDRESS - BOOTLOADER_REGION_START)&amp;nbsp;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define DFU_BANK_0_REGION_START CODE_REGION_1_START /**&amp;lt; Bank 0 region start. */&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:75%;"&gt;&lt;em&gt;#define DFU_BANK_1_REGION_START (DFU_BANK_0_REGION_START + DFU_IMAGE_MAX_SIZE_BANKED) &lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1602161423236v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: randomly happened flash corruption after power cycling only with bootloader flashed (S132 SoftDevice v2.0.0 SDK11.0.0)</title><link>https://devzone.nordicsemi.com/thread/272969?ContentTypeID=1</link><pubDate>Mon, 05 Oct 2020 12:16:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87b0d972-ac23-40af-954f-8afbbf6cc1f5</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This looks like a continuation of the last posts on &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/45189/flash-corruption-caused-by-power-down-during-writing"&gt;this case&lt;/a&gt;. As that was idle for a long time&amp;nbsp;so I suggest we continue here.&lt;/p&gt;
&lt;p&gt;There is no a lot of information about this issue. However, writing to flash can only change &amp;#39;1&amp;#39; to &amp;#39;0&amp;#39;. So if you see unexpected 0xff (&amp;#39;1&amp;#39;s), that means that the flash page &lt;em&gt;must&lt;/em&gt; have been erased. If this only happens when a bootloader is in place, I suspect the bootloader is responsible for this.&lt;/p&gt;
&lt;p&gt;Some questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Which page(s) are unexpectedly erased?&lt;/li&gt;
&lt;li&gt;Do you see this only during/after a DFU update, or is it enough that a bootloader is present?&lt;/li&gt;
&lt;li&gt;Have you modified the SDK bootloader much? If so, what changes have you made?&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>