<?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>nRF51422 save to flash when Bluetooth ON</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64885/nrf51422-save-to-flash-when-bluetooth-on</link><description>Hi, 
 
 I keep looking at different posts and I struggle to understand. 
 Is it possible to save to flash (nvm) on a nRF51422 with s130 while the Bluetooth is ON and connected to the phone? 
 In our case, if we save to nvm while connected to Bluetooth</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Aug 2020 10:48:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64885/nrf51422-save-to-flash-when-bluetooth-on" /><item><title>RE: nRF51422 save to flash when Bluetooth ON</title><link>https://devzone.nordicsemi.com/thread/265060?ContentTypeID=1</link><pubDate>Tue, 18 Aug 2020 10:48:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99a7ebbf-b9a0-4413-8ea5-47bd418be764</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]Is it possible to save to flash (nvm) on a&amp;nbsp;nRF51422 with s130 while the Bluetooth is ON and connected to the phone?[/quote]
&lt;p&gt;Yes, that is possible. But it may depend on the connection parameters, as flash writes take some time and the SoftDevice needs to be able to schedule the flash writes without causing the connection to drop.&lt;/p&gt;
[quote user=""]In our case, if we save to nvm while connected to Bluetooth, it seems that the devices restarts and this doesn&amp;#39;t happen always... which was very difficult for us to identify the issue.[/quote]
&lt;p&gt;Even if you are not able to schedule a flash write this should not cause the device to reset by itself. I wonder if this causes problems with your application logic, and causes an error handler to reset the device? Have you added some logging or done something else to see exactly what causes your device to be reset?&lt;/p&gt;
[quote user=""]It is possible,&amp;nbsp;can some kindly share some pieces of code?[/quote]
&lt;p&gt;You can refer to any Bluetooth example that uses bonding to see an example of writing to flash, as the peer manager writes to flash (via FDS) (it could also be a similar older library, depending on which SDK version you are using).&lt;/p&gt;
&lt;p&gt;Can you elaborate on how you try to write to flash?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>