<?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>Knowing NVMC operation is finished inside BLE event</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24755/knowing-nvmc-operation-is-finished-inside-ble-event</link><description>(nRF51822, but also concerned with nRF52832, SD130, SDK 12.1) 
 I&amp;#39;m trying to write/erase flash from a bluetooth event handler. As it&amp;#39;s been outlined in other questions, while being in the event handler, other events aren&amp;#39;t fired (like NRF_EVT_FLASH_OPERATION_SUCCESS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Aug 2017 18:44:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24755/knowing-nvmc-operation-is-finished-inside-ble-event" /><item><title>RE: Knowing NVMC operation is finished inside BLE event</title><link>https://devzone.nordicsemi.com/thread/97497?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 18:44:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf917ae3-673d-4fa5-9d83-91505e935a41</guid><dc:creator>Jonathan</dc:creator><description>&lt;p&gt;Thanks! I will investigate that lead!
I know ideally it should be out of the event handler, however that makes the complete code considerably more complex, splitting everything into a lot of callbacks. Down the road I&amp;#39;ll probably resort to it but if in the the meantime I can avoid it, I will...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Knowing NVMC operation is finished inside BLE event</title><link>https://devzone.nordicsemi.com/thread/97498?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 18:08:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d8a9d2f-6c0f-4925-81e2-78ecb0a631e5</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Jonathan,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think it&amp;#39;s a good solution. The reason &lt;code&gt;NRF_NVMC-&amp;gt;READY is set to 1 very quickly&lt;/code&gt; is that the flash operation may not have started when you check that yet. The softdevice schedules the flash operation, it may delay the operation until the BLE event is finished for example. What you should do is to move your operation out of the event handler and wait for NRF_EVT_FLASH_OPERATION_SUCCESS in main context.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>