<?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>Problem reconnecting after dfu on IOS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111972/problem-reconnecting-after-dfu-on-ios</link><description>Hello, 
 I am developing an app based on the the buttonless_dfu example and the secure bootloader and it works fine with Android. 
 I have the following problem with IOS: 
 The dfu process works fine but when the app reboots after dfu. nrf connect on</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Jul 2024 12:24:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111972/problem-reconnecting-after-dfu-on-ios" /><item><title>RE: Problem reconnecting after dfu on IOS</title><link>https://devzone.nordicsemi.com/thread/492450?ContentTypeID=1</link><pubDate>Fri, 05 Jul 2024 12:24:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4678514-605c-4775-827b-fce26a6f168f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I assume you have&amp;nbsp;&lt;span&gt;pm_handler_flash_clean&lt;/span&gt;&lt;span&gt;&lt;span&gt;(p_evt); in your&amp;nbsp;&lt;/span&gt;&lt;/span&gt;pm_evt_handler()&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;Generally, you should only&amp;nbsp;call&amp;nbsp;pm_handler_flash_clean_on_return() when a pm_* function returns&amp;nbsp;&amp;nbsp; NRF_ERROR_STORAGE_FULL&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem reconnecting after dfu on IOS</title><link>https://devzone.nordicsemi.com/thread/491646?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2024 14:57:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f79fccf9-112d-483e-9817-784b10899e65</guid><dc:creator>ckoechli</dc:creator><description>&lt;p&gt;I was wrong, calling pm_handler_flash_clean_on_return() at startup didn&amp;#39;t solve the problem in all cases.&lt;/p&gt;
&lt;p&gt;The problem that I have is that there are duplicate records in the fds &amp;quot;database&amp;quot; of the peer manager&lt;/p&gt;
&lt;p&gt;So my problem is related to the one of this thread:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/100891/flash-data-storage-fds-fds_record_update---reset---two-valid-records-possible/431839"&gt;RE: Flash Data Storage (FDS) fds_record_update() -&amp;gt; Reset -&amp;gt; Two valid records possible?&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I was wondering if enabling the crc would solve it and I noticed that a failed CRC check is ignored in peer_data_storage.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// It is safe to ignore the return value since the descriptor was
// just obtained and also &amp;#39;record&amp;#39; is different from NULL.
(void)fds_record_open(&amp;amp;record_desc, &amp;amp;record);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;My questions are the followings:&lt;/p&gt;
&lt;p&gt;1) What happens when the peer manager timeouts when writing to the flash?&lt;/p&gt;
&lt;p&gt;2) Is there a way of avoiding it (my app. downloads a log file right after startup and I optimized the data transfer just for that)?&lt;/p&gt;
&lt;p&gt;3) Is there a built-in way of detecting&amp;nbsp; that there are duplicate records ?&lt;/p&gt;
&lt;p&gt;4) Does enabling the crc check solve it?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;Christian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem reconnecting after dfu on IOS</title><link>https://devzone.nordicsemi.com/thread/490930?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 15:07:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c124061d-5535-4ea3-80ea-4b10cb900bbe</guid><dc:creator>ckoechli</dc:creator><description>&lt;p&gt;I was able to solve the problem in calling pm_handler_flash_clean_on_return() at startup.&lt;/p&gt;
&lt;p&gt;So I guess that the peer manager database gets corrupted somehow during the dfu testing process. I was able to reproduce the problem several times but I don&amp;#39;t know exactly how.&lt;/p&gt;
&lt;p&gt;I can live with that provided that there is a way to detect the problem or to avoid it in doing garbage collection preemptively.&lt;/p&gt;
&lt;p&gt;My question is: can I call pm_handler_flash_clean_on_return() at startup every time before I start advertising ?&lt;/p&gt;
&lt;p&gt;Christian&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem reconnecting after dfu on IOS</title><link>https://devzone.nordicsemi.com/thread/490764?ContentTypeID=1</link><pubDate>Wed, 26 Jun 2024 07:15:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f4dd05e-36ae-49b7-ba90-9d668d5fa200</guid><dc:creator>ckoechli</dc:creator><description>&lt;p&gt;Thank you for your answer !&lt;/p&gt;
&lt;p&gt;I still have the problem after calling pm_local_database_changed() but it&amp;#39;s a little more vicious this time.&lt;/p&gt;
&lt;p&gt;I call pm_local_database_has_changed() right after peer_manager_init() and it worked for a while doing dfu tests.&lt;/p&gt;
&lt;p&gt;At some point, it stopped doing its job and the service changed notification was not sent anymore after dfu. Erasing the chip and reflashing it with a fresh firmware solved the problem (erasing the peer table with delete_bonds() doesn&amp;#39;t solve the problem ). However after further dfu tests, it reappeared.&lt;/p&gt;
&lt;p&gt;The problem is hard to trigger but once it is there, the notification is systematically not sent after dfu.&lt;/p&gt;
&lt;p&gt;I traced the problem down to the pds_peer_data_store and pds_peer_data_read calls&lt;/p&gt;
&lt;p&gt;pds_peer_data_store writes the right data (1) to enable the notification but then pds_peer_data_read reads 0 and the notification is not sent.&lt;/p&gt;
&lt;p&gt;As a workaround, I could force the notification at each connection without relying on the peer table but I&amp;#39;d rather have it work correctly.&lt;/p&gt;
&lt;p&gt;Christian&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem reconnecting after dfu on IOS</title><link>https://devzone.nordicsemi.com/thread/488307?ContentTypeID=1</link><pubDate>Tue, 11 Jun 2024 11:49:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e402ac29-6e42-490b-bb87-4b7011edebe1</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
[quote user=""]I can solve that in calling pm_local_database_has_changed() (if the peer is connected) but I am wondering if there is something that I missed in the configuration of the app or in the bootloader.[/quote]
&lt;p&gt;I think this is the way to do it. See e.g. this answer:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/42411/problems-after-dfu-on-ios/167731"&gt;RE: Problems after DFU on IOS&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>