<?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>Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82346/losing-bonding-and-fds-info-on-dfu</link><description>Running 52840 with SDK 15.3, SD140 on SES Ive got an application that has a bootloader on it running DFU. Everything works during DFU correctly but when I get into the application (same SDK version), I&amp;#39;ve lost my bonding and other FDS information. 
 Application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Dec 2021 22:51:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82346/losing-bonding-and-fds-info-on-dfu" /><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/342183?ContentTypeID=1</link><pubDate>Mon, 06 Dec 2021 22:51:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c7732d7-8273-4435-a170-6a3037334c3e</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;After some experiments, it looks like this is what&amp;#39;s going on here.... I&amp;#39;ve put this code in and I think it&amp;#39;s working correctly from here..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/342172?ContentTypeID=1</link><pubDate>Mon, 06 Dec 2021 19:40:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:466df7de-8f75-408c-81aa-a562c3d826c4</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;One of the errors I had, I did a search on and came up with something you&amp;#39;ve answered before to some extent.. &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/38663/keep-getting-failed-to-secure-connection-error/156832#156832"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/38663/keep-getting-failed-to-secure-connection-error/156832#156832&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I already had some cod in there to prevent this but changed it to&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pm_conn_sec_config_t conn_sec_config = { .allow_repairing = true };&lt;/p&gt;
