<?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>DFU issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49290/dfu-issue</link><description>Hello, I am using nrfgo studio to flash softdevice, application and bootloader on nrf52832 I am getting below issue: 
 &amp;quot; This hex file has data in SoftDevice region. Try programming using &amp;quot;Program SoftDevice&amp;quot;, or erase all before programming&amp;quot; 
 Application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 03 Jul 2019 13:17:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49290/dfu-issue" /><item><title>RE: DFU issue</title><link>https://devzone.nordicsemi.com/thread/196288?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 13:17:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:114843b9-587e-4954-bb61-f9c847f26398</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Ok, then you need to debug the bootloader project and see what dfu_enter_check() in&amp;nbsp;nrf_bootloader_init() in nrf_bootloader.c returns.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU issue</title><link>https://devzone.nordicsemi.com/thread/196276?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 13:08:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a2dd211-6fa9-41ff-9868-16b88fca3a85</guid><dc:creator>chandan</dc:creator><description>&lt;p&gt;&lt;span&gt;It advertising DfuTarget&amp;nbsp;, not going to application only for 1 board, other one same settings is working fine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I generated and merged boot loader&amp;nbsp;settings.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU issue</title><link>https://devzone.nordicsemi.com/thread/196269?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 12:59:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44b96206-d64d-4384-8706-c73e28bc45e1</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;By stuck at bootloader, do you mean that its not advertising or is it advertising DfuTarget and not jumping to the application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;If its the latter, then you need to generate a bootloader settings page and merge this with the bootloader hex, see&amp;nbsp;&lt;a href="https://github.com/NordicSemiconductor/pc-nrfutil#settings"&gt;https://github.com/NordicSemiconductor/pc-nrfutil#settings&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU issue</title><link>https://devzone.nordicsemi.com/thread/196264?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 12:47:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29e82a43-5e05-409c-a981-747cf9eb040e</guid><dc:creator>chandan</dc:creator><description>&lt;p&gt;No I am erasing entire flash and flashing new code with bootloader and softdevice. For one type of board its working fine but other code stuck at bootloader.&lt;/p&gt;
&lt;p&gt;Both have same nordic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU issue</title><link>https://devzone.nordicsemi.com/thread/196262?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 12:44:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8664f9b0-cd6a-4004-bd6b-d260cf8aa3d8</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;No, if you have the same bootloader on all the boards, then DFU should work fine on all nRF52832 revision 1 and 2, see&amp;nbsp;&lt;a title="SDKs and SoftDevices" href="https://infocenter.nordicsemi.com/topic/comp_matrix_nrf52832/COMP/nrf52832/ic_rev_sdk_sd_comp_matrix.html?cp=3_1_2_2"&gt;SDKs and SoftDevices&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, if the older boards have bootloaders from older SDKs, then you might have to generate the firmware images with the compatible nrfutil version, please see&amp;nbsp;&lt;a href="https://github.com/NordicSemiconductor/pc-nrfutil#versions"&gt;https://github.com/NordicSemiconductor/pc-nrfutil#versions&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU issue</title><link>https://devzone.nordicsemi.com/thread/196251?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 12:12:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e12fc6d-e11b-4aec-8913-1f4c9e444cf1</guid><dc:creator>chandan</dc:creator><description>&lt;p&gt;Thanks, I will implement same.&lt;/p&gt;
&lt;p&gt;Also one thing, Does DFU depends on hardware. We have made few customize&amp;nbsp;&lt;span&gt;nrf52832&amp;nbsp;board. I found in one old board DFU is working fine but other one code is getting stuck at booloader&amp;nbsp;and only advertising dfutag. Please suggest.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU issue</title><link>https://devzone.nordicsemi.com/thread/196243?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 11:52:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29a88726-d7e6-48bb-baa9-f04eba28fca2</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Chandan,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First, nRFGo Studio is deprecated for the nRF52 Series, please use the&amp;nbsp;&lt;a title="nRF Connect Programmer" href="https://infocenter.nordicsemi.com/topic/ug_nc_programmer/UG/nrf_connect_programmer/ncp_introduction.html?cp=6_3_1"&gt;nRF Connect Programmer&lt;/a&gt;&amp;nbsp;instead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Which SDK version and SoftDevice version are you using? SDK v15.3.0?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If yes, then&amp;nbsp;this is a known issue in SDK v15.3.0, i.e. that the bootloader and SoftDevice( specifically the MBR) have overlapping sections. Programming the generated bootloader hex file with nrfjprog using the --sectorerase command, which is happening under the hood in the nRF Connect Programmer app, will result in the MBR being erased.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This can be solved by merging the SoftDevice hex file with the bootloader hex file and then programming the combined hex. However, this is a bit cumbersome so we will likely switch to an approach where we write the bootloader start address to UICR and then the bootloader will at run-time write the bootloader start address to the MBR page. I have implemented this in SDK v15.3.0 and it is done by modifyying the&amp;nbsp;uicr_bootloader_start_address section in the flash_placement.xml to the following&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// in nrf_mbr.h
#define MBR_BOOTLOADER_ADDR      (0xFF8)
#define MBR_PARAM_PAGE_ADDR      (0xFFC)

//in app_util.h
#define CODE_START ((uint32_t)&amp;amp;_vectors)

//in nrf_bootloader_info.h
#define BOOTLOADER_START_ADDR (CODE_START)

//in nrf_dfu_types.h
#define NRF_MBR_PARAMS_PAGE_ADDRESS         (0x0007E000UL)

ret_code_t nrf_bootloader_write_bl_addr_to_mbr(void){

    if( (*(volatile uint32_t *)MBR_BOOTLOADER_ADDR != BOOTLOADER_START_ADDR) &amp;amp;&amp;amp; 
     (*(volatile uint32_t *)MBR_PARAM_PAGE_ADDR = NRF_MBR_PARAMS_PAGE_ADDRESS))
     {
          // Enable Write with the NVMC
          NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
          while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}

          // Write Bootloader start address to MBR 
          *(volatile uint32_t *)MBR_BOOTLOADER_ADDR = BOOTLOADER_START_ADDR;
          // Write MBR parameter page address to MBR
          *(volatile uint32_t *)MBR_PARAM_PAGE_ADDR = NRF_MBR_PARAMS_PAGE_ADDRESS;
          // Revert NVMC to read-only
          NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
          while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
      }

    return NRF_SUCCESS;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You will however need to modify the flash_placement.xml to place&amp;nbsp;the addresses in UICR instead of flash.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  &amp;lt;MemorySegment name=&amp;quot;uicr_bootloader_start_address&amp;quot; start=&amp;quot;0x10001014&amp;quot; size=&amp;quot;0x4&amp;quot;&amp;gt;
    &amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; keep=&amp;quot;Yes&amp;quot; load=&amp;quot;Yes&amp;quot; name=&amp;quot;.uicr_bootloader_start_address&amp;quot; address_symbol=&amp;quot;__start_uicr_bootloader_start_address&amp;quot; end_symbol=&amp;quot;__stop_uicr_bootloader_start_address&amp;quot; start = &amp;quot;0x10001014&amp;quot; size=&amp;quot;0x4&amp;quot; /&amp;gt;
  &amp;lt;/MemorySegment&amp;gt;
  &amp;lt;MemorySegment name=&amp;quot;uicr_mbr_params_page&amp;quot; start=&amp;quot;0x10001018&amp;quot; size=&amp;quot;0x4&amp;quot;&amp;gt;
    &amp;lt;ProgramSection alignment=&amp;quot;4&amp;quot; keep=&amp;quot;Yes&amp;quot; load=&amp;quot;Yes&amp;quot; name=&amp;quot;.uicr_mbr_params_page&amp;quot; address_symbol=&amp;quot;__start_uicr_mbr_params_page&amp;quot; end_symbol=&amp;quot;__stop_uicr_mbr_params_page&amp;quot; start = &amp;quot;0x10001018&amp;quot; size=&amp;quot;0x4&amp;quot; /&amp;gt;
  &amp;lt;/MemorySegment&amp;gt;
&amp;lt;/Root&amp;gt;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>