<?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>Unable to bond when using the bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8832/unable-to-bond-when-using-the-bootloader</link><description>Hi, I&amp;#39;m trying to use the example bootloader with the new NRF52, everything seems to work fine except that I&amp;#39;m unable to bond to the device when the bootloader is installed. The same test HRS application bonds just fine when the bootloader is not installed</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 21 Aug 2015 12:42:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8832/unable-to-bond-when-using-the-bootloader" /><item><title>RE: Unable to bond when using the bootloader</title><link>https://devzone.nordicsemi.com/thread/32470?ContentTypeID=1</link><pubDate>Fri, 21 Aug 2015 12:42:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a68eae25-bfde-4ec4-ba5c-7af03e97a184</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@planas: You can create a question with tag or subject with [BugReport] on this forum. We will try to report it to R&amp;amp;D.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to bond when using the bootloader</title><link>https://devzone.nordicsemi.com/thread/32469?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2015 22:55:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f81803c-59f8-4d82-adc5-d545aed365c0</guid><dc:creator>planas</dc:creator><description>&lt;p&gt;@Hung Bui I just realized the missing &amp;quot;defined&amp;quot; wasn&amp;#39;t on the pstorage file but on dfu_types.h. Anyway, I&amp;#39;ve found more bugs on the bootloader side (easy to fix) and I have a couple of suggestions as well. Who or where should I contact to address this information? Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to bond when using the bootloader</title><link>https://devzone.nordicsemi.com/thread/32468?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2015 15:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcfd5c94-6286-459b-9253-5a36abf51aed</guid><dc:creator>planas</dc:creator><description>&lt;p&gt;You&amp;#39;re right, I guess I was keeping this file from an old sdk version.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to bond when using the bootloader</title><link>https://devzone.nordicsemi.com/thread/32467?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2015 15:50:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27afb6a3-d773-49ad-acdf-b069c2fe435e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@planas: I&amp;#39;m glad that it worked for you.
Which SDK are you using and which example are you looking at ? On my ble_app_hrs example in SDk v0.9.1 it is already defined with &amp;quot;#elif defined NRF52&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to bond when using the bootloader</title><link>https://devzone.nordicsemi.com/thread/32466?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2015 15:41:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f2afaa8-c65c-49f9-b3f5-654fbf9c54e6</guid><dc:creator>planas</dc:creator><description>&lt;p&gt;Thanks Hung, it works fine now. And now that you mention it, I had to fix the #ifdef ... #elif conditional before since it doesn&amp;#39;t play well with gcc. You should add a &amp;quot;defined&amp;quot; after the #elif. This way it would work with all major ISO C compilers. The final fixed code looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#ifdef NRF51
#define BOOTLOADER_ADDRESS                    (NRF_UICR-&amp;gt;BOOTLOADERADDR)
#elif defined NRF52
#define NRF_UICR_BOOT_START_ADDRESS     (NRF_UICR_BASE + 0x14)  
#define BOOTLOADER_ADDRESS                     *((uint32_t *)NRF_UICR_BOOT_START_ADDRESS)
#endif
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to bond when using the bootloader</title><link>https://devzone.nordicsemi.com/thread/32465?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2015 15:31:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62f2541d-c394-4ca5-bc25-2d8acb06388a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Planas,&lt;/p&gt;
&lt;p&gt;I have reproduced and confirmed the issue here.&lt;/p&gt;
&lt;p&gt;It was the issue with pstorage, due to the fact that we don&amp;#39;t rearrange the pstorage data properly when the bootloader is installed. And pstorage will try to overwrite the area the bootloader already occupied.&lt;/p&gt;
&lt;p&gt;The fix is to move the pstorage data area under the bootloader if the bootloader is existing on the flash (bootloader address is written in the UICR).&lt;/p&gt;
&lt;p&gt;What you need to is to replace&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define BOOTLOADER_ADDRESS        PSTORAGE_FLASH_EMPTY_MASK
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NRF_UICR_BOOT_START_ADDRESS     (NRF_UICR_BASE + 0x14)  

#define BOOTLOADER_ADDRESS         *((uint32_t *)NRF_UICR_BOOT_START_ADDRESS)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in file pstorage_platform.h in your application source code.&lt;/p&gt;
&lt;p&gt;I will report this issue internally. It will be fixed in the future release of the SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>