<?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>Erasing flash when there is a BLE Connection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13237/erasing-flash-when-there-is-a-ble-connection</link><description>Hi! I&amp;#39;m running the Espruino JavaScript interpreter on a Nordic nRF51 (actually the BBC micro:bit), and I am finding it will totally reset itself when trying to erase a page of flash memory while also connected to BLE 
 BLE is enabled by default, and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Apr 2016 11:21:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13237/erasing-flash-when-there-is-a-ble-connection" /><item><title>RE: Erasing flash when there is a BLE Connection</title><link>https://devzone.nordicsemi.com/thread/50478?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 11:21:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4a2b144-c50b-4dee-87d5-f9ee2712fed1</guid><dc:creator>Gordon</dc:creator><description>&lt;p&gt;edit: solved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Erasing flash when there is a BLE Connection</title><link>https://devzone.nordicsemi.com/thread/50480?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 10:52:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8abbeacb-9e21-4e87-8c1f-61a7846e5356</guid><dc:creator>Gordon</dc:creator><description>&lt;p&gt;Perfect, thanks! That&amp;#39;ll almost certainly be the problem then - I was using &lt;code&gt;nrf_nvmc_page_erase&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Erasing flash when there is a BLE Connection</title><link>https://devzone.nordicsemi.com/thread/50479?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 10:47:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f2fe335-f122-4aa8-80b1-513cf3d7a01d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Accessing flash directly while BLE activity is not safe and might lead to flash corruptions and softdevice assertions.&lt;/p&gt;
&lt;p&gt;You can use sd_flash_page_erase API that synchronizes with softdevice and makes sure that it is not interrupted by BLE activity.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Erasing flash when there is a BLE Connection</title><link>https://devzone.nordicsemi.com/thread/50477?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 10:20:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:691c4ec1-44da-4ae7-8f46-67e25e5dfeb9</guid><dc:creator>Gordon</dc:creator><description>&lt;p&gt;Ahh, thanks! I&amp;#39;d got a &lt;code&gt;ble_app_error_handler&lt;/code&gt; but not a &lt;code&gt;app_error_fault_handler&lt;/code&gt;. Adding that definitely changes the behaviour, but it isn&amp;#39;t able to print anything - which makes me think it is being called from within an IRQ (which would be something to do with BLE, since at that point I don&amp;#39;t have any active IRQs).&lt;/p&gt;
&lt;p&gt;Any idea what could actually be causing this, or how it could be avoided? Unfortunately I don&amp;#39;t have debugging set up. Presumably the BLE stack interrupts in the middle of a flash write, and doesn&amp;#39;t like it for some reason?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Erasing flash when there is a BLE Connection</title><link>https://devzone.nordicsemi.com/thread/50476?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 08:48:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:556ad077-4509-4e4d-8320-299ea9946fdc</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Seems like there is some error returned in one of the functions in your code. You know that APP_ERROR_CHECK default behavior is that it if the condition inside it does not pass, then it will reset you chip. Try to look at &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/"&gt;this&lt;/a&gt; thread.
First try to find exact place where the system resets.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>