&lt;p&gt;And I can now run commands from my App against this thing (albeit with an Android request for pairing).&lt;/p&gt;
&lt;p&gt;I&amp;#39;m going to follow that thread a bit more...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/342164?ContentTypeID=1</link><pubDate>Mon, 06 Dec 2021 17:24:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f418fc3-3c3c-4faa-adde-a80c513cd37d</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;Experiment this morning:&lt;br /&gt; &lt;br /&gt; * flashed with prior version of the code using Segger jlink lite.&lt;br /&gt; * Connected up the app (Android app on a Samsung tablet) and bound the device (so now I should have bonding information to this tablet).&lt;br /&gt; * Drop the app&lt;br /&gt; * Use nRFconnect to kick into bootloader mode&lt;br /&gt; * Us nRFconnect to do DFU to Current version of the code&lt;br /&gt; * Connect back up with JLink RTT viewer&lt;br /&gt; &lt;br /&gt; nRFconnect was asking to pair, so paired (twice)&lt;br /&gt; &lt;br /&gt; Got (these are [mostly] my internal debug statements printing things but some of these are Nordic debug statements:&lt;br /&gt; &lt;br /&gt; 00&amp;gt; [1638809628.058] Reboot into bootloader in 1 sec...&lt;br /&gt; 00&amp;gt; [3624999905.013] POR Vbat: (3.00V)&lt;br /&gt; 00&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_freertos: Creating a SoftDevice task.&lt;br /&gt; 00&amp;gt; &amp;lt;debug&amp;gt; ble_scan: Adding filter on RWStudentID name&lt;br /&gt; 00&amp;gt; &amp;lt;info&amp;gt; app: USB power detected&lt;br /&gt; 00&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_freertos: Enter softdevice_task.&lt;br /&gt; 00&amp;gt; [3624999905.266] Whitelist: File found&lt;br /&gt; 00&amp;gt; [3624999905.266] Whitelist: File read successfully&lt;br /&gt; 00&amp;gt; [3624999905.266] Whitelist: Whitelist file found. peer_id=0&lt;br /&gt; 00&amp;gt; [3624999905.267] Whitelist: File found. Writing data into it&lt;br /&gt; 00&amp;gt; [3624999905.267] Whitelist: Write succeeded.&lt;br /&gt; 00&amp;gt; &amp;lt;info&amp;gt; app: USB ready&lt;br /&gt; 00&amp;gt; [1630337702.317] temperature: 22.0C&lt;br /&gt; 00&amp;gt; [1630337702.317] Vbat: 100% (3.41V)&lt;br /&gt; &lt;br /&gt; * Bring App back up&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The App is showing stuff coming from the device but attempting to connect and send a command is showing (on Segger RTT viewer):&lt;/p&gt;
&lt;p&gt;00&amp;gt; [1630338002.415] Vbat: 100% (3.39V)&lt;br /&gt; 00&amp;gt; &amp;lt;warning&amp;gt; peer_manager_gcm: The local database has changed, so some subscriptions to notifications and indications could not be restored for conn_handle 0&lt;br /&gt; 00&amp;gt; &amp;lt;warning&amp;gt; peer_manager_handler: Local DB could not be applied: conn_handle: 0, peer_id: 0&lt;br /&gt; 00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.&lt;br /&gt; 00&amp;gt; [1630338050.927] BLE: Peer connected&lt;br /&gt; 00&amp;gt; [1630338051.061] BLE: Allow repairing: 0&lt;br /&gt; 00&amp;gt; &amp;lt;info&amp;gt; peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 133&lt;br /&gt; 00&amp;gt; &amp;lt;warning&amp;gt; peer_manager_handler: Disconnecting conn_handle 0.&lt;br /&gt; 00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).&lt;br /&gt; 00&amp;gt; [1630338051.151] BLE: Data len is set to 0xF4(244)&lt;br /&gt; 00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.&lt;br /&gt; 00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 27 on connection 0x0.&lt;br /&gt; 00&amp;gt; &amp;lt;error&amp;gt; nrf_ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned NRF_ERROR_INVALID_STATE.&lt;br /&gt; 00&amp;gt; [1630338051.012] POR Vbat: (3.35V) [&amp;lt;- my log indicating reset path]&lt;br /&gt; 00&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_freertos: Creating a SoftDevice task.&lt;br /&gt; 00&amp;gt; &amp;lt;debug&amp;gt; ble_scan: Adding filter on RWStudentID name&lt;br /&gt; 00&amp;gt; &amp;lt;info&amp;gt; app: USB power detected&lt;br /&gt; 00&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_freertos: Enter softdevice_task.&lt;br /&gt; 00&amp;gt; [1630338051.250] Whitelist: File found&lt;br /&gt; 00&amp;gt; [1630338051.250] Whitelist: File read successfully&lt;br /&gt; 00&amp;gt; [1630338051.250] Whitelist: Whitelist file found. peer_id=0&lt;br /&gt; 00&amp;gt; [1630338051.251] Whitelist: File found. Writing data into it&lt;br /&gt; 00&amp;gt; [1630338051.251] Whitelist: Write succeeded.&lt;br /&gt; 00&amp;gt; [1630338051.256] Device service: Version=0.8.4.2, Family=90, ProgramChecksum=2213D3E4&lt;br /&gt; 00&amp;gt; [1630338051.259] Whitelist: File found&lt;br /&gt; 00&amp;gt; [1630338051.259] Whitelist: File read successfully&lt;br /&gt; 00&amp;gt; [1630338051.259] BLE: Whitelist contains a peer. Start advertising.&lt;br /&gt; 00&amp;gt; [1630338051.259] Whitelist: Applied whitelist with addr_cnt=1 irk_cnt=1&lt;br /&gt; 00&amp;gt; [1630338051.264] temperature: 23.0C&lt;br /&gt; 00&amp;gt; [1630338051.264] Vbat: 100% (3.45V)&lt;br /&gt; 00&amp;gt; [1630338051.270] LOG: 221,18,0x00,0x00&lt;br /&gt; 00&amp;gt; &amp;lt;info&amp;gt; app: USB ready&lt;br /&gt; 00&amp;gt; [1630337462.277] POR [&amp;lt;- my log indicating reset path]&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; There appears to be several places where I&amp;#39;m overrunning the output buffers here, but the interesting thing to note here is extra POR events that shouldn&amp;#39;t be there.&lt;/p&gt;
&lt;p&gt;This has something or other to do with the DFU, but not at all clear to me what...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/342161?ContentTypeID=1</link><pubDate>Mon, 06 Dec 2021 17:13:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6af12744-0c1a-42be-bf91-3690e4b5dd44</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;This is plenty complex behaviour so let me note what I&amp;#39;ve done here....&amp;nbsp; Not sure I understand what&amp;#39;s going on exactly..&amp;nbsp; First off, I&amp;#39;ve attached the dump you&amp;#39;ve requested.&amp;nbsp; Then let me explain what I did...&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3264.flash.txt"&gt;devzone.nordicsemi.com/.../3264.flash.txt&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/341908?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 13:49:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8ac2b90-6bda-442f-ae03-3b29b95a74fa</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;I don&amp;#39;t think it&amp;#39;s failing.... Looking at the code, it should hang if it does and I&amp;#39;m not seeing hangs.&amp;nbsp; I&amp;#39;ll have to verify that when next I can run a debugger there but I&amp;#39;m pretty sure it isn&amp;#39;t.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/341905?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 13:42:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78326068-1407-4703-93f1-07c39911b5cb</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The peer manager should only delete bonding information when the application explitely requests it through &lt;span class="item"&gt;&lt;a title="pm_peer_data_delete" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__peer__manager.html?cp=8_5_2_6_2_15_51#ga7292e5ea2f00b2384b01460aba0e7a8f"&gt;pm_peer_data_delete&lt;/a&gt;&lt;/span&gt;()/&lt;span class="item"&gt;&lt;a class="" title="pm_peers_delete" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__peer__manager.html?cp=8_5_2_6_2_15_62#gaa99779ab5b8b4cfde65974bdf75a1e7c"&gt;pm_peers_delete&lt;/a&gt;&lt;/span&gt;(), or if you have run out of FDS space and call &lt;span class="item"&gt;&lt;a class="" title="pm_handler_flash_clean" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__pm__handler.html?cp=8_5_2_6_2_15_2_1#ga143031c4ec929f76d406f5c7c40dcb8a"&gt;pm_handler_flash_clean&lt;/a&gt;&lt;/span&gt;()/&lt;span class="item"&gt;&lt;a class="" title="pm_handler_flash_clean_on_return" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__pm__handler.html?cp=8_5_2_6_2_15_2_2#ga3519c41daa6b593307c294945214e7fb"&gt;pm_handler_flash_clean_on_return&lt;/a&gt;&lt;/span&gt;().&lt;/p&gt;
&lt;p&gt;I initally assumed that pm_init() failed after DFU because that&amp;#39;s usally what happens if the bootloader has corrupted the filesystem. Is that not what happens in your case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/341899?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 13:25:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6533454b-d1aa-4df8-97b2-c739ddf23b40</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;Theory: Because the bootloader isn&amp;#39;t requiring bonding, the peer manager is deleting what bonding info it has here so when my application comes back online, there is no bonding info saved.&amp;nbsp; Is it possible that the bootloader isn&amp;#39;t erasing the are but that other things are deleting what&amp;#39;s there because it doesn&amp;#39;t need it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/341891?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 13:14:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa79fb44-cae4-43b0-a60c-02facd4e4c21</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;no need.&amp;nbsp; none of that data is proprietary...&amp;nbsp; Or even interesting to anything but Nordic code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/341889?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 13:07:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:139bec1c-bffc-466f-b130-b58ff9f4d2e3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;You too, thanks. Do you want me to make the ticket private in the meantime?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/341885?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 13:06:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de9de26c-a96c-4cbd-9732-818c0f2303ac</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;Yah, I can do that... It&amp;#39;ll probably be Monday before I can get it tho so hang tight.&amp;nbsp; Have a good weekend..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/341884?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 13:01:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1109cc21-3aa8-4e7d-85ee-308ba5fad27b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for confirming. So it must be something else then. Are you able to share a dump of the flash content here or in a private ticket so I can take a look? &lt;/p&gt;
&lt;p&gt;Reading flash with nrfjprog&lt;/p&gt;
&lt;p&gt;&amp;gt; nrfjprog --memrd 0x0 --n 0x100000 &amp;gt; flash.txt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/341877?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 12:54:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd14ee3b-484c-4745-9ea4-c2982bbfe8af</guid><dc:creator>Randy Lee</dc:creator><description>&lt;p&gt;yes, This is set in the sdk_config.h file for the bootloader:&lt;/p&gt;
&lt;p&gt;#define NRF_DFU_APP_DATA_AREA_SIZE 12288&lt;/p&gt;
&lt;p&gt;the SDK file nrf_dfu_types.h has:&lt;/p&gt;
&lt;p&gt;#define NRF_DFU_APP_DATA_AREA_SIZE (CODE_PAGE_SIZE * 3)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Losing Bonding and FDS info on DFU</title><link>https://devzone.nordicsemi.com/thread/341874?ContentTypeID=1</link><pubDate>Fri, 03 Dec 2021 12:50:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa6d5fc5-322b-4a0f-8fa9-6e28b1b9e725</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The bootloader should not be able to write into the application data as long as the NRF_DFU_APP_DATA_AREA_SIZE setting in your bootloader&amp;#39;s sdk_config file corresponds to the size of your FDS area allocated by the app. So please double-check that&amp;nbsp; NRF_DFU_APP_DATA_AREA_SIZE&amp;nbsp; is indeed set to 12288 in your bootloader project.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I see you mentioned using the DFU_APP_DATA_RESERVED define, but please note that this symbol was renamed to NRF_DFU_APP_DATA_AREA_SIZE&amp;nbsp; in this SDK version.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>