<?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 merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart</link><description>Hello, 
 In my project i want two use two UART as off now i am using app_ble_uart example since by default 6,8 is tx and rx pins respectively. so overall application of my project is i need to receive the commands from the mobile application to device</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Apr 2022 10:32:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart" /><item><title>RE: How to merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/364427?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 10:32:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e568e54-93a8-4d4f-a9f6-18cfd593401d</guid><dc:creator>sagarnayakm</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/364426#364426"]What does this mean? Is the motor sending data?[/quote]
&lt;p&gt;No, actually over a BLE we are sending command to control the servo motor that&amp;#39;s what i am trying to explain. It&amp;#39;s ok&amp;nbsp; i will try to reduce the noise and i will update you.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/364426?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 10:28:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58753360-d8dc-46ff-888e-9d2b7cd5bd7e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Remember that I don&amp;#39;t know anything about any motor. Is the MAX232 the motor?&lt;/p&gt;
[quote user="sagarnayakm"]&lt;p&gt;couldn&amp;#39;t reduce the noise of motor like its stuck while receiving and it back to work within a nano sec.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;What does this mean? Is the motor sending data?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/364408?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 09:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:013612c7-9dce-4bc2-86c0-61f3529a7695</guid><dc:creator>sagarnayakm</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/364375#364375"]. I assume you don&amp;#39;t want to send this data to the sensor directly, so in that case, you may want to comment out this part:[/quote]
&lt;p&gt;Yes, i have&amp;nbsp; already done this and my&amp;nbsp; nus_data_handler()&amp;nbsp; look like this,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void nus_data_handler(ble_nus_evt_t * p_evt)
{    uint8_t result[120]={};
    if (p_evt-&amp;gt;type == BLE_NUS_EVT_RX_DATA)
    {
        uint32_t err_code;
       
        uint8_t *PRCS;

        NRF_LOG_DEBUG(&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++)
        {
         result[i]=p_evt-&amp;gt;params.rx_data.p_data[i];
      
        //NRF_LOG_INFO(&amp;quot;result:%s&amp;quot;,result);
        //NRF_LOG_FLUSH();
        }


        for (uint32_t i = 0; i &amp;lt; p_evt-&amp;gt;params.rx_data.length; i++)
        {
           FINAL[i]=p_evt-&amp;gt;params.rx_data.p_data[i];
        
        //NRF_LOG_INFO(&amp;quot;FINAL:%s&amp;quot;,FINAL);
        //NRF_LOG_FLUSH();
        
        }
        
       
        if((result[0]==&amp;#39;P&amp;#39;) &amp;amp;&amp;amp; (result[1]==&amp;#39;R&amp;#39;) &amp;amp;&amp;amp; (result[2]==&amp;#39;O&amp;#39;))
        {
            internal_process(result);
           
        }

         command_init(result);
        
        
      


    }

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;somehow it&amp;#39;s ok but while receiving the data from the MAX232 i couldn&amp;#39;t reduce the noise of motor like its stuck while receiving and it back to work within a nano sec.&lt;/p&gt;
&lt;p&gt;i don&amp;#39;t know how to reduce it .&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 merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/364375?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 07:31:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1623bbf-2333-47e1-9c61-cf12ce179c9c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;By default, whenever the physical UART receives any data (one byte), the function uart_event_handle() in main.c is triggered. What this does is that it checks whether:&lt;/p&gt;
&lt;p&gt;1: The buffer is full (BLE_NUS_MAX_DATA_LEN) bytes, or:&lt;/p&gt;
&lt;p&gt;2: the last received byte was either &amp;#39;\r&amp;#39; or &amp;#39;\n&amp;#39; (linefeed)&lt;/p&gt;
&lt;p&gt;If one of the two is true, then it will send that data over BLE using ble_nus_data_send(), and reset the buffer.&lt;/p&gt;
&lt;p&gt;You can keep this functionality if it suits your case. If it doesn&amp;#39;t use \r or \n, perhaps it uses some other value to indicate that the message is done.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then you have the nus_data_handler(), also in main.c, which will trigger every time the device receives a message over BLE, containing the data. This will by default take whatever payload data that is received, and send it to the physical UART&amp;#39;s TX. I assume you don&amp;#39;t want to send this data to the sensor directly, so in that case, you may want to comment out this part:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;
        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]);
                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);
        }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But that depends on what you want to do.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/364363?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 06:58:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f327d8e2-40af-4fb0-b7e6-1eb34c695dc0</guid><dc:creator>sagarnayakm</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;thanks for your reply,&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/364357#364357"]I only thought you wanted to pass the data from BLE out on a physical UART as well, since the headline for this ticket says &amp;quot;two uarts&amp;quot;.&amp;nbsp;[/quote]
