<?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&amp;#39;s the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3640/what-s-the-meaning-of-error-no-nrf_error_busy</link><description>When I use sd_ble_gap_adv_start( ), sometimes get return value NRF_ERROR_BUSY .
What&amp;#39;s the meaning of this error No. ?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Aug 2014 09:39:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3640/what-s-the-meaning-of-error-no-nrf_error_busy" /><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13210?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 09:39:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b0bb33b-2d6f-4d0f-81db-aa0fb0ab52e1</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;It gives you an error when you call sd_ble_gap_adv_start() in button handler? Or when you call sd_ble_gap_adv_stop()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13209?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 09:09:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec2f1320-52fd-4126-b3cb-49281819c754</guid><dc:creator>Ricky</dc:creator><description>&lt;p&gt;thank you! I add softdevice_ble_evt_handler_set() in my code, and never set advertising_state = true, then the board never reboot.In another words, this code do nothing but the board works good. but if I set advertising_state = true when advertise start, the board will die as before...so puzzing...I will try to find why&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13208?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 06:05:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58f0305b-8291-42b4-bec8-db9882241168</guid><dc:creator>Ricky</dc:creator><description>&lt;p&gt;thank you, let me try your framework&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13207?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 05:57:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee8eac38-8b12-4d7c-80ef-2c51d48ae764</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;I don&amp;#39;t know, what are you doing wrong, but this works for me without any error:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static bool advertising_state = false;

static void on_ble_evt(ble_evt_t * p_ble_evt)
{
    uint32_t        err_code;
    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            advertising_state = false;
...
        case BLE_GAP_EVT_TIMEOUT:
            if (p_ble_evt-&amp;gt;evt.gap_evt.params.timeout.src == BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT)
            {
                led_off(ADVERTISING_LED_PIN_NO);
                advertising_state = false;
            }
            break;
...
}

static void advertising_start(void)
{

    uint32_t             err_code;
    ble_gap_adv_params_t adv_params;
    ble_gap_whitelist_t  whitelist;
    uint32_t             count;
    
    advertising_state = true;
    led_off(ADVERTISING_LED_PIN_NO);
...
    adv_params.timeout  = 1;
...
    err_code = sd_ble_gap_adv_start(&amp;amp;adv_params);
    APP_ERROR_CHECK(err_code);
    
    led_on(ADVERTISING_LED_PIN_NO);
}

static void button_event_handler(uint8_t pin_no, uint8_t button_action)
{
    if (button_action == APP_BUTTON_PUSH)
    {
        switch (pin_no)
        {
            case KEY_PRESS_BUTTON_PIN_NO:
            {
                uint32_t err_code;
                if (advertising_state == true)
                {
                    err_code = sd_ble_gap_adv_stop();
                    APP_ERROR_CHECK(err_code);
                }
                advertising_start();
                break;
            }
            default:
                APP_ERROR_HANDLER(pin_no);
                break;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13206?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 05:34:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22e0b82a-fd80-4d36-afe4-4da79f7e6c38</guid><dc:creator>Ricky</dc:creator><description>&lt;p&gt;it is after 1s;
if i press the button quickly, no error get.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13205?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 05:25:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:febd68e0-b70e-4025-a5cd-d0506da90bb4</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;So in what situation do you get NRF_ERROR_BUSY? Only when you press on button while advertising? Or around 1s advertising timeout? Or after 1s advertising timeout? Or at random?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13204?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 01:52:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3032cfa1-00ed-44a3-82b5-476e196d516f</guid><dc:creator>Ricky</dc:creator><description>&lt;p&gt;I tried, but can&amp;#39;t solve the problem...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13203?ContentTypeID=1</link><pubDate>Wed, 27 Aug 2014 13:16:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:916e24bd-fc79-43b2-ab5c-8f40b20c98bb</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;In what case are you getting NRF_ERROR_BUSY? Completely at random or when button is pressed around 1s advertising timeout? My only assumption is that when you pressing on button in that moment previous advertising is timed out and stopped (or stopping) and softdevice generate BLE_GAP_EVT_TIMEOUT event (BLE_GAP_TIMEOUT_SRC_ADVERTISEMENT), but it&amp;#39;s pending and this pending event block your sd_ble_gap_adv_start() call. If you are using scheduler, then try to do this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (sd_ble_gap_adv_start() == NRF_ERROR_BUSY)
{
    app_sched_execute();
    sd_ble_gap_adv_start();
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13202?ContentTypeID=1</link><pubDate>Wed, 27 Aug 2014 10:32:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5595936-1d16-46b3-a1e0-0cf1b23904d8</guid><dc:creator>Ricky</dc:creator><description>&lt;p&gt;If I don&amp;#39;t call sd_ble_gap_adv_stop() before sd_ble_gap_adv_start(), the error_code become  NRF_ERROR_INVALID_STATE&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13201?ContentTypeID=1</link><pubDate>Wed, 27 Aug 2014 10:27:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00172a6e-be5d-4953-a4cc-93093665df13</guid><dc:creator>Ricky</dc:creator><description>&lt;p&gt;I want to advertising after pushed a button, and only advertising 1 second.
and I call  sd_ble_gap_adv_stop() before sd_ble_gap_adv_start().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13200?ContentTypeID=1</link><pubDate>Wed, 27 Aug 2014 10:22:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:303da808-44b0-46bd-8e97-c303d179155d</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;What are you trying to do? Why are you calling sd_ble_gap_adv_stop() and where? Where are you calling sd_ble_gap_adv_start()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13199?ContentTypeID=1</link><pubDate>Wed, 27 Aug 2014 10:19:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6a87b68-74ea-4d98-ac18-a62f6f9ebb82</guid><dc:creator>Ricky</dc:creator><description>&lt;p&gt;Yes, but I call sd_ble_gap_adv_stop() before call  sd_ble_gap_adv_start() again. Is there any problem?
PS: I set m_adv_params.timeout = 1; so that the advertising should stopped after 1 second advertising, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: what's the meaning of error no. NRF_ERROR_BUSY</title><link>https://devzone.nordicsemi.com/thread/13198?ContentTypeID=1</link><pubDate>Wed, 27 Aug 2014 10:12:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ef72295-f791-4da3-93fc-fd69c6fa6f79</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Maybe you trying to call sd_ble_gap_adv_start() when you already advertising and get this error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>