<?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>UART in nrf52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61618/uart-in-nrf52832</link><description>Hi I am using UART code from nRF5_SDK_16.0.0_98a08e2\examples\peripheral. 
 I have checked loop back with default UART pins,which are 5,6,7,8. 
 Now I want to interface some sensor (Hardwired ) with this PCA10040 DK. Hence I read on Nordic community that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 04 Jun 2020 11:10:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61618/uart-in-nrf52832" /><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/253258?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 11:10:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03ffce04-b993-4bb6-afb0-e17568338637</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Gecko,&lt;/p&gt;
[quote user="Kalpeshh42"] I am using nRF_Connect now to send the commands instead of nRF Toolbox and commands are getting sent in HEX correctly[/quote]
&lt;p&gt;&amp;nbsp;I am happy that the issue was resolved!&lt;/p&gt;
[quote user="Kalpeshh42"]I receive ack of 1 byte ,sometimes 4 bytes or&amp;nbsp; 6 bytes from sensor.[/quote]
&lt;p&gt;Is there no way for you to anticipate either the length or the contents of your sensors ACK?&lt;br /&gt;If so, I would suggest that you add an end-of-message character at the end of each ACK, and then look for that.&lt;br /&gt;Alternatively, you could start every transmission by having the first byte be the length of the incoming transmission, or something similar.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/253166?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 06:52:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51579112-9618-4a8a-8493-2fd0ee201d4e</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi will you please reply I am still waiting&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/253106?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 16:46:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30b4b06e-6659-4394-b447-64b747b80571</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;&lt;strong&gt;Karl I am using nRF_Connect now to send the commands instead of nRF Toolbox and commands are getting sent in HEX correctly&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;below is my another doubt.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now,when I am sending different commands from mobile(mobile-&amp;gt;command-&amp;gt;ble-&amp;gt;pca10040-&amp;gt;uart) I expect ack for that command from from my sensor (sensor-&amp;gt;ack-&amp;gt;uart-&amp;gt;pca10040-&amp;gt;ble-&amp;gt;mobile).&lt;/p&gt;
&lt;p&gt;I receive ack of 1 byte ,sometimes 4 bytes or&amp;nbsp; 6 bytes from sensor.&lt;/p&gt;
&lt;p&gt;Hence if I set&amp;nbsp;(index &amp;gt;= 1)) I only receive 1st byte of 4 bytes ack. or when I set&amp;nbsp;&lt;span&gt;(index &amp;gt;= 6&lt;/span&gt;&lt;span&gt;) I don&amp;#39;t receive any bytes of 4 bytes ack because I have set limit of 6.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;How can I generalize this condition so that even I get ack of 1 byte or 6 bytes or whatever size I should able to read it over mobile./&amp;nbsp; or print it on terminal&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void uart_event_handle(app_uart_evt_t * p_event)
{
    static uint8_t data_array[BLE_NUS_MAX_DATA_LEN];
    static uint8_t index = 0;
    uint32_t       err_code;
    char temp_str[40];
  
    switch (p_event-&amp;gt;evt_type)
    {
        case APP_UART_DATA_READY:
            UNUSED_VARIABLE(app_uart_get(&amp;amp;data_array[index]));
            index++;

            if ((data_array[index - 1] == &amp;#39;\n&amp;#39;) ||
                (data_array[index - 1] == &amp;#39;\r&amp;#39;) ||
                (index &amp;gt;= 6))
            {
                if (index &amp;gt; 0)       
                {

                    NRF_LOG_INFO(&amp;quot;Ready to send data over BLE NUS&amp;quot;);
//                  NRF_LOG_DEBUG(&amp;quot;Ready to send data over BLE NUS&amp;quot;);
                    NRF_LOG_HEXDUMP_DEBUG(data_array, index);

                    do
                    {
                        uint16_t length = (uint16_t)index;
                        err_code = ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length, m_conn_handle);
                        if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp;
                            (err_code != NRF_ERROR_RESOURCES) &amp;amp;&amp;amp;
                            (err_code != NRF_ERROR_NOT_FOUND))
                        {
                            APP_ERROR_CHECK(err_code);
                        }
                    } while (err_code == NRF_ERROR_RESOURCES);
                }

                index = 0;
            }
            break;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/253102?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 16:22:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48291702-aa41-416c-9c93-8604e8b21932</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;[quote user="Kalpeshh42"][/quote]&lt;/p&gt;
&lt;p&gt;thanks for your reply I found the error in hardware config params in which I had to set&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;.use_parity&amp;nbsp; &amp;nbsp;= true, &lt;/strong&gt;in the code&lt;b&gt;.&lt;/b&gt;now I am receiving data on nrf_toolbox UART mobile app.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;No problem at all. I am happy to hear that you were able to resolve the issue!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user="Kalpeshh42"][/quote]&lt;/p&gt;
&lt;p&gt;So I hard coded that value in the code as shown in my below attached code&amp;nbsp; and it worked.&lt;/p&gt;
&lt;p&gt;But I can not hard code single hex value in my code,because I need to send different(0x02,0x01,0x0405) commands.&lt;/p&gt;
&lt;p&gt;How should I modify the code to send hex command correctly from mobile ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;From your description I suspect that your conversion between different types is what is causing the issue. Especially since it works as intended when hardcoded into the app.&lt;br /&gt;If I recall correctly the NUS service sends the data as ASCII uint8_t chars. Could you ensure that what you are attempting to send to your sensor has the correct value? You could print the raw value of the data before sending it to your sensor, to verify that it is in fact 0x02.&lt;br /&gt;&lt;br /&gt;If this turns out to be the case, then you would either have to modify the commands you send from your phone accordingly, or you may define an intermediate &amp;quot;translation&amp;quot; macro for each command.&lt;br /&gt;&lt;br /&gt;Looking forward to resolving this issue together,&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/252894?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 06:45:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cb3b07a-540c-4144-829f-092e79631026</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi Karl, thanks for your reply I found the error in hardware config params in which I had to set&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;.use_parity&amp;nbsp; &amp;nbsp;= true, &lt;/strong&gt;in the code&lt;b&gt;.&lt;/b&gt;now I am receiving data on nrf_toolbox UART mobile app.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now my UART sensor is sending data continuously which I can read on mobile.If I want to stop data I should send &amp;#39;0x02&amp;#39;(HEX) from the mobile.But when I am doing this it is not getting stopped.Upon further investigation I understood my sensor is not receiving &amp;#39;0x02&amp;#39;.&lt;/p&gt;
&lt;p&gt;So I hard coded that value in the code as shown in my below attached code&amp;nbsp; and it worked.&lt;/p&gt;
&lt;p&gt;But I can not hard code single hex value in my code,because I need to send different(0x02,0x01,0x0405) commands.&lt;/p&gt;
&lt;p&gt;How should I modify the code to send hex command correctly from mobile ?&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void nus_data_handler(ble_nus_evt_t * p_evt)
{

    if (p_evt-&amp;gt;type == BLE_NUS_EVT_RX_DATA)
    {
        uint32_t err_code;

        NRF_LOG_INFO(&amp;quot;Received data from BLE NUS. Writing data on UART.&amp;quot;);
        NRF_LOG_HEXDUMP_DEBUG(p_evt-&amp;gt;params.rx_data.p_data, p_evt-&amp;gt;params.rx_data.length);
        for (uint32_t i = 0; i &amp;lt;p_evt-&amp;gt;params.rx_data.length; i++)
        {
            do
            {
                
                //err_code = app_uart_put(p_evt-&amp;gt;params.rx_data.p_data[i]);
                err_code = app_uart_put(0x02); //HARDCODED VALUE
                if ((err_code != NRF_SUCCESS) &amp;amp;&amp;amp; (err_code != NRF_ERROR_BUSY))
                {
                    NRF_LOG_ERROR(&amp;quot;Failed receiving NUS message. Error 0x%x. &amp;quot;, err_code);
                    APP_ERROR_CHECK(err_code);
                }
            } while (err_code == NRF_ERROR_BUSY);
        }
        if (p_evt-&amp;gt;params.rx_data.p_data[p_evt-&amp;gt;params.rx_data.length - 1] == &amp;#39;\r&amp;#39;)
        {
            while (app_uart_put(&amp;#39;\n&amp;#39;) == NRF_ERROR_BUSY);
        }
    }

}&lt;/pre&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/252444?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 14:06:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:921c200e-8b79-4d7e-9cbc-6b4239be481f</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Kalpeshh42"]ERROR 4 [NRF_ERROR_NO_MEM] at :0&amp;nbsp;[/quote]
&lt;p&gt;Great, that is much better.&lt;br /&gt;Which function is raising the error?&lt;br /&gt;Please see &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/60657/nrf_error_no_mem-using-ble_app_uart-example"&gt;this ticket&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote user="Kalpeshh42"]is it related to UART pins configuration for pull up ? But I’m doing that also.[/quote]
&lt;p&gt;NO_MEM is not related to UART pin configuration, at least not directly.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/252410?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 12:37:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9047196d-d938-4e58-badf-d55d787275ab</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;1. Yes I am using Nordic UART BLE&lt;/p&gt;
&lt;p&gt;2. After defining #DEBUG in app_error_weak.c it shows below error.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;ERROR 4 [NRF_ERROR_NO_MEM] at :0&amp;nbsp;&lt;/p&gt;
&lt;p&gt;PC at: 0x00000000&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;is it related to UART pins configuration for pull up ? But I&amp;rsquo;m doing that also.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/252405?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 12:22:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7635b816-1744-4fba-b867-fb7b0b5e02ea</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Kalpeshh42"]I think the solution given by your colleague is for using breakpoints.[/quote]
&lt;p&gt;The particular issue in the case was the use of breakpoints, but the issue with halting the CPU while debugging is what I wanted to highlight.&lt;br /&gt;Are you still working with the UART peripheral example, or have you now moved on to working with the Nordic UART BLE example? I assumed the latter, since you mention the transmission to/from mobile, but in your initial ticket you only mention the UART peripheral example.&lt;br /&gt;&lt;br /&gt;Have you defined DEBUG? It would be greatly beneficial to know the exact file name, line and error code.&lt;br /&gt;There are multiple tickets on Devzone discussing the possible causes for the NRF_BREAKPOINT_COND when using UART. Could you attempt to solutions from &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/57565/error-nrf_breakpoint_cond-with-example-uart_pca10056"&gt;this&lt;/a&gt;, and &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/45914/multiple-button-interrupts-nrf_breakpoint_cond"&gt;this&lt;/a&gt; ticket, and see if they resolve your problem, or at least identify the root issue?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/252391?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 11:49:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c481b97-5490-4850-8386-f1f2c679ae3a</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi Karl but I&amp;rsquo;m not using any breakpoints in my code.I think the solution given by your colleague is for using breakpoints.&lt;/p&gt;
&lt;p&gt;all I&amp;rsquo;m doing is sending data from UART and I&amp;rsquo;m getting NRF_BREAKPOINT_COND&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/252364?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 10:45:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e87121b9-110d-4ab5-b94b-907242f35d31</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Kalpeshh42"]Now I start debug button in SES. After that I am sending one byte of command from the sensor but I immediately receive&amp;nbsp;&lt;strong&gt;NRF_BREAKPOINT_COND in &lt;/strong&gt;app_error_weak.c file.[/quote]
&lt;p&gt;Have you seen&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/32973/nrf_breakpoint_cond-in-debug"&gt;this answer by my colleague&lt;/a&gt;? Debugging will cause errors when using the SoftDevice, if you have not already followed the instructions my colleague details.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/252363?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 10:39:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c56748c4-d70a-44f5-8972-e1b348d840f7</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi I am waiting for your response.Thanks in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/252336?ContentTypeID=1</link><pubDate>Fri, 29 May 2020 09:18:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e4ed20d-5ceb-42fc-b05b-252bdfe5ce2a</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Now I have connected P0.8 (RX) to TX&amp;nbsp; and P0.6 (TX) to RX of&amp;nbsp;of my hardwired sensor.&lt;/p&gt;
&lt;p&gt;Now I start debug button in SES. After that I am sending one byte of command from the sensor but I immediately receive&amp;nbsp;&lt;strong&gt;NRF_BREAKPOINT_COND in &lt;/strong&gt;app_error_weak.c file.&lt;/p&gt;
&lt;p&gt;How to solve this ? Also I am not opening COM port at the same time as suggested by you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251381?ContentTypeID=1</link><pubDate>Mon, 25 May 2020 06:28:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa67f762-8695-4959-9c77-a6e683f0dbb4</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;I understand that you are trying to do a loopback test of the two connected devices.&lt;br /&gt;Could you tell me what connections(with pin numbers) you have made to perform the loopback example?&lt;/p&gt;
[quote user="Kalpeshh42"]Now when I send &amp;quot;0x01\n&amp;quot; from mobile I am not receiving anything on the mobile.[/quote]
&lt;p&gt;Could you elaborate on what happens when you do this? What are you observing?&lt;br /&gt;Be advised that if you have the &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf52832_dk/UG/nrf52_DK/vir_com_port.html"&gt;virtual com port&lt;/a&gt; open on the peripheral device, then it will send the data there instead of looping it around using the pins.&lt;br /&gt;Could you confirm that you do not have the virtual com port open when performing your test?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251342?ContentTypeID=1</link><pubDate>Sat, 23 May 2020 13:08:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:653d757f-ffef-4ebc-b4bd-2c9845c89360</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi Karl I&amp;#39;m waiting for your reply.Thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251339?ContentTypeID=1</link><pubDate>Sat, 23 May 2020 11:37:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2278bbdc-d970-4bef-a86a-3cc1844e8cc7</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;In the ble_app_uart code I dont want to use any serial terminal to send the data to nrf_uart app.&lt;br /&gt;For this I did short rx to tx and rts to cts.Now when I send &amp;quot;0x01\n&amp;quot; from mobile I am not receiving anything on the mobile.&lt;br /&gt;What could be wrong ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251231?ContentTypeID=1</link><pubDate>Fri, 22 May 2020 10:44:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89f31d9e-0dd2-4163-a196-73b36c5385c8</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="Kalpeshh42"]Do you have any example code with data reception from uart interfaced device.[/quote]
&lt;p&gt;Both the UART example and the Nordic UART example demonstrates this.&lt;br /&gt;&lt;br /&gt;Have you seen the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/uart_example.html"&gt;UART example&lt;/a&gt;? It implements UART communication with the possibility to perform a loopback test. To have the output show in your RTT terminal you would have to add a log call that logs the received/sent data.&lt;/p&gt;
[quote user="Kalpeshh42"]Because I understand app_uart_get function is used to receive the&amp;nbsp; data from BLE where as in my case I will be receiving data from hardwired UART connections.[/quote]
&lt;p&gt;This is incorrect. The app_uart_get has nothing to do with BLE, it retrieves data from the UART RX buffer, which is what you are attempting to do.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251219?ContentTypeID=1</link><pubDate>Fri, 22 May 2020 10:24:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4104ae65-7ebb-4b32-8537-446c886cc9fc</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi Karl,I am waiting.please respond&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251207?ContentTypeID=1</link><pubDate>Fri, 22 May 2020 09:41:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:328d4e0c-71ed-40bd-a5db-40d56c74cc8c</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Okay thanks.&lt;/p&gt;
&lt;p&gt;Do you have any example code with data reception from uart interfaced device.&lt;/p&gt;
&lt;p&gt;Because I understand app_uart_get function is used to receive the&amp;nbsp; data from BLE where as in my case I will be receiving data from hardwired UART connections.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;OR maybe some example where I can do loopback and print data on debug terminal (not USB PORT)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251204?ContentTypeID=1</link><pubDate>Fri, 22 May 2020 09:21:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce51decd-8fb9-48f9-8c89-eb918449f439</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="Kalpeshh42"]I have enabled RTT backend for logger module.And I could print logs on SES Debug Terminal using &lt;strong&gt;&amp;quot;NRF_LOG_INFO&amp;quot;.&lt;/strong&gt;[/quote]
&lt;p&gt;Great, I am happy to hear that you got it working with RTT!&lt;/p&gt;
[quote user="Kalpeshh42"]So do you mean I can interface my external sensor with UART pins 5,6,7,8 without breaking those bridges and print the logs (Received UART data) on Debug Terminal ?&amp;nbsp;[/quote]
&lt;p&gt;Yes, as long as you do not open the virtual COM port, then you may use those same pins to connect to interface with another device. You may then use the logger module to see the received UART communication on your RTT viewer.&lt;br /&gt;You do not have to break any solderbridges for this to work.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251200?ContentTypeID=1</link><pubDate>Fri, 22 May 2020 09:11:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:652cc77a-6799-4952-bb70-5811d68c018c</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;I have enabled RTT backend for logger module.And I could print logs on SES Debug Terminal using &lt;strong&gt;&amp;quot;NRF_LOG_INFO&amp;quot;.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So do you mean I can interface my external sensor with UART pins 5,6,7,8 without breaking those bridges and print the logs (Received UART data) on Debug Terminal ?&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;thanks in advance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251197?ContentTypeID=1</link><pubDate>Fri, 22 May 2020 09:04:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8831346-8a6b-4e19-86ee-a60ad17b6b74</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;br /&gt;&lt;br /&gt;Sorry for my late reply - there was a national holiday in Norway yesterday.&lt;/p&gt;
[quote user="Kalpeshh42"]2.I have read in multiple nordic posts that 5,6,7,8 are connected to Interface MCU (PCA10040) hence these pins can not be used if I want to interface (Vibration sensor in my case) external hardware on UART.[/quote]
&lt;p&gt;Well, yes and no. The pins are connected to the virtual COM port, but you do not have to break the solderbridges to use them as interface to another device. If you are going to use the UART as an interface to another device, then you may not use UART as the logging backend at the same time. I would therefor suggest using the RTT backend for logging.&lt;br /&gt;As @Awneil also emphasized, you do not have to break the solderbridges to use the UART to interface another device - the GPIOs are tri-stated when nothing is connected to the virtual COM port.&lt;br /&gt;To emphasize this, if you are running your application and communicating with your other device and then decide to open Putty to have a look at what is going on, it will not work.&lt;/p&gt;
[quote user="Kalpeshh42"]3. There is no NRF_LOG_BACKEND_RTT_ENABLED in sdk_config.h. For your information I am using uart example from nRF5_SDK_16.0.0_98a08e2 and installed mesh sdk is v4.0.&amp;nbsp;[/quote]
&lt;p&gt;You would have to add this to your SDK config yourself.&lt;br /&gt;For an example on how to configure this, please see the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_nus_eval.html"&gt;ble peripheral Nordic UART example&lt;/a&gt; sdk_config.&lt;br /&gt;Once you have RTT backend enabled(and UART backend disabled), you may use the Segger debug terminal, or the J-Link RTT Viewer application to see the logs.&lt;/p&gt;
&lt;p&gt;[quote user="Kalpeshh42"][/quote]&lt;/p&gt;
&lt;p&gt;if I break those bridges, I understand I will not get any logs on COM PORT (putty) then in that case how should I debug my loopback test ?&lt;/p&gt;
&lt;p&gt;Which logs I can use to print my data on debug terminal&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is correct, but you do not have to break those bridges to use the UART to interface another device.&lt;br /&gt;You may not have any logs on your COM port either way if you intend to use the UART to interface with another device, since there is only 1 UART instance on the nRF52832 DK.&lt;br /&gt;Changing pins of the UART will not enable you to have both UART logs and UART device interface at the same time. You may however enable RTT backend for the logger module, instead of UART, which should solve your issue.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251158?ContentTypeID=1</link><pubDate>Fri, 22 May 2020 04:53:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54b6cf61-b898-43a2-80a6-1bf22e3aeff6</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi,I am waiting for your reply.thanks in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251127?ContentTypeID=1</link><pubDate>Thu, 21 May 2020 11:02:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ee35ab8-ae7f-4781-8a00-289bba7704f6</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;if I break those bridges, I understand I will not get any logs on COM PORT (putty) then in that case how should I debug my loopback test ?&lt;/p&gt;
&lt;p&gt;Which logs I can use to print my data on debug terminal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251112?ContentTypeID=1</link><pubDate>Thu, 21 May 2020 08:01:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6f16339-71b4-4b5c-afb7-8bebd036609d</guid><dc:creator>awneil</dc:creator><description>[quote userid="88876" url="~/f/nordic-q-a/61618/uart-in-nrf52832/251041"]I have read in multiple nordic posts that 5,6,7,8 are connected to Interface MCU (PCA10040) hence these pins can not be used [/quote]
&lt;p&gt;Of course they &lt;em&gt;can&lt;/em&gt; be used - but you have to bear in mind those other connections.&lt;/p&gt;
&lt;p&gt;The User Guide tells you how to break those connections:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf52832_dk/UG/nrf52_DK/solderbridge.html"&gt;https://infocenter.nordicsemi.com/topic/ug_nrf52832_dk/UG/nrf52_DK/solderbridge.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The User Guide also says:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&amp;quot;The UART signals are routed directly to the interface MCU. &lt;strong&gt;The UART pins connected to the interface MCU are tri-stated when no terminal is connected to the virtual COM port on the computer&lt;/strong&gt;.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;(my emphasis)&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf52832_dk/UG/nrf52_DK/vir_com_port.html"&gt;https://infocenter.nordicsemi.com/topic/ug_nrf52832_dk/UG/nrf52_DK/vir_com_port.html&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART in nrf52832</title><link>https://devzone.nordicsemi.com/thread/251109?ContentTypeID=1</link><pubDate>Thu, 21 May 2020 07:30:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7fb11221-697d-4849-98e5-1d76f9ab5bd1</guid><dc:creator>Gecko</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;I am waiting for your reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>