&lt;p&gt;Yes, i want to send the command data from the MOBILE APP to MCU over BLE and i want to send the data from the sensor board to MCU over MAX232 with HW_UART but&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/364357#364357"]1: the physical uart has been written to, and disable the ble_nus_data_send() from this callback in order to not forward this data directly over BLE.[/quote]
&lt;p&gt;No, want to receive the data from the sensor board to MCU over MAX 232 with HW_UART here i need to send the data to BLE as well i couldn&amp;#39;t disable the function ble_nus_data_send() here . the device should receive the data and send to MOBILE_APP over BLE.&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/364357#364357"]The callback where the nRF receives data over the BLE service, and disable that the nRF will send this data over the physical UART.[/quote]
&lt;p&gt;Ah, like when device receives the data from sensor board it will send to nrf over BLE&amp;nbsp; and then again APP will send this data to HW_UART. this is what you ment.??&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 merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/364357?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 06:41:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6600a334-ba50-4f81-b0b1-11dcd0c4fba7</guid><dc:creator>Edvin</dc:creator><description>[quote user="sagarnayakm"]sending a data over BLE as well as data from the HW_UART of sensor board to MCU at a time is possible right.??&amp;nbsp;[/quote]
&lt;p&gt;Ah, yes. That is possible. And you don&amp;#39;t need two UARTs for that. I only thought you wanted to pass the data from BLE out on a physical UART as well, since the headline for this ticket says &amp;quot;two uarts&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Well, if you intend to use only one UART, that is easier. You can more or less use the ble_app_uart example directly then. Look for the callback where:&lt;/p&gt;
&lt;p&gt;1: the physical uart has been written to, and disable the ble_nus_data_send() from this callback in order to not forward this data directly over BLE.&lt;/p&gt;
&lt;p&gt;2: The callback where the nRF receives data over the BLE service, and disable that the nRF will send this data over the physical UART.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;And instead of that default behavior, you need to modify the application to do whatever you want it to do.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/364336?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2022 00:46:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73923746-c69d-4a51-9cc8-399672e4fcd9</guid><dc:creator>sagarnayakm</dc:creator><description>[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/364257#364257"]Is pin P1.04 physically connected to a UART device when the error occurs? I see that you are using baud rate 115200, but is that also the baud rate that the other device is using?[/quote]
&lt;p&gt;Yes, its connected physically, because the custom board has been developed and from the sensor board as well as MCU has the same baud rate .&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/364257#364257"]If you intend to communicate with UART to two different devices, you should use 2 UARTs. If not, then the two devices may decide to send data at the same time, and you will receive corrupted data. So unless you only intend to receive from one and transmit to the other,&amp;nbsp;&lt;strong&gt;and&lt;/strong&gt; they use the same baudrate, you should use 2x UART instances.[/quote]
&lt;p&gt;Sorry i get confused that should use 2 UART or not . because in my case i am using MCU with only one&amp;nbsp; HW_UART which is connected to sensor board physically, so BLE data send happens with Virtual UART&amp;nbsp; no need to configure UART for that, and sending a data over BLE as well as data from the HW_UART of sensor board to MCU at a time is possible right.??&amp;nbsp;&lt;/p&gt;
&lt;p&gt;i am totally new to this nordic so can you please share code that how to use two UART in app_ble_uart example.&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/364257#364257"]Ok. Just trying to find the cause for the communication error event.[/quote]
&lt;p&gt;Ok. i will try to find cause for communication error event and will let you know status.&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 merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/364257?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2022 13:28:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7111baaf-ad08-498e-9621-3d7ce4063145</guid><dc:creator>Edvin</dc:creator><description>[quote user="sagarnayakm"]however nrf52840 is having two UART&amp;#39;s right.[/quote]
&lt;p&gt;Yes. But the nRF52810 does not. That&amp;#39;s why I needed to ask when I saw that tag. But that is fine. It should work with 2x UART on the nRF52840.&lt;/p&gt;
[quote user="sagarnayakm"]I have select the baud rate as 115200 you can observe in the uart_init code snippet above . RX pins are should not floating means i need to pull up that right.??[/quote]
&lt;p&gt;Well, I believe the common method is that the other UART peripheral&amp;#39;s TX pin (which is connected to your RX pin) has the pull. Let me rephrase the question. Is pin P1.04 physically connected to a UART device when the error occurs? I see that you are using baud rate 115200, but is that also the baud rate that the other device is using?&lt;/p&gt;
[quote user="sagarnayakm"]No, i think i am not initialize two UART&amp;#39;s and i don&amp;#39;t know how to configure it that&amp;#39;s why i have raised a query for that. actually it happens only&amp;nbsp; when i am using single UART. TX=P1.3 and&amp;nbsp; RX=P1.4&amp;nbsp;[/quote]
&lt;p&gt;Ok. Just trying to find the cause for the communication error event.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="sagarnayakm"]1. Is it possible to implement with single UART or i should use 2 UART&amp;#39;s.??[/quote]
&lt;p&gt;If you intend to communicate with UART to two different devices, you should use 2 UARTs. If not, then the two devices may decide to send data at the same time, and you will receive corrupted data. So unless you only intend to receive from one and transmit to the other,&amp;nbsp;&lt;strong&gt;and&lt;/strong&gt; they use the same baudrate, you should use 2x UART instances.&lt;/p&gt;
[quote user="sagarnayakm"]2. If i can implement this with single UART means how to achieve this successfully.??[/quote]
&lt;p&gt;----&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/364053?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2022 00:35:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8055c64d-55da-47bf-9d2d-1fc13ff00a6a</guid><dc:creator>sagarnayakm</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;thanks&amp;nbsp; for your reply, and&amp;nbsp;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/363976#363976"]What chip are you using by the way? In your tags, it says nRF52810, but your screenshot says pca10056, which suggests you are using the nRF52840. The nRF52810 doesn&amp;#39;t have two UARTs, so you can&amp;#39;t really use that.[/quote]
&lt;p&gt;Yes, i am using NRF52840 only so that&amp;#39;s why i have select the pac10056 for app_ble_uart example. however nrf52840 is having two UART&amp;#39;s right.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/363976#363976"]Are you sure you have set up the UART using the correct baudrate? And that the RX pin on your UARTs are not floating?[/quote]
&lt;p&gt;I have select the baud rate as 115200 you can observe in the uart_init code snippet above . RX pins are should not floating means i need to pull up that right.??&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/87062/how-to-merge-libuarte-with-app_ble_uart-example-for-use-two-uart/363976#363976"]Does the issue only occur if you initialize both UARTs, or does it also happen if you connect only one (either UART0 or UART1. Test both one at the time).[/quote]
&lt;p&gt;No, i think i am not initialize two UART&amp;#39;s and i don&amp;#39;t know how to configure it that&amp;#39;s why i have raised a query for that. actually it happens only&amp;nbsp; when i am using single UART. TX=P1.3 and&amp;nbsp; RX=P1.4&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. Is it possible to implement with single UART or i should use 2 UART&amp;#39;s.??&lt;/p&gt;
&lt;p&gt;2. If i can implement this with single UART means how to achieve this successfully.??&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 merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/363976?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 13:54:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99c0a29d-a740-4818-8eb6-e637cfce1048</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;So you get an APP_UART_COMMUNICATION_ERROR event, and the data.error_communication = 1 (I can tell from &amp;quot;&lt;span&gt;ERROR 1 [NRF_ERROR_SVC_HANDLER_MISSING] at C:\A\DeviceDownload\...&amp;quot;), which means that you have an OVERRUN error.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What chip are you using by the way? In your tags, it says nRF52810, but your screenshot says pca10056, which suggests you are using the nRF52840. The nRF52810 doesn&amp;#39;t have two UARTs, so you can&amp;#39;t really use that.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are you sure you have set up the UART using the correct baudrate? And that the RX pin on your UARTs are not floating?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Does the issue only occur if you initialize both UARTs, or does it also happen if you connect only one (either UART0 or UART1. Test both one at the time).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BR,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/363933?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 12:47:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33340bdd-959d-4366-9eed-0c39da81c706</guid><dc:creator>sagarnayakm</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;thanks for your reply,&lt;/p&gt;
&lt;p&gt;i didn&amp;#39;t get what you said sorry for that,&lt;/p&gt;
&lt;p&gt;i will explain actually what is the application of my project and exactly what i need&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;when device power up the device connected with customized APP and it should send the command(data) over BLE at the same time the MCU is receiving the sensor data from the sensor board via RS232 or MAX232 so when MCU is receives the data from the sensor board the device is disconnected from the APP or if data not received from&amp;nbsp; the sensor board ble connected fine and based on the commands(data) it takes an action fine . so why its disconnected from the device when data received from the MAX232.??&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;that&amp;#39;s why i thought that i need two two UART&amp;#39;s is it correct or i can manage with single UART&lt;/p&gt;
&lt;p&gt;while debugging i got this after few second&amp;nbsp;&lt;/p&gt;
&lt;p&gt;info&amp;gt; app: defualt break2&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:&lt;br /&gt;K,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: opt1:0&lt;br /&gt;&amp;lt;info&amp;gt; app: defualt break2&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:&lt;br /&gt;K,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: opt1:0&lt;br /&gt;&amp;lt;info&amp;gt; app: defualt break2&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:&lt;br /&gt;K,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:OK,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:OK,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:OK,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:OK,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:OK,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:OK,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:OK,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:OK,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: data_array2:OK,0.00,0,0,110&lt;br /&gt;&amp;lt;info&amp;gt; app: iam in app uart cmn err&lt;br /&gt;&amp;lt;error&amp;gt; app: ERROR 1 [NRF_ERROR_SVC_HANDLER_MISSING] at C:\A\DeviceDownload\nRF5SDK1702d674dde\nRF5_SDK_17.0.2_d674dde\examples\&lt;br /&gt;&amp;lt;error&amp;gt; app: End of error report&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2553.Screenshot-_2800_62_2900_.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;for more information i copy the error also .&lt;/p&gt;
&lt;p&gt;here data_array2 is the data from the sensor board and which is connected to the UART P1.3(TX), UART P1.4(RX) pins of the MCU and at this time BLE is connected to my MCU device but when i am trying to send the data from the customized APP its working for few second and its stopped by displaying the above error and BLE gets disconnected after this.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;this is uart_init() for handing the sensor data over MAX232 


