<?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>BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52220/ble-connection-lost-after-flash-write</link><description>Hi: 
 I use the SDK 13.0 and nRF52 DK to develop software for the project. Based on BLE UART (NUS), the software do SAADC sample and transfer the data out in real time, The ADC sampling rate is 250 Sa/s. The data is received by a nRF52 dongle board, and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Nov 2019 12:19:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52220/ble-connection-lost-after-flash-write" /><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/218810?ContentTypeID=1</link><pubDate>Wed, 06 Nov 2019 12:19:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19ff9807-2898-48fc-b416-a3b08d86b8ab</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The softdevice can buffer about 6-8packets (more or less depending on configuration), if you need larger buffer you need to handle this in the application. For instance use use an app_timer (e.g. every 10ms) that will try to offload the data by calling&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx() until&amp;nbsp;NRF_ERROR_RESOURCES&amp;nbsp;occurs.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/218547?ContentTypeID=1</link><pubDate>Tue, 05 Nov 2019 12:43:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60b5f882-47de-4275-9866-d4db8c600129</guid><dc:creator>raghuhn</dc:creator><description>&lt;p&gt;i am using ses&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210781?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 17:32:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:521fd16d-eb75-4cfb-9eea-9d1c026f1f5e</guid><dc:creator>Wei</dc:creator><description>&lt;p&gt;Hi Kenneth:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now, I try to save the ADC sampling data (250Sa/s) to the BLE chip flash memory first, and then after triggered, data is read from flash and transferred out through bluetooth. The trigger now is &amp;quot;after finishing the flash write&amp;quot;.&lt;/p&gt;
