<?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>Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/99957/softdevice-is-always-busy-on-write</link><description>Hello, 
 The following description uses Client &amp;amp; Server (Edge) setup. 
 Both are based on nrf52840 
 SD Client version s140 nrf52 6.1.0 
 SD Server version s140 nrf52 6.1.1 
 
 Server side: 
 On connection request. Server sends connection parameters update</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Jun 2023 18:40:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/99957/softdevice-is-always-busy-on-write" /><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/431100?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2023 18:40:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc86e2fd-6c23-4987-895e-17c9d59cd981</guid><dc:creator>Kenneth</dc:creator><description>[quote user="RVA"]Do you think that FIRST_CONN_PARAMS_UPDATE_DELAY&amp;nbsp;is too late in order&amp;nbsp;to negotiate strait after CONNECTED event ?[/quote]
&lt;p&gt;It&amp;#39;s up to you, there are no requirements by BLE that impose any specific delays here.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/431074?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2023 15:17:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71559146-472d-4b57-b8ac-c30f30301f20</guid><dc:creator>RVA</dc:creator><description>&lt;p&gt;Hello Keneth,&lt;/p&gt;
&lt;p&gt;Eventually the solution I found is to I ignore the request of the peripheral, and managed to set the initiator&amp;nbsp; connection parameters that are OK with the power consumption requirements.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Moreover,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;FIRST_CONN_PARAMS_UPDATE_DELAY explained:&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;/*Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;means that I need to wait at least 5 seconds in order set the initiator connection parameters?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Do you think that FIRST_CONN_PARAMS_UPDATE_DELAY&amp;nbsp;is too late in order&amp;nbsp;to negotiate strait after CONNECTED event ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-RVA&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/430964?ContentTypeID=1</link><pubDate>Wed, 14 Jun 2023 10:49:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8078f12e-2934-4d0b-a9e6-138b5daa8e5e</guid><dc:creator>RVA</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately I don&amp;#39;t have currently dev kits.&lt;/p&gt;
&lt;p&gt;Regarding option 1. I will try to use&amp;nbsp;&lt;span&gt;S140 v7.3.0&amp;nbsp;in my client application and see what happens&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/428195?ContentTypeID=1</link><pubDate>Tue, 30 May 2023 13:49:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9170b08-46b8-4ace-9da9-0bab645791f4</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;We can&amp;#39;t think of any reason why this should occur. I have two suggestions moving forward:&lt;/p&gt;
&lt;p&gt;1. Try to update to S140 v7.3.0 in case this have been covered by a fix that we can&amp;#39;t understand at the moment.&lt;/p&gt;
&lt;p&gt;2. Try to provide us with two projects with can run on nRF52-DK&amp;#39;s to recreate this here.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/427935?ContentTypeID=1</link><pubDate>Sun, 28 May 2023 11:32:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcc966a3-61b1-4c70-96d6-0038caac59f8</guid><dc:creator>RVA</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I disabled the line that you mentioned on my peripheral. unfortunately nothing has changed.&lt;/p&gt;
&lt;p&gt;I think that the device is keep being busy after the first call to&amp;nbsp;ble_nus_c_tx_notif_enable(),&amp;nbsp;&lt;/p&gt;
&lt;p&gt;but in fact the write request to handle 0x13 never happen.&lt;/p&gt;
&lt;p&gt;Log:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/on_5F00_connect_5F00_evt_5F00_disabled.pcapng"&gt;devzone.nordicsemi.com/.../on_5F00_connect_5F00_evt_5F00_disabled.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;- RVA&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/427537?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 13:24:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:429485d6-71f1-4123-9208-8d79849585aa</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you have the same sdk for both projects, you may need to hack this (at least for test). But try to go inot nrf_ble_gatt.c, and in&amp;nbsp;nrf_ble_gatt_on_ble_evt() comment out the&amp;nbsp;on_connected_evt() in&amp;nbsp;BLE_GAP_EVT_CONNECTED for the peripheral project.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/1134.pastedimage1685021045297v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;See if this make a difference.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/427533?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 13:05:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cec84fc-79e3-4b09-95b8-b86dfe6ad1da</guid><dc:creator>RVA</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;On both client and peripheral gatt init sets the mtu size by&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;gatt_init&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;ret_code_t&lt;/span&gt;&lt;span&gt; err_code;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt; err_code = &lt;/span&gt;&lt;span&gt;nrf_ble_gatt_init&lt;/span&gt;&lt;span&gt;(&amp;amp;&lt;/span&gt;&lt;span&gt;m_gatt&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;gatt_evt_handler&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;APP_ERROR_CHECK&lt;/span&gt;&lt;span&gt;(err_code);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;//err_code = nrf_ble_gatt_att_mtu_periph_set(&amp;amp;m_gatt, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;//APP_ERROR_CHECK(err_code);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="text-decoration:underline;"&gt;and&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;/**@brief Function for initializing the GATT library. */&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;gatt_init&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;void&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;ret_code_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;nrf_ble_gatt_init&lt;/span&gt;&lt;span&gt;(&amp;amp;&lt;/span&gt;&lt;span&gt;m_gatt&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;gatt_evt_handler&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;APP_ERROR_CHECK&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt; = &lt;/span&gt;&lt;span&gt;nrf_ble_gatt_att_mtu_central_set&lt;/span&gt;&lt;span&gt;(&amp;amp;&lt;/span&gt;&lt;span&gt;m_gatt&lt;/span&gt;&lt;span&gt;, NRF_SDH_BLE_GATT_MAX_MTU_SIZE);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;APP_ERROR_CHECK&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;err_code&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;I don&amp;#39;t have any other place where I call&amp;nbsp;sd_ble_gattc_exchange_mtu_request().&amp;nbsp;&lt;/strong&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;As here,&lt;/p&gt;
&lt;p&gt;1. I commented&amp;nbsp;&lt;span&gt;nrf_ble_gatt_att_mtu_periph_set() call&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. Added a counter in&amp;nbsp;&amp;nbsp;&lt;/span&gt;gatt_evt_handler() to see how many times the update occurs. I found that the update happens twice after CONNECTED.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. called the conn_params_update from main after 500ms. when this counter equal to two. and the result is the same. here is the log:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/update_5F00_params_5F00_later_5F00_failes.pcapng"&gt;devzone.nordicsemi.com/.../update_5F00_params_5F00_later_5F00_failes.pcapng&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Questions:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. Does my issue related to this exchange?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. How can I control mtu exchange here?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. both client and peripheral are based on the nrf examples. no additional configuration request was added for the mtu size. where could the requests come from? maybe I miss something.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please help!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;RVA&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/427489?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 11:01:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ee2de25-fb3c-49d5-9f3b-ae28eeedb546</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1685007015712v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1685007023997v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I notice there is a lot of MTU exchances here, likely partially because it&amp;#39;s initiated by both central and client at connection event. I can see that in the failing case it seems to never end. I suggest to look into why you are seemingly calling&amp;nbsp;sd_ble_gattc_exchange_mtu_request() and&amp;nbsp;sd_ble_gatts_exchange_mtu_reply() in your application. It&amp;#39;s not unlikely this will cause your gattc write to return busy.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/427421?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 08:29:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62114fe7-ab7a-47d3-a3cb-a68fd9105ea6</guid><dc:creator>RVA</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I think this is it :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/update_5F00_params_5F00_issue_5F00_wireshark.pcapng"&gt;devzone.nordicsemi.com/.../update_5F00_params_5F00_issue_5F00_wireshark.pcapng&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/without_5F00_update_5F00_comm_5F00_ok_5F00_wireshark.pcapng"&gt;devzone.nordicsemi.com/.../without_5F00_update_5F00_comm_5F00_ok_5F00_wireshark.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;- RVA&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/427392?ContentTypeID=1</link><pubDate>Thu, 25 May 2023 07:20:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3de78b34-ed50-4d9b-8733-677c6c4dc4e5</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Good to hear that you have made the sniffer working, but I need two files saved as .pcapng format (one working and one failing). Can you do that?&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/427252?ContentTypeID=1</link><pubDate>Wed, 24 May 2023 13:23:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a4e238d-132e-4cd2-a770-7e0dbb37a57f</guid><dc:creator>RVA</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;Here&amp;nbsp;I recorded&amp;nbsp;repeated session of Wireshark sniffing output.&lt;/p&gt;
&lt;p&gt;peripheral mac:&amp;nbsp;d2:b3:0e:a4:68:f8&lt;/p&gt;
&lt;p&gt;Initiator mac:&amp;nbsp;db:c6:a2:70:72:98&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/wireshark_5F00_log_5F00_68_5F00_f8.txt"&gt;devzone.nordicsemi.com/.../wireshark_5F00_log_5F00_68_5F00_f8.txt&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please advise !&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;RVA&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/426628?ContentTypeID=1</link><pubDate>Mon, 22 May 2023 14:28:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5de99eff-8b90-491c-8a0f-97a7df27df7c</guid><dc:creator>RVA</dc:creator><description>&lt;p&gt;Hello Kenneth,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your quick response.&lt;/p&gt;
&lt;p&gt;I will try to setup the system with a sniffer and return back to you with the logs..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Softdevice is always busy on write</title><link>https://devzone.nordicsemi.com/thread/426568?ContentTypeID=1</link><pubDate>Mon, 22 May 2023 12:43:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6075423a-ae94-4a4e-a3f9-89a21ebded4c</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes, this is indeed strange.&lt;/p&gt;
&lt;p&gt;Do you by any chance have the possibility to make two on-air sniffer logs of the above? e.g. using nrf sniffer for ble, ellisys or frontline.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>