<?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>What is the best solution of transfer data wirelessly between two nRF51822 when using uart(115200) in both sides?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46579/what-is-the-best-solution-of-transfer-data-wirelessly-between-two-nrf51822-when-using-uart-115200-in-both-sides</link><description>Hello everybody, 
 I have two nRF51822. One of them is connected to MCU (STM32 Development Board Nucleo 32) via USART with 115200 baudrate. The other one is connected to USB TLL module via USART with 115200. I am trying to send 20 bytes from MCU to nRF51</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 May 2019 11:33:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46579/what-is-the-best-solution-of-transfer-data-wirelessly-between-two-nrf51822-when-using-uart-115200-in-both-sides" /><item><title>RE: What is the best solution of transfer data wirelessly between two nRF51822 when using uart(115200) in both sides?</title><link>https://devzone.nordicsemi.com/thread/184850?ContentTypeID=1</link><pubDate>Thu, 02 May 2019 11:33:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6c54383-d0f3-4b6f-abec-6189a817b61f</guid><dc:creator>Edvin</dc:creator><description>[quote user="msariisik"]How can I check which APP_ERROR_CHECK() causing problem without SEGGER Debugger?[/quote]
&lt;p&gt;&amp;nbsp;Do you have a debugger at all? It is kind of difficult to do developing without.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So you can monitor your log, right. Do you ever see a line with &amp;quot;fatal&amp;quot; in the log? Note that your log is on RTT, and not the UART. Please check that&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you follow the definitions from APP_ERROR_CHECK() -&amp;gt;&amp;nbsp;APP_ERROR_HANDLER().&lt;/p&gt;
&lt;p&gt;Depending on whether DEBUG is defined in the preprocessor defines or not. If it is defined:&lt;/p&gt;
&lt;p&gt;APP_ERROR_HANDLER() -&amp;gt;&amp;nbsp;app_error_handler() which is implemented in app_error.c on line 68.&lt;/p&gt;
&lt;p&gt;If you have no way of debugging, you may try to alter this function. Try something like this in your app_error_handler:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void app_error_handler(ret_code_t error_code, uint32_t line_num, const uint8_t * p_file_name)
{
    error_info_t error_info =
    {
        .line_num    = line_num,
        .p_file_name = p_file_name,
        .err_code    = error_code,
    };
    //app_error_fault_handler(NRF_FAULT_ID_SDK_ERROR, 0, (uint32_t)(&amp;amp;error_info));
    NRF_LOG_ERORR(&amp;quot;error %d at line %d, in file 0x%x&amp;quot;, error_code, line_num, p_file_name);
    NRF_LOG_FINAL_FLUSH();
    while (1)
    {
        //do nothing
    };

    UNUSED_VARIABLE(error_info);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You will not be able to find the file name without a debugger. the file. It will just point to the address of the function, but you can check the files that you suspect that the error comes from.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It is really difficult to say what the issue is if you are not able to debug in your project. Do you have any nRF51 DKs or anything else that you can use for development purposes?&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: What is the best solution of transfer data wirelessly between two nRF51822 when using uart(115200) in both sides?</title><link>https://devzone.nordicsemi.com/thread/184128?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 15:34:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0faafa78-145c-47f5-9bdf-09c6e837be29</guid><dc:creator>msariisik</dc:creator><description>[quote userid="26071" url="~/f/nordic-q-a/46579/what-is-the-best-solution-of-transfer-data-wirelessly-between-two-nrf51822-when-using-uart-115200-in-both-sides/183789"]So you never get the connected event, BLE_GAP_EVT_CONNECTED?[/quote]
&lt;p&gt;I checked the connection from peripheral side. So, when the connection established, the peripherial side sends to computer &amp;quot;connected&amp;quot;. When there is disconnection, it sends &amp;quot;disconnected&amp;quot;. However, I cannot check the connection apart from this. &lt;/p&gt;
&lt;p&gt;I am checking the advertisements with leds toggles.&amp;nbsp;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/46579/what-is-the-best-solution-of-transfer-data-wirelessly-between-two-nrf51822-when-using-uart-115200-in-both-sides/183789"]How do you determine that the connection is never established?[/quote]
&lt;p&gt;I reverted the settings to as previous explanation. The connection is established again. &lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_nus_c_evt_handler(ble_nus_c_t * p_ble_nus_c, const ble_nus_c_evt_t * p_ble_nus_evt)
{
    uint32_t err_code;
    switch (p_ble_nus_evt-&amp;gt;evt_type)
    {
        case BLE_NUS_C_EVT_DISCOVERY_COMPLETE:
            err_code = ble_nus_c_handles_assign(p_ble_nus_c, p_ble_nus_evt-&amp;gt;conn_handle, &amp;amp;p_ble_nus_evt-&amp;gt;handles);
            APP_ERROR_CHECK(err_code);

            err_code = ble_nus_c_rx_notif_enable(p_ble_nus_c);
            APP_ERROR_CHECK(err_code);
						printf(&amp;quot;c&amp;quot;);
//            printf(&amp;quot;The device has the Nordic UART Service\r\n&amp;quot;);
            break;

        case BLE_NUS_C_EVT_NUS_RX_EVT:
            for (uint32_t i = 0; i &amp;lt; p_ble_nus_evt-&amp;gt;data_len; i++)
            {
                while (app_uart_put( p_ble_nus_evt-&amp;gt;p_data[i]) != NRF_SUCCESS);
            }
            break;

        case BLE_NUS_C_EVT_DISCONNECTED:
						printf(&amp;quot;d&amp;quot;);
//            printf(&amp;quot;Disconnected\r\n&amp;quot;);
            scan_start();
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When the central side is connected, it sends &amp;quot;c&amp;quot; to MCU. Then, MCU begins to send numbers over UART.&amp;nbsp;&lt;/p&gt;
[quote userid="26071" url="~/f/nordic-q-a/46579/what-is-the-best-solution-of-transfer-data-wirelessly-between-two-nrf51822-when-using-uart-115200-in-both-sides/183789"]I guess that you get caught in an APP_ERROR_CHECK() on your peripheral, which will reset the application. Is that the case?[/quote]
&lt;p&gt;How can I check which APP_ERROR_CHECK() causing problem without SEGGER Debugger? (Now, I am trying to printf all APP_ERROR_CHECK over other UART.)&lt;br /&gt;What is the reason of resetting application? When does the nRF51822 go into reset?&lt;br /&gt;Maybe, I can use RF examples for fast data transfer.&lt;br /&gt;&amp;nbsp; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the best solution of transfer data wirelessly between two nRF51822 when using uart(115200) in both sides?</title><link>https://devzone.nordicsemi.com/thread/183789?ContentTypeID=1</link><pubDate>Thu, 25 Apr 2019 12:08:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9660a32b-2a82-4f24-bb01-da1c920fc8bc</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]When I reduce the delay, the connection is never established.[/quote]
&lt;p&gt;&amp;nbsp;So you never get the connected event, BLE_GAP_EVT_CONNECTED?&lt;/p&gt;
&lt;p&gt;If you do, do you get the&amp;nbsp;BLE_GAP_EVT_DISCONNECTED?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t get the connected event, are you sure that both of your applications are running? Maybe your peripheral is running into an app_error?&lt;/p&gt;
&lt;p&gt;How do you determine that the connection is never established?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On your central, ble_app_uart_c, do you see the advertising reports from the peripheral? Look in on_ble_evt() case BLE_GAP_EVT_ADV_REPORT.&lt;/p&gt;
&lt;p&gt;Does is_uuid_present() return true?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My suspicion is that you connect (because the timing you refer to shouldn&amp;#39;t affect the advertisements or connection procedure). I guess that you get caught in an APP_ERROR_CHECK() on your peripheral, which will reset the application. Is that the case?&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>