<?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>Issue about BLE_APP_UART and APP_TIMER</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62679/issue-about-ble_app_uart-and-app_timer</link><description>The SDK version is 16.0.0. I am using NRF 52840 DK and testing the BLE data transmission with the example project BLE_APP_UART. I am using NRF Connect Desktop to communicate with the NRF52840 DK. The example is working well. 
 So I started modifying the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 28 Jun 2020 21:38:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62679/issue-about-ble_app_uart-and-app_timer" /><item><title>RE: Issue about BLE_APP_UART and APP_TIMER</title><link>https://devzone.nordicsemi.com/thread/257254?ContentTypeID=1</link><pubDate>Sun, 28 Jun 2020 21:38:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e104edf7-eec1-4be6-87c7-c0fdac523363</guid><dc:creator>davidz</dc:creator><description>&lt;p&gt;Thank you Sigurd. I have solved the problem by moving the sensor data transmit to the main loop. It seems that the APP_timer interrupt does not work well with my sensor, which uses SPI bus to interface with the nrf52840.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue about BLE_APP_UART and APP_TIMER</title><link>https://devzone.nordicsemi.com/thread/257175?ContentTypeID=1</link><pubDate>Fri, 26 Jun 2020 14:32:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f40e3f9-fd8b-4213-992c-a17a78c0cd41</guid><dc:creator>Sigurd</dc:creator><description>[quote user="davidz"]ERROR 13313 [/quote]
&lt;p&gt;&amp;nbsp;13313 is the same as BLE_ERROR_GATTS_SYS_ATTR_MISSING. You can read about this error code e.g. in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/61014/getting-a-0x3401-ble_error_gatts_sys_attr_missing-from-sd_ble_gatts_hvx"&gt;this post&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue about BLE_APP_UART and APP_TIMER</title><link>https://devzone.nordicsemi.com/thread/255855?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 21:15:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90b76cf2-c66e-4622-84ac-83f5a2c6785e</guid><dc:creator>davidz</dc:creator><description>&lt;p&gt;Thanks. Here is the output &amp;quot;&amp;lt;error&amp;gt; app: ERROR 13313 [Unknown error code] at D:\nrf5sdk1600\workspace\test0\ble_app_uart\main.c:126&lt;br /&gt;PC at: 0x0002FB77&amp;quot;.&amp;nbsp; It happened at the sensor_meas_timeout_handler(). Line 126 is where the program stopped. I actually used &amp;quot;&lt;span&gt;NRF_LOG_INFO(&amp;quot;Error code is %d\r\n&amp;quot;,err_code);&amp;quot; to find out the error code before. I have a question: does&amp;nbsp;ble_nus_data_send() function need to wait for something else after the BLE connection is re-established? It looks like the&amp;nbsp;ble_nus_data_send() function caused the problem after the re-connection.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;static void sensor_meas_timeout_handler(void * p_context)&lt;br /&gt;{&lt;br /&gt; UNUSED_PARAMETER(p_context);&lt;br /&gt; &lt;br /&gt; static uint8_t data_array[BLE_NUS_MAX_DATA_LEN];&lt;br /&gt; uint32_t err_code;&lt;br /&gt; uint16_t length = 4;&lt;br /&gt; static int i=0;&lt;br /&gt; if(m_conn_handle!=BLE_CONN_HANDLE_INVALID)&lt;br /&gt; {&lt;br /&gt; i++;&lt;br /&gt; data_array[0]=i;&lt;br /&gt; data_array[1]=i+1;&lt;br /&gt; data_array[2]=i+2;&lt;br /&gt; data_array[3]=i+3;&lt;br /&gt; err_code = ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length, m_conn_handle);&lt;br /&gt; if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;&lt;br /&gt; (err_code != NRF_ERROR_RESOURCES) &amp;amp;&amp;amp;&lt;br /&gt; (err_code != NRF_ERROR_NOT_FOUND))&lt;br /&gt; {&lt;br /&gt; APP_ERROR_CHECK(err_code);&amp;nbsp; &amp;nbsp; // Line 126&lt;br /&gt; // NRF_LOG_INFO(&amp;quot;Error code is %d\r\n&amp;quot;,err_code);&lt;br /&gt; }&lt;br /&gt; else NRF_LOG_INFO(&amp;quot;Sending out data %dth time. connection handle %d\r\n&amp;quot;,i,m_conn_handle);&lt;br /&gt; &lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue about BLE_APP_UART and APP_TIMER</title><link>https://devzone.nordicsemi.com/thread/255802?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 13:39:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:80cec6d0-2c1f-43db-a11e-4ffd16e9fdc2</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Try to set your project to Debug configuration, if you are using SES, you can do it like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-6e7c3c9142e24f36bf768a09ba195fb6/pastedimage1592487235806v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;In sdk_config.h, make sure that these defines&amp;nbsp;have these values:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0
NRF_LOG_BACKEND_RTT_ENABLED 1
NRF_LOG_ENABLED 1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In app_error_weak.c,&lt;/p&gt;
&lt;p&gt;add NRF_LOG_FLUSH(); above&amp;nbsp;NRF_BREAKPOINT_COND;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-6e7c3c9142e24f36bf768a09ba195fb6/pastedimage1592487502265v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The error-code, filename and line-number should then be printed in the SES Debug Terminal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue about BLE_APP_UART and APP_TIMER</title><link>https://devzone.nordicsemi.com/thread/255653?ContentTypeID=1</link><pubDate>Thu, 18 Jun 2020 03:42:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3715abf9-6502-4f68-bcb6-68d6b258838b</guid><dc:creator>davidz</dc:creator><description>&lt;p&gt;The NRF Connect desktop shows the error &amp;quot;&lt;span&gt;Disconnected from device E4:A6:2D:DE:55:B3, reason: BLE_HCI_CONNECTION_TIMEOUT&amp;quot;.&amp;nbsp; The nRF52840 DK shows the error &amp;quot;void app_error_fault_handler(unsigned int id=0x00004001, unsigned int pc=0x0002fb6b, unsinged int info=0x200:0x00028D30&amp;quot;, and &amp;quot;void app_error_handler(unsigned int error_code=0x00000000, unsigned int line_num=0x20002bec, const unint8_t*|0x00028BFA&amp;quot;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue about BLE_APP_UART and APP_TIMER</title><link>https://devzone.nordicsemi.com/thread/255591?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 15:00:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:469815a7-51f8-439c-ac41-4bfe89b4674b</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote userid="91194" url="~/f/nordic-q-a/62679/issue-about-ble_app_uart-and-app_timer"]After the NRF connect desktop disconnects and reconnects, it connects for a brief time and then disconnects. The NRF52840 DK runs into error. [/quote]
&lt;p&gt;What disconnect reason did you get?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What error did you run into on the nRF52840 DK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>