<?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>How to solve error code 0x3401?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71048/how-to-solve-error-code-0x3401</link><description>Hi I&amp;#39;m using nrf52 with softdevice s132, 
 
 The problem is when I connect nrf52 with my smartphone, the error code 0x3401 occurss after connecting exactly 147~150 second. 
 
 How can I solve this problem? 
 
 Thanks.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 09 Feb 2021 07:58:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71048/how-to-solve-error-code-0x3401" /><item><title>RE: How to solve error code 0x3401?</title><link>https://devzone.nordicsemi.com/thread/293475?ContentTypeID=1</link><pubDate>Tue, 09 Feb 2021 07:58:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d612499-4ff1-46b9-8a7b-aeb93ec67108</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Disconnect reason 22 (0x16)&amp;nbsp;means&amp;nbsp;&lt;a title="BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s340.api.v6.1.1/group___b_l_e___h_c_i___s_t_a_t_u_s___c_o_d_e_s.html?cp=3_5_7_0_2_1_0_9#ga0b7bcbe31925c6d2c305ba4f0ff9889b"&gt;BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION&lt;/a&gt;.&amp;nbsp;You can get also get&amp;nbsp;BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION as the disconnect reason if a procedure timed out. For instance connection parameter update initiated by the slave, or other L2CAP procedure timeout or ATT related.&amp;nbsp;It is difficult to say without knowing more. Some questions:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;Can you also add the debug log here by adding DEBUG to your preprocessor definitions and provide the debug log from the device?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Is it possible for you to&lt;/span&gt;&amp;nbsp;share a &lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html"&gt;sniffer &lt;/a&gt;trace showing this issue?&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Which SoftDevice version are you using?&lt;/li&gt;
&lt;li&gt;What is the OS of your&amp;nbsp;&lt;span&gt;smartphone? Are you able to provide the log from nRF Connect?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to solve error code 0x3401?</title><link>https://devzone.nordicsemi.com/thread/293278?ContentTypeID=1</link><pubDate>Mon, 08 Feb 2021 10:10:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0489ca1-3966-49db-bb69-f5ff29f69930</guid><dc:creator>ENENER</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There are reason 22.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to solve error code 0x3401?</title><link>https://devzone.nordicsemi.com/thread/293042?ContentTypeID=1</link><pubDate>Fri, 05 Feb 2021 09:01:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33944d3c-8356-46d3-b3bf-7ef3808bdd83</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you provide the log for the disconnect reason in the BLE_GAP_EVT_DISCONNECTED event by reading the p_ble_evt-&amp;gt;evt.gap_evt.disconnected.reason as&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;        case BLE_GAP_EVT_DISCONNECTED:
            NRF_LOG_INFO(&amp;quot;Disconnected, reason %d.&amp;quot;,
                          p_ble_evt-&amp;gt;evt.gap_evt.params.disconnected.reason);
            m_conn_handle = BLE_CONN_HANDLE_INVALID;
            break;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to solve error code 0x3401?</title><link>https://devzone.nordicsemi.com/thread/292648?ContentTypeID=1</link><pubDate>Wed, 03 Feb 2021 11:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:195d1e78-f35f-46b8-8b56-46baec75942d</guid><dc:creator>ENENER</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tried the way.&lt;/p&gt;
&lt;p&gt;The error code 0x3401 is gone.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But, I still get same problem.&lt;/p&gt;
&lt;p&gt;When I connect nrf52 exactly 2m 30s, the connection end.&lt;/p&gt;
&lt;p&gt;How can I solve this?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to solve error code 0x3401?</title><link>https://devzone.nordicsemi.com/thread/292474?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 12:53:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2fc9a64-8336-47c2-8a20-b8929e86b640</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50227/ble-uart-issue/200615#200615"&gt;this&lt;/a&gt;&lt;span&gt;&amp;nbsp;post provided a viable solution, as long as you are happy with the&amp;nbsp;ble_nus_data_send() call failing silently and you set the system attributes later. The key is that this will fail until the system attributes is set, and you can handle it in several different ways.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to solve error code 0x3401?</title><link>https://devzone.nordicsemi.com/thread/292448?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 11:19:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73134c42-8e7d-45cc-89d5-595f066c4b6e</guid><dc:creator>ENENER</dc:creator><description>&lt;p&gt;Hi, I&amp;#39;m using v17.0.0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And error is in the picture.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/2048x2048/__key/communityserver-discussions-components-files/4/pastedimage1612264610107v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;I read your answer. But, I already had this code&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;case BLE_GATTS_EVT_SYS_ATTR_MISSING:
    err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0);
    APP_ERROR_CHECK(err_code);
    break;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;in&amp;nbsp;ble_evt_handler function.&lt;/p&gt;
&lt;p&gt;And, the problem still alive.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to solve error code 0x3401?</title><link>https://devzone.nordicsemi.com/thread/291974?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2021 11:47:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6476f885-c951-4954-8449-4e78b75c098a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Which version of s132 or SDK you are using?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Which function returns the error code? Is it&amp;nbsp;&lt;/span&gt;sd_ble_gatts_hvx()? If so,&amp;nbsp;&lt;span&gt;Ole Morten gives a very informative answer to this in this thread:&amp;nbsp;&lt;/span&gt;&lt;a href="https://devzone.nordicsemi.com/question/6085/strange-error-code-13313-0x3401-returned-by-sd_ble_gatts_hvx/"&gt;strange error code 13313 (0x3401) returned by sd_ble_gatts_hvx()&lt;/a&gt;&lt;span&gt;.&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50124/problem-with-hvx-behavior/200037#200037"&gt;Here&lt;/a&gt;&lt;/span&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/50124/problem-with-hvx-behavior/200037#200037"&gt;&amp;nbsp;&lt;/a&gt;is a similar question.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda H.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>