<?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>BLE Uart example hangs</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10631/ble-uart-example-hangs</link><description>Hi, 
 I tried the BLE Uart example on my own nRF51 board, but after a few minutes the application hangs in the softdevice. 
 The board is one we developed, an FTDI cable connects the uart (incl. RTS/CTS) to a PC and an RGB LED is used to monitor the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 Mar 2018 13:46:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10631/ble-uart-example-hangs" /><item><title>RE: BLE Uart example hangs</title><link>https://devzone.nordicsemi.com/thread/124602?ContentTypeID=1</link><pubDate>Thu, 15 Mar 2018 13:46:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff301c19-4903-4bce-9278-a5a704beb7dd</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;The&amp;nbsp;BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED define is not meant to be changed. It is defined in ble_gap.h:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED  0 /**&amp;lt; Unlimited advertising in general discoverable mode. */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;nbsp;don&amp;#39;t want your advertiser to time out you set the advertising timeout to zero.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Uart example hangs</title><link>https://devzone.nordicsemi.com/thread/124542?ContentTypeID=1</link><pubDate>Thu, 15 Mar 2018 10:00:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2874cff7-1213-4c44-8694-64595d3be27d</guid><dc:creator>pktron</dc:creator><description>&lt;p&gt;But where to change&amp;nbsp;&lt;span&gt;BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED&amp;nbsp;?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Uart example hangs</title><link>https://devzone.nordicsemi.com/thread/39663?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 13:31:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01387d63-69ac-4883-8c70-1b89e92f04c4</guid><dc:creator>Primož Kralj</dc:creator><description>&lt;p&gt;I am no expert, but isn&amp;#39;t 180s the default advertisement timeout for the example? After that nRF51 goes to deep sleep and starts advertising again when you wake it up (on the DevKit one button is assigned as WAKEUP). Without this timeout the battery would drain fairly quickly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Uart example hangs</title><link>https://devzone.nordicsemi.com/thread/39662?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 13:21:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8be88bf5-e087-4846-abd4-b31a234a8b9d</guid><dc:creator>Rob Jansen</dc:creator><description>&lt;p&gt;I&amp;#39;m pretty sure I found the answer on this.&lt;/p&gt;
&lt;p&gt;In on_ble_evt() I found a switch with the following case:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; case BLE_GAP_EVT_TIMEOUT:
        if (p_ble_evt-&amp;gt;evt.gap_evt.params.timeout.src  == BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT)
        { 
            nrf_gpio_pin_clear(ADVERTISING_LED_PIN_NO);

            // Configure buttons with sense level low as wakeup source.
            nrf_gpio_cfg_sense_input(WAKEUP_BUTTON_PIN,
                                     BUTTON_PULL,
                                     NRF_GPIO_PIN_SENSE_LOW);
            
            // Go to system-off mode (this function will not return; wakeup will cause a reset)
            err_code = sd_power_system_off();    
            APP_ERROR_CHECK(err_code);
        }
        break;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and the timeout is set to 180s, which is indeed the time at which the application hangs and waits for the button to be pushed.
Setting this timeout to BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED fixes my problem. The application now runs forever.&lt;/p&gt;
&lt;p&gt;I found it a bit strange to set this 180s timeout in this type of a demo application but for low energy purposes it kind of does make sense.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>