<?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>Can&amp;#39;t flash debug bootloader from SDK 12.1.0. ERROR: The area to write is not erased.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17345/can-t-flash-debug-bootloader-from-sdk-12-1-0-error-the-area-to-write-is-not-erased</link><description>Hi. 
 I have a BLE peripheral app for the nRF51822. I&amp;#39;m using SDK 12.1.0 with SD 130 v2.0.1 and gcc. I&amp;#39;m implementing DFU OTA at the moment and I notice there are two builds of the example bootloader_secure app for each board, eg. one called pca10028</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 31 Oct 2016 15:30:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17345/can-t-flash-debug-bootloader-from-sdk-12-1-0-error-the-area-to-write-is-not-erased" /><item><title>RE: Can't flash debug bootloader from SDK 12.1.0. ERROR: The area to write is not erased.</title><link>https://devzone.nordicsemi.com/thread/66660?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2016 15:30:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:097a132b-6c02-41e5-a5b5-a89cb0a40632</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;In the end, this was nothing to do with the bootloader settings or the MBR params. I just had my application FLASH overlapping with my bootloader FLASH. I managed to put my app on a diet and get it down to 116 kB, leaving 31 kB for the debug bootloader.&lt;/p&gt;
&lt;p&gt;Using objdump on the hex files (not the elf files) to show the sections was helpful:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/Users/Eliot/dev/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-objdump -d -S -marm -h -t _build/biketracker_app_s130.hex

_build/biketracker_app_s130.hex:     file format ihex

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .sec1         00005000  0001b000  0001b000  00000011  2**0
                  CONTENTS, ALLOC, LOAD
  1 .sec2         00010000  00020000  00020000  0000e122  2**0
                  CONTENTS, ALLOC, LOAD
  2 .sec3         00007f50  00030000  00030000  0003b133  2**0
                  CONTENTS, ALLOC, LOAD
SYMBOL TABLE:
no symbols


/Users/Eliot/dev/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-objdump -d -S -marm -h -t bootloader/biketracker_debug/armgcc/_build/bootloader_s130.hex

bootloader/biketracker_debug/armgcc/_build/bootloader_s130.hex:     file format ihex

Sections:
Idx Name          Size      VMA               LMA               File off  Algn
  0 .sec1         00007a48  00038000  00038000  00000011  2**0
                  CONTENTS, ALLOC, LOAD
  1 .sec2         00000004  10001014  10001014  00015831  2**0
                  CONTENTS, ALLOC, LOAD
SYMBOL TABLE:
no symbols
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't flash debug bootloader from SDK 12.1.0. ERROR: The area to write is not erased.</title><link>https://devzone.nordicsemi.com/thread/66659?ContentTypeID=1</link><pubDate>Fri, 28 Oct 2016 22:48:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf3693d6-bf31-4f79-ae34-845ec176c4ca</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Are you sure? This looks like it only applies to an NRF52 build. Mine is NRF51. The NRF51 has no MBR params page and the bit of nrf_dfu_settings.c that post mentions is correctly wrapped in &lt;code&gt;#if defined ( NRF52 )&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't flash debug bootloader from SDK 12.1.0. ERROR: The area to write is not erased.</title><link>https://devzone.nordicsemi.com/thread/66658?ContentTypeID=1</link><pubDate>Fri, 28 Oct 2016 08:49:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15419d59-d2f6-4a24-a036-1f15e9534385</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Yes, you are correct, the bootloader settings section in the application linker script should be there. I think that it might be cause by the MBR params page in the nrf_dfu_settings.c file, please see &lt;a href="https://devzone.nordicsemi.com/question/100609/sdk-12-bootloader-erased-after-programming/?answer=100661#post-id-100661"&gt;this&lt;/a&gt; answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't flash debug bootloader from SDK 12.1.0. ERROR: The area to write is not erased.</title><link>https://devzone.nordicsemi.com/thread/66654?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2016 11:09:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83cf0b87-6b84-4c36-856d-4666c9cac228</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;That has not been my experience. If I leave these out, this is what the BLE DFU service does:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:INFO:------- nrf_dfu_flash_init-------
:INFO:running nrf_dfu_settings_init
:INFO:!!!!!!!!!!!!!!! Resetting bootloader settings !!!!!!!!!!!
:INFO:Erasing old settings at: 0x20002110
:INFO:Erasing: 0x20002110, num: 1
:INFO:Erase failed: 6
:INFO:Failed to erase bootloader settings
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;0x20002110 is completely wrong. It&amp;#39;s put the bootloader settings in RAM, not flash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't flash debug bootloader from SDK 12.1.0. ERROR: The area to write is not erased.</title><link>https://devzone.nordicsemi.com/thread/66657?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2016 10:52:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0eb4e459-e05b-4e8b-aa28-a6c1dec156d6</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;@eliotstock: I believe the bootloader settings and the bootloader start address sections in the application are causing the conflict. These sections are used by the bootloader only, i.e. application does not to define these sections in code or in the linker scripts.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't flash debug bootloader from SDK 12.1.0. ERROR: The area to write is not erased.</title><link>https://devzone.nordicsemi.com/thread/66656?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2016 09:13:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:422272fb-1c07-4bd7-b7d2-ffda7f923e0f</guid><dc:creator>Eliot Stock</dc:creator><description>&lt;p&gt;Sorry, that would have been helpful. Done now in an edit above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't flash debug bootloader from SDK 12.1.0. ERROR: The area to write is not erased.</title><link>https://devzone.nordicsemi.com/thread/66655?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2016 09:05:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d2d3183-09fa-477e-a6ac-5ead60ae7bfb</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Could you post the linker script for the application ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>