<?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>Read uart data while advertising beacon</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22680/read-uart-data-while-advertising-beacon</link><description>I want to use UART to read GPS data while advertising.
After I add uart function to ble_beacon_example, UART API app_uart_get() always return NRF_ERROR_NOT_FOUND.What can I do?
Board is nRF52-DK.
SDK is nRF5_SDK_11.0.0_89a8197.
This is my code main</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Jun 2017 09:52:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22680/read-uart-data-while-advertising-beacon" /><item><title>RE: Read uart data while advertising beacon</title><link>https://devzone.nordicsemi.com/thread/89156?ContentTypeID=1</link><pubDate>Mon, 19 Jun 2017 09:52:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7aa6254a-6a09-4ee0-925b-6b664c9c5078</guid><dc:creator>QK-Huang</dc:creator><description>&lt;p&gt;Sigurd,thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read uart data while advertising beacon</title><link>https://devzone.nordicsemi.com/thread/89157?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2017 14:14:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c74928c-307b-4b4a-a76b-c71035e2786d</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;The &lt;code&gt;peripheral\uart&lt;/code&gt; example is continuously calling the &lt;code&gt;app_uart_get()&lt;/code&gt; function in order to check if there have been received any data in UART FIFO. But, when you also want to do BLE advertising or connection (as done in e.g. &lt;code&gt;ble_app_uart&lt;/code&gt;), you don&amp;#39;t have time to check the FIFO all the time. You only want to call &lt;code&gt;app_uart_get()&lt;/code&gt; when you know that there is some data available. So for BLE, you want an interrupt/event(&lt;code&gt;APP_UART_DATA_READY&lt;/code&gt; ) telling you when the UART have available data in the FIFO. You should therefore use the &lt;code&gt;APP_UART_DATA_READY&lt;/code&gt; event when using BLE+UART.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read uart data while advertising beacon</title><link>https://devzone.nordicsemi.com/thread/89155?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2017 13:58:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:536030b6-64b4-417a-aad9-3bf2771e2a55</guid><dc:creator>QK-Huang</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;I had already comfirmed that the nRF52832,the GPS and the nRF52832 PIN are corrent.I don&amp;#39;t know why use UART_DATA_READY,beacuse peripheral UART example can read GPS data.
I&amp;#39;m glad U answer my question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read uart data while advertising beacon</title><link>https://devzone.nordicsemi.com/thread/89158?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2017 09:03:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b9e0f54-7ea9-47c6-a401-488e3af21eea</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;When &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Fgroup__app__uart.html&amp;amp;cp=4_0_4_6_8_25_11&amp;amp;anchor=gacddb5b7b711ef104f9eb181a13bc4503"&gt;app_uart_get&lt;/a&gt; return &lt;code&gt;NRF_ERROR_NOT_FOUND&lt;/code&gt; it means that no byte is available in the RX buffer of the app_uart module. Make sure that you are actually sending data to the nRF52832 and that both the GPS module and the nRF52832 is configured with the same settings (Baud-rate, parity, flow-control) and connected correctly(&lt;code&gt;RX_PIN_NUMBER&lt;/code&gt;/ &lt;code&gt;TX_PIN_NUMBER&lt;/code&gt;). Regarding your code you should configure the uart event handler, &lt;code&gt;uart_error_handle()&lt;/code&gt;, with the &lt;code&gt;APP_UART_DATA_READY&lt;/code&gt; event, and call the &lt;code&gt;app_uart_get()&lt;/code&gt; function every time you receive the &lt;code&gt;APP_UART_DATA_READY&lt;/code&gt; event from the uart module. Take a look at e.g. the ble_app_uart example code to see how this is done.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>