void uart_event_handle(app_uart_evt_t * p_event)
{
  
    static uint8_t index = 0;
    uint32_t       err_code;
   
    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;= m_ble_nus_max_data_len))
            {
                if (index &amp;gt; 1)
                {
                    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;

        case APP_UART_COMMUNICATION_ERROR:
            NRF_LOG_INFO(&amp;quot;iam in app uart cmn err&amp;quot;);
            APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication);
            break;

        case APP_UART_FIFO_ERROR:
            NRF_LOG_INFO(&amp;quot;iam in app uart fifo err&amp;quot;);
            APP_ERROR_HANDLER(p_event-&amp;gt;data.error_code);
            break;

        default:
            NRF_LOG_INFO(&amp;quot; defualt break2&amp;quot;);
            break;
    }
   
   NRF_LOG_INFO(&amp;quot;data_array2:%s&amp;quot;,data_array);
   data_init(data_array);
  
 //   memset(data_array,0,20);
 }

static void uart_init(void)
{
   
      uint32_t                     err_code;     
      app_uart_comm_params_t const comm_params =
    {
        .rx_pin_no    = RX_PIN,//(P1.4)
        .tx_pin_no    = TX_PIN,//(P1.3)
        .rts_pin_no   = RTS_PIN_NUMBER,
        .cts_pin_no   = CTS_PIN_NUMBER,
        .flow_control = APP_UART_FLOW_CONTROL_ENABLED,
        .use_parity   = false,
  #if defined (UART_PRESENT)
        .baud_rate    = NRF_UART_BAUDRATE_115200

#else
        .baud_rate    = NRF_UARTE_BAUDRATE_115200
#endif
    };

      APP_UART_FIFO_INIT(&amp;amp;comm_params,
                     UART_RX_BUF_SIZE,
                     UART_TX_BUF_SIZE,
                     uart_event_handle,
                     APP_IRQ_PRIORITY_LOWEST,
                     err_code);

  
    APP_ERROR_CHECK(err_code);
    NRF_LOG_INFO(&amp;quot;err:%d&amp;quot;,err_code);

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;this is for handling the ble_uart data 

static void nus_data_handler(ble_nus_evt_t * p_evt)
{
     uint8_t result[120]={};
    if (p_evt-&amp;gt;type == BLE_NUS_EVT_RX_DATA)
    {
        uint32_t err_code;
       
        uint8_t *PRCS;

        NRF_LOG_DEBUG(&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++)
        {
         result[i]=p_evt-&amp;gt;params.rx_data.p_data[i];
      
        NRF_LOG_INFO(&amp;quot;result:%s&amp;quot;,result);
        NRF_LOG_FLUSH();
        }


        for (uint32_t i = 0; i &amp;lt; p_evt-&amp;gt;params.rx_data.length; i++)
        {
           FINAL[i]=p_evt-&amp;gt;params.rx_data.p_data[i];
        
        NRF_LOG_INFO(&amp;quot;FINAL:%s&amp;quot;,FINAL);
        NRF_LOG_FLUSH();
        
        }
        
       
        if((result[0]==&amp;#39;P&amp;#39;) &amp;amp;&amp;amp; (result[1]==&amp;#39;R&amp;#39;) &amp;amp;&amp;amp; (result[2]==&amp;#39;O&amp;#39;))
        {
            internal_process(result);
           
        }

         command_init(result);
        
        
      


    }

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;please help me to resolve this .&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thank you&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/363916?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 12:23:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be02783a-9b59-48e3-8978-7085651ddcdf</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;The app_uart_init() doesn&amp;#39;t have a parameter for UART instance by default. It is hardcoded to use instance 0.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So if you want to use the&amp;nbsp;app_uart_init(), or the APP_UART_FIFO_INIT() for that matter, you will need to modify these functions to take an extra parameter that holds the UART instance number that you want to use. In case you want to know what UART instance that sent the message that you get in the callback, you also need to forward this information in the event somehow. The uart_event_handler() in app_uart_fifo.c doesn&amp;#39;t have that information by default, but the p_context pointer comes from&amp;nbsp;nrf_drv_uart_config_t config.p_context that is used in nrf_drv_uart_init(..., &amp;amp;config, uart_event_handler) in app_uart_fifo.c. So you can use this pointer to e.g. hold the uart instance, and forward this in the&amp;nbsp;APP_UART_DATA_READY event, by adding the a parameter with uart instance to the&amp;nbsp;app_uart_evt_t struct.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/363779?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 07:48:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69b7ef77-4cc7-44a3-891a-a441959c4f5c</guid><dc:creator>sagarnayakm</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;thanks for reply, i gone through the uart_init() present in the app_ble_uart&amp;nbsp; example and in app_uart_fifo.c&amp;nbsp; i have duplicate the app_uart_init() and how can i pass the APP_UART_DRIVER_INSTANCE 1 to this i am get confused that&amp;nbsp; how it will take the UARTE to the app_uart_init() . i hope you get my problem that i have explained from the top. in uart_init() i changed the TX,RX pins to P1.3,P1.4 so if i send the data(commands) from my customized APP to the device and its receiving properly and at the same time if i am trying to send the data from the MAX232 which is connected to the&amp;nbsp; same P1.3, P1.4 (TX,RX) of MCU so that&amp;#39;s why its going to break condition in the uart_handler so for this can we use two UART&amp;#39;s.&lt;/p&gt;
&lt;p&gt;if yes, please guide me that in app_uart_fifo.c how can add another app_uart_init() .??&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 merge libuarte with app_ble_uart  example for use two uart</title><link>https://devzone.nordicsemi.com/thread/363754?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 06:59:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bceb16bd-a919-46b7-b78f-5e7c08083798</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;While you can use the libuarte library, it is quite complex and resource demanding. I suggest that you at least consider using the nrf_drv_uart driver (which app_uart in the ble_app_uart example uses).&lt;/p&gt;
&lt;p&gt;If you look in the ble_app_uart example, and you go follow the implementation on how the uart is already set up in this example, you will find:&lt;/p&gt;
&lt;p&gt;main.c uart_init() -&amp;gt;&amp;nbsp;APP_UART_FIFO_INIT() -&amp;gt;&amp;nbsp;app_uart_init() -&amp;gt;&amp;nbsp;nrf_drv_uart_init()&lt;/p&gt;
&lt;p&gt;nrf_drv_uart_init() is the function call that takes an uart instance. By default, the app_uart_fifo.c uses&amp;nbsp;APP_UART_DRIVER_INSTANCE (which is set to 0 in sdk_config.h), so if you want to set up another UART, you can use the UART instance 1, and call nrf_drv_uart_init() using that.&lt;/p&gt;
&lt;p&gt;Whether you add a new function that looks like app_uart_init() inside app_uart_fifo.c or if you use nrf_drv_uart_init() from your main.c file is up to you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>