&lt;p&gt;For flash write and Read, it&amp;#39;s in a packet size of 64 samples. The problem is if I write 4 packets, and read/transfer 4 packets ( total data volume is 64*4 =256 samples), the software works fine. If I write and read/transfer more than 4 packets. the BLE software can be restarted/reset frequently. Double check the data pattern using a terminal software find, the restart/reset happens after/in the last packet write. this is because of the&amp;nbsp;APP_ERROR_CHECK(err_code).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is my application request. How can I check the&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE event? So I can transfer as many packets as possible in one time transfer? So I can read the saved data from flash memory and transfer them out in one time, like may be with the data size of 64packets * 128 bytes, or bigger.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Wei&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210780?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 17:11:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e22bda6b-5931-43c1-b5c4-04cce197ca88</guid><dc:creator>Wei</dc:creator><description>&lt;p&gt;By the way, can I change the tx buffer length ?&lt;/p&gt;
&lt;p&gt;Thx&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210779?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 17:11:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:486af19e-474f-4237-b2fe-d282ac07cae9</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I think it is easier to help you if you can describe what you want to do.&lt;/p&gt;
&lt;p&gt;Most just send notification by calling&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx() until NRF_ERROR_RESOURCES, wait for&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE&amp;nbsp;event, and then call sd_ble_gatts_hvx() until&amp;nbsp;NRF_ERROR_RESOURCES again. This can be repeated indefinitely.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Just be aware that you will get one&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE&lt;/span&gt;&lt;span&gt;&amp;nbsp;for many sd_ble_gatts_hvx() calls.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;If you want to know how many notifications that was actually sent you need to check&amp;nbsp;p_ble_evt-&amp;gt;evt.gatts_evt.params.hvn_tx_complete.count on BLE_GATTS_EVT_HVN_TX_COMPLETE event.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210776?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 16:46:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e86a4e01-da6c-4b88-bda8-8818247662d2</guid><dc:creator>Wei</dc:creator><description>&lt;p&gt;No, I did not do that.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What&amp;#39;s that, and should I do that? See some example codes, do not see they do this. Or do you more information about this?&lt;/p&gt;
&lt;p&gt;Wei&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210774?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 16:42:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:409c46e1-5f3c-4e33-aaec-337050b6841e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;It&amp;#39;s only when you receive&amp;nbsp;err_code = NRF_SUCCESS that the packet is queued to be sent as notification.&amp;nbsp;Do you take into account that when you receive the&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE event you also need to check the counter value to know how many packets were sent?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;p_ble_evt-&amp;gt;evt.gatts_evt.params.hvn_tx_complete.count&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210763?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 15:39:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dbd27042-9061-45bf-a734-2e07fd4c82ef</guid><dc:creator>Wei</dc:creator><description>&lt;p&gt;Hi Kenneth:&lt;/p&gt;
&lt;p&gt;thanks for continuously support on this topic.&lt;/p&gt;
&lt;p&gt;In my application, I need transfer out bulk data in one time. Like in the tested application,&amp;nbsp; it need transfer out 6 packets of 128 bytes in one time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tried your code, it can connect with the master without break, but it only transfer 1 packet, while lost the other 5 packets.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I happen to try this code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;									if(tx_in_progress == false)
									{	}
										tx_in_progress = true;										
										err_code = ble_nus_string_send(&amp;amp;m_nus, value, bytes_to_send);										
										if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY) &amp;amp;&amp;amp; (err_code != NRF_ERROR_RESOURCES))
										{
											APP_ERROR_CHECK(err_code);
										} 
										if (err_code != NRF_SUCCESS)
										{
												tx_in_progress = false;
										}&lt;/pre&gt;This code can transfer 4 packets, while lost the other 2 packets.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In my previous code, 4 packets is the maximum number I can get for the one time transfer.&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt;Wei&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210623?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 08:08:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7996b99-e890-4d80-921c-56160729f5e3</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I was thinking more like this, in main.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;if(tx_in_progress == false)
{
	tx_in_progress = true;
    err_code = ble_nus_string_send(&amp;amp;m_nus, value, bytes_to_send);
    
    if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY) &amp;amp;&amp;amp; (err_code != NRF_ERROR_RESOURCES))
    {
    	APP_ERROR_CHECK(err_code);
    }
    if (err_code != NRF_SUCCESS)
    {
        tx_in_progress = false;
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210537?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 19:30:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aeb354a-6c9d-4305-a3ad-f486169f78b1</guid><dc:creator>Wei</dc:creator><description>&lt;p&gt;Hi Kenneth:&lt;/p&gt;
&lt;p&gt;thanks for the reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First, I tried your code. But it still not work.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My problem is I need read from flash memory, and send the&amp;nbsp;&lt;strong&gt;&lt;/strong&gt;&lt;span&gt;large bulk data out though BLE. The packet size 64 samples, 128 bytes. As I continuously read from flash, and send out. I add the&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE to check the transfer complete, like using your code. But in my application, the&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE&amp;nbsp;event is not triggered. and the tx_in_progress is always TRUE.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What&amp;#39;s the possible reason for this? How can I debug it?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Add new code here.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;					case BLE_GATTS_EVT_HVN_TX_COMPLETE:
					tx_complete = true;
					tx_in_progress = false;
					break;
					
					
in main.c
									printf(&amp;quot;%x\r\n&amp;quot;, tx_in_progress);
								if(tx_in_progress == false)
								{
									tx_in_progress = true;
									
									err_code = ble_nus_string_send(&amp;amp;m_nus, value, bytes_to_send);
									if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY))
									{
										APP_ERROR_CHECK(err_code);
										tx_in_progress = false;
									}	
								}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210525?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 18:18:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d74d555-21e1-4762-a076-9fc8176c1c08</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I don&amp;#39;t understand the flow here and I don&amp;#39;t like infinite while loops, so maybe try something like this instead:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static volatile bool tx_in_progress;

in on_ble_evt():

case BLE_GATTS_EVT_HVN_TX_COMPLETE:
	tx_in_progress = false;

in main():

if(tx_in_progress == false)
	tx_in_progress = true
	ble_nus_string_send() 
	if error 
		tx_in_progress = false&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210454?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 14:04:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:75d18b2e-9249-467c-9641-4709a46eca93</guid><dc:creator>Wei</dc:creator><description>&lt;p&gt;Hi Kenneth:&lt;/p&gt;
&lt;p&gt;Thanks for continuously supporting on this case.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I did do some search and read many cases online for this error. I tried adding the following or similar code to my project:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In on_ble_evt(ble_evt_t * p_ble_evt)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;					case BLE_GATTS_EVT_HVN_TX_COMPLETE:
					tx_complete = true;
				//Add by Wei Lu
					break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In main.c, coding like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;						
						while(!tx_complete);
						err_code = ble_nus_string_send(&amp;amp;m_nus, value, bytes_to_send);
						if ((err_code != NRF_ERROR_INVALID_STATE)&amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY))
							{
								
								APP_ERROR_CHECK(err_code);
							}
						tx_complete = false;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Even do this way, the program still not not work. Further check shows the tx_complete not be set back to &amp;quot;True&amp;quot; after the first sending out setting to &amp;quot;False&amp;quot;.&lt;/p&gt;
&lt;p&gt;What&amp;#39;s the possible reason for this? Do I use the&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE correctly?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210310?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 08:28:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa3e3817-d814-45bd-937b-12fae5ed323c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The error code 0x13 means that&amp;nbsp;ble_nus_string_send() return NRF_ERROR_RESOURCES (see nrf_error.h). If you go into the implementation of&amp;nbsp;&lt;span&gt;ble_nus_string_send() you can find that it is the&amp;nbsp;sd_ble_gatts_hvx() call that return&amp;nbsp;this&amp;nbsp;error code, and from the documentation of the softdevice api call you can find:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; * @retval ::NRF_ERROR_RESOURCES Too many notifications queued.
 * Wait for a @ref BLE_GATTS_EVT_HVN_TX_COMPLETE event and retry.&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is a normal error code that you need to handle as described.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210242?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 22:17:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57244125-9bf8-4241-94fd-bb184d7b83fe</guid><dc:creator>Wei</dc:creator><description>&lt;p&gt;Hi Kenneth:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your kind reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I follow your instruction and set the breakpoint in the software, and find the error information, as follwoing:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568758308324v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So, the error happens in main.c, 0x04F1 (1265) line, which is the 108th line in my first attached main function code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is the error generated after BLE string sending:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;err_code = ble_nus_string_send(&amp;amp;m_nus, value, bytes_to_send);&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;And the error info shows: auto- struct&amp;lt;untagged&amp;gt;.&lt;/p&gt;
&lt;p&gt;Does this is some BLE connection error? How can this happens, and how can I fix it?&amp;nbsp; Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210217?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 18:12:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d304784-dda0-46ff-8033-4767a0a33e5e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Add DEBUG as highlighted here (I used the example project from HID keyboard in SDK13.1 here, so other settings may differ from you):&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-535005eb0caf4020bd0fe8c0a1666592/pastedimage1568743842668v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Then it should be possible to set a breakpoint in&amp;nbsp;app_error_save_and_stop().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210207?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 16:44:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2af20a64-2968-406e-b914-c0ed47f7c0d2</guid><dc:creator>Wei</dc:creator><description>&lt;p&gt;I use Keil.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210204?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 16:28:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66e565cc-3bb5-4223-8769-42f1e025d240</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Are you using&amp;nbsp;Segger Embedded Studio or Keil?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210155?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 13:48:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1b23811-134a-4504-a107-04ad88974379</guid><dc:creator>Wei</dc:creator><description>&lt;p&gt;Hi Kenneth:&lt;/p&gt;
&lt;p&gt;Thanks for prompt reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you kindly provide more information on how to catch the assert, and how to add DEBUG?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection lost after Flash write</title><link>https://devzone.nordicsemi.com/thread/210134?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 12:45:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:740e889b-3892-47b8-bca9-ca75d13d6a46</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;It sounds to me that you have an assert in your application, which will by default reset the chip to recover. However during development it is useful to catch the assert, this can be done&amp;nbsp;by define DEBUG in your project (preprocessor symbols), then you can find that in&amp;nbsp;app_error_fault_handler() the code should run&amp;nbsp;app_error_save_and_stop() instead of&amp;nbsp;NVIC_SystemReset().&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In&amp;nbsp;app_error_save_and_stop() you should be able to identify the file name, line number and error code for the assert.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>