<?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>Device not booting after bootloader copy</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7869/device-not-booting-after-bootloader-copy</link><description>Hi, 
 Slight problem here with bootloader updates : right after download, I copy from SWAP (0x16000) to normal location (0x38000 in my case). 
 sd_mbr_cmd.command = SD_MBR_COMMAND_COPY_BL;
sd_mbr_cmd.params.copy_bl.bl_src = 0x16000
sd_mbr_cmd.params</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Jul 2015 10:34:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7869/device-not-booting-after-bootloader-copy" /><item><title>RE: Device not booting after bootloader copy</title><link>https://devzone.nordicsemi.com/thread/28071?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2015 10:34:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58fbc0d7-e334-4587-80fb-7f729cc54155</guid><dc:creator>Jean-Louis Bonnaff&amp;#233;</dc:creator><description>&lt;p&gt;@hungbui Indeed, it was exactly that. I hadn&amp;#39;t realized that the MBR swap meant to reset. Thank you very much !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not booting after bootloader copy</title><link>https://devzone.nordicsemi.com/thread/28067?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2015 07:38:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45b74d41-20b5-4014-bb16-6eb2a7d6b95f</guid><dc:creator>jpo38</dc:creator><description>&lt;p&gt;No problem, I&amp;#39;m just not sure @Jean-Louis Bonnaffé got your message ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not booting after bootloader copy</title><link>https://devzone.nordicsemi.com/thread/28066?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2015 07:35:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:210f663f-26f1-40ef-b254-11d7ad76ae90</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Jean: Sorry about that. I didn&amp;#39;t know the there is notification when using @. Will use correct name next time :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not booting after bootloader copy</title><link>https://devzone.nordicsemi.com/thread/28065?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2015 06:31:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8c2cb3d-1979-4d36-ae2f-fa5ad9e8e4d1</guid><dc:creator>jpo38</dc:creator><description>&lt;p&gt;@Hung Bui, you may want to edit you comment and replace &lt;code&gt;@Jean&lt;/code&gt; by &lt;code&gt;@Jean-Louis Bonnaffé&lt;/code&gt;, we are not the same person ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not booting after bootloader copy</title><link>https://devzone.nordicsemi.com/thread/28070?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 15:56:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aa0a7a7-802f-47bb-8dad-e472387278d3</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Jean: I found maybe a bug in your code.&lt;/p&gt;
&lt;p&gt;In your bootloader code, you have modified bootloader_dfu_sd_update_continue() to again do a dfu_bl_image_swap() if p_bootloader_settings-&amp;gt;bl_image_size != 0, this is not enough. You should combine it with a SD_MBR_COMMAND_COMPARE (dfu_bl_image_validate) to check if the image is already copied correctly or not. If it already copied correctly, don&amp;#39;t do another dfu_bl_image_swap() or you will stay in a loop forever.&lt;/p&gt;
&lt;p&gt;The reason for that is when you call dfu_bl_image_swap(), it&amp;#39;s a kamikaze call. The MBR will take over, swap the bootloader and do a reset. The result is that you will reset back to bootloader, and if you do another swap you will stay in a dead loop.&lt;/p&gt;
&lt;p&gt;When you finished with updating the bootloader (validate return success), you should erase the swap area (0x16000).&lt;/p&gt;
&lt;p&gt;However, I tried to fix that in your code, and ended up the bootloader being erased (0xFFFFF). I &amp;#39;m running out of time for futher debug for now, but I would suggest you to look into the bug I mentioned above.&lt;/p&gt;
&lt;p&gt;If the MBR succeed in swaping the BL, data at address 0xC00 should = 0xFFFFFFFF. Otherwise it will stuck in updating the BL.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not booting after bootloader copy</title><link>https://devzone.nordicsemi.com/thread/28064?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 10:01:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96d85e21-680a-45e0-a64a-cf847602c4db</guid><dc:creator>Jean-Louis Bonnaff&amp;#233;</dc:creator><description>&lt;p&gt;Yes, 0x38000 is our mapping for the bootloader.&lt;/p&gt;
&lt;p&gt;What you can see at address 0x3EC00 is just some data copied from the swap area @0x1CC00, which is some remaining data from the application present when we started downloading - it was not fully erased.&lt;/p&gt;
&lt;p&gt;For address 0x37800, good guess - it is our application data, which was updated during the download process. Noteworthy, we have modified this structure to fit our needs - could it be responsible for boot pb ?&lt;/p&gt;
&lt;p&gt;FYI my SDK version is v6_1_0_b2ec2e6, the softdevice is v7.1.0, the bootloader in the SDK is fine, and I can send you my project, but only on a private channel.&lt;/p&gt;
&lt;p&gt;One more note : after investigation, the only diffs that prevent our device from booting are those located in s110 (@0x800, @0xc00) AND in the app data (@0x37800). Is the bootloader start sequence expecting to find something specific in the app data ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not booting after bootloader copy</title><link>https://devzone.nordicsemi.com/thread/28069?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 15:09:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a760b2f-65b2-46cf-9d39-ae8558e516c3</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Jean-Louis: I assume that you modified the start address of bootloader ? Seems your is at 0x38000 Our bootloader starts at 0x3C000.&lt;/p&gt;
&lt;p&gt;Address 0x3EC00 is pretty strange for me, what is that Swap ?&lt;/p&gt;
&lt;p&gt;Comparing the 2 dump I also saw difference at 0x37800. I assume that&amp;#39;s where your application data is ?&lt;/p&gt;
&lt;p&gt;Could you send me your bootloader project file for testing here ? Please let me know your SDK version, and S110 version. Have you tried to test with our stock bootloader example ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not booting after bootloader copy</title><link>https://devzone.nordicsemi.com/thread/28068?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 13:32:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc981432-0ff4-4c1a-a1be-1bf0da7e22fe</guid><dc:creator>Jean-Louis Bonnaff&amp;#233;</dc:creator><description>&lt;p&gt;Hi Hung Bui,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried downloading the same bootloader that was already flashed.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The UICR boot address hasn&amp;#39;t changed (0x38000).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Flash dumps are attached &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/dump_2D00_ok_2D00_latest_2D00_before_2D00_download.bin"&gt;here&lt;/a&gt; and &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/dump_2D00_brick_2D00_after_2D00_BL_2D00_download.bin"&gt;here&lt;/a&gt;.
The diffs are located at 0x800 (softdevice), 0xC00 (softdevice), 0x16000 (swap area - contains the bootloader image), and 0x3EC00 (data copied from the swap area, every time I boot)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Debug session under Keil : the execution is stuck at offset 0x38334, which is in the arm_startup_nrf51.s&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;(according to the .map output)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;0x00038320   0x00000048   Code   RO    63    .text         arm_startup_nrf51.o
0x00038368   0x000006e0   Code   RO    70    .text         main.o
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Device not booting after bootloader copy</title><link>https://devzone.nordicsemi.com/thread/28063?ContentTypeID=1</link><pubDate>Mon, 29 Jun 2015 12:48:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e4aedf9-89f0-48b0-942f-54a6d162e8ca</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jean,&lt;/p&gt;
&lt;p&gt;Could you check if the bootloader start address in UICR (NRF_UICR_BOOT_START_ADDRESS, 0x10001014)  is correctly point to the start address of your bootloader ?&lt;/p&gt;
&lt;p&gt;If you update the same hex file for the bootloader, would it work ?
You can try to read out the image before and after the bootloader update and compare them, you can upload them here.&lt;/p&gt;
&lt;p&gt;You can try to run the bootloader in debug mode and see if it can get to main().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>