<?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>Hung up on advertising</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8355/hung-up-on-advertising</link><description>I&amp;#39;m migrating an old (but working) app from the S110 5.2.1 (SDK 4.X) to the latest SDK9/S110 8.0. I&amp;#39;ve read the migration doc, and I&amp;#39;m following the examples carefully (specifically app_hids_keyboard, app_uart, and app_hrs). All my init functions are</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 Aug 2015 07:49:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8355/hung-up-on-advertising" /><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30306?ContentTypeID=1</link><pubDate>Tue, 04 Aug 2015 07:49:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:794ac974-8df9-482a-ac41-5433d0205517</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Great! Could you maybe add an answer describing how you got it working?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30305?ContentTypeID=1</link><pubDate>Mon, 03 Aug 2015 18:19:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c140cb40-6bd3-4998-963d-9c3c94f85d72</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;Just FYI, I finally got it working with SDK 8.1 / SD 7.30. If I discover anything more, I&amp;#39;ll let you know.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30304?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 21:14:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:009ad431-ff88-4358-8626-84f27892ab52</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;If you don&amp;#39;t have a 32 kHz crystal you can&amp;#39;t use NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, you need to tell the SoftDevice to use the 250 ppm RC oscillator.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30303?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 16:16:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74173a38-883e-4c64-a168-1f8024d5fbc9</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;Thanks. The crystal on the board is a 16MHz NX2520SA. I&amp;#39;ll try moving back one SD level to see if that changes anything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30302?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2015 08:01:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31da5f3c-7877-42a2-9647-d583e6211b66</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;You can find CEAA in the Packet/Variant column in Table 2. You have a revision 2 WLCSP. By looking at Table 4 you can see that it is compatible with SoftDevice S110 8.0.0, if you enable mutual exclusion. The release notes are included in the zip together with the S110 hex file. SDKs after 6.1.0 haven&amp;#39;t been tested on revision 2 chips, but this doesn&amp;#39;t mean that it doesn&amp;#39;t work, just that it is not testet. SDK 9.0.0 should be added to the matrix, I agree. It is not too new and buggy, most of what is included is the same as in SDK 8.0.0, with some added bugfixes/examples/libraries. Do you have an external 32 kHz crystal on your board? Since you initializing with the SoftDevice NRF_CLOCK_LFCLKSRC_XTAL_20_PPM?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30301?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2015 20:52:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e9e205f-33b7-47e3-9498-412c83d8385e</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;Our BOM says &amp;quot;NRF51822-CEAA-R&amp;quot; Don&amp;#39;t know how that translates into your &amp;quot;rev number&amp;quot;. The compatibility matrix seems out of date--has no SDK 9 in it at all. Perhaps it&amp;#39;s just too knew and buggy, and I should try downgrading a bit rather than trying the bleeding edge. The above code made no difference in my device. Also, I can find SD 8.0.0 docs and specification but not the &amp;quot;release notes&amp;quot; you speak of.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30300?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2015 09:17:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77e0eb66-95c7-45ff-ab7a-598e51878c34</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;If you use SoftDevice S110 8.0.0 with a revision 2 chip you should enable mutual exclusion between the radio and the application. Please see the Changes section in the S110 8.0.0 release notes for more information.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t opt_id = BLE_COMMON_OPT_RADIO_CPU_MUTEX;
ble_opt_t cpu_blocking_enabled;
cpu_blocking_enabled.common_opt.radio_cpu_mutex.enable = 1;
ble_stack_init();
err_code = sd_ble_opt_set(opt_id, &amp;amp;cpu_blocking_enabled);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30299?ContentTypeID=1</link><pubDate>Thu, 30 Jul 2015 09:17:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb9dfa82-cc1a-42c9-be8a-838212392155</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry, I just assumed you had testet the unmodified example first. Are you using a custom board or PCA10001? Either way it depends on what chip revision of the nRF51 you have on them. You need to compare the device markings of your chip/chips with Table 1 or Table 2 in the &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF51822#Downloads"&gt;nRF51 Series Compatibility Matrix&lt;/a&gt; to figure out what revision you have. Then you check Table 4 to see what SoftDevices and SDKs that are compatible with your chips. I just tested SoftDevice s110 8.0.0 with an unmodified ble_app_hids_keyboard from SDK 9.0.0 on a nRF51422 revision 2 chip, and it advertises.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30298?ContentTypeID=1</link><pubDate>Wed, 29 Jul 2015 16:56:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88f284b5-c212-4f5c-b637-e81d4b07ac22</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;I have a PCA10001. Would it run on that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30297?ContentTypeID=1</link><pubDate>Wed, 29 Jul 2015 16:50:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bafa72c6-58dd-4563-9106-e83eefc91a45</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;But are you able to run ble_app_hids_keyboard?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30296?ContentTypeID=1</link><pubDate>Wed, 29 Jul 2015 16:16:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56bb5e99-6449-49e3-936a-d1ea2dd3b276</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;This is a custom board. But the board does work with the older software (Softdevice 5.2.1, nRF SDK 4.4.3). Yes, app_hids_keyboard was a model (because it uses the scheduler, and app_uart because ble_nus is the only service I need/use). I&amp;#39;ll keep looking...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30295?ContentTypeID=1</link><pubDate>Wed, 29 Jul 2015 12:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eedb77ac-18f9-4928-bbfb-f2f19aef7138</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I understand. Not really. But if the API doesn&amp;#39;t return an error it should work, i.e. start advertising. I&amp;#39;m not sure how to help you. You application seem similar to the ble_app_hids_keyboard, so if I were you I would start with that, and try to compare what is different. Are you using a nRF51 DK?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30294?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 16:18:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4563d35c-9913-4f68-a308-39478abac4f3</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;I removed the extra pstorage_init(). I appreciate the generous offer, but I&amp;#39;d be more interested in learning how to debug this myself. I can add traces to the C code for most of the library, but the softdevice is a black box. It&amp;#39;s not sending me any events, but is there any other way to probe its state, or otherwise peek under the hood?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void softdevice_init(void) {
    SOFTDEVICE_HANDLER_APPSH_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, true);

    ble_enable_params_t ble_enable_params = {
        .gatts_enable_params = {
            .service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT,
            .attr_tab_size = BLE_GATTS_ATTR_TAB_SIZE_DEFAULT
        },
    };
    uint32_t err_code = sd_ble_enable(&amp;amp;ble_enable_params);
    APP_ERROR_CHECK(err_code);

    err_code = softdevice_ble_evt_handler_set(ble_event_dispatch);
    APP_ERROR_CHECK(err_code);

    err_code = softdevice_sys_evt_handler_set(sys_event_dispatch);
    APP_ERROR_CHECK(err_code);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30293?ContentTypeID=1</link><pubDate>Tue, 28 Jul 2015 10:39:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea49e162-1e7e-4962-9057-594f2f12bf41</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Are you initializing pstorage twice? There is a pstorage_init() in device_manager_init() as well. Shouldn&amp;#39;t matter though. I can&amp;#39;t see anything wrong with your code. Could you include your softdevice_init() as well? Or maybe just include your complete project so I can test it here? If it is secret you could also open a private case on your MyPage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30292?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2015 15:49:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac200e74-bf15-4a41-8c4c-9fee8a74b9c2</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;Yes, everything returns success. Here&amp;#39;s my ble_stack_init:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void bluetooth_init(void) {
    softdevice_init(); // does SOFTDEVICE_HANDLER_APPSH_INIT
    sd_ble_gap_tx_power_set(4);
    pstorage_init();
    device_manager_init(true);

    gap_params_init();
    services_init();
    advertising_init(); // does ble_advertising_init()
    conn_params_init();
    radio_notification_init();
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and main():&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int main(void) {
    hardware_init();
    scheduler_init();
    timers_init();

    bluetooth_init();
    timers_start();
    advertise(); // does sd_ble_gap_adv_start()

    TRACE(&amp;quot;main_loop_start&amp;quot;);
    while (1) {
        app_sched_execute();
        power_manage(); // does sd_app_evt_wait()
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30291?ContentTypeID=1</link><pubDate>Mon, 27 Jul 2015 10:38:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9bbb0e2-4feb-4755-ba0e-9b8b898f4f7b</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I assume sd_ble_gap_adv_start() returns NRF_SUCCESS (0x00000000)? Could you include your main()? and ble_stack_init()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30290?ContentTypeID=1</link><pubDate>Fri, 24 Jul 2015 20:18:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3488ea01-0e42-4659-80a5-d445e746aa3e</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;Installed Master Control Panel. Old code shows up, connects, shows GAP, GATT, and NUS services as expected. New code never shows up in list, so it doesn&amp;#39;t seem to be broadcasting at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30289?ContentTypeID=1</link><pubDate>Fri, 24 Jul 2015 16:56:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21e6cb85-5cad-4636-8230-8329bafc4898</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;I was not using any 0 timeouts as far as I could tell. Another difference I noticed is that my code, along with most of the examples, used &lt;code&gt;ble_advertising_start()&lt;/code&gt;, while my older working code used &lt;code&gt;sd_ble_gap_adv_start()&lt;/code&gt;. So I switched. I&amp;#39;m now using:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_gap_adv_params_t adv_params = {
    .type = BLE_GAP_ADV_TYPE_ADV_IND,
    .p_peer_addr = NULL,
    .fp = BLE_GAP_ADV_FP_ANY,
    .interval = APP_ADV_INTERVAL,           // 64
    .timeout = APP_ADV_TIMEOUT_IN_SECONDS   // 180
};
uint32_t err_code = sd_ble_gap_adv_start(&amp;amp;adv_params);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I am not getting any events at all. My main loop is running, but neither my &lt;code&gt;ble_evt_dispatch()&lt;/code&gt; nor my &lt;code&gt;on_adv_evt()&lt;/code&gt; are getting anything at all.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure how to test whether or not there&amp;#39;s any actual advertising going on. I&amp;#39;m trying to connect with my Nexus7 tablet (Android 5.1) using the nRF UART app.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30308?ContentTypeID=1</link><pubDate>Fri, 24 Jul 2015 14:55:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45b32576-7067-4441-beb3-97ff2c63c9f0</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;SDK 9.0 has this release note for a bugfix: &amp;quot;Advertising module can be set to infinite time-out.&amp;quot; Additionally, they added the option to use low duty-cycle directed advertisement. The underlying BLE stack has always supported infinite advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30288?ContentTypeID=1</link><pubDate>Fri, 24 Jul 2015 13:58:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:060acad6-5f86-4158-9fe9-7fe6b9c2a9c6</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Are you seeing any advertising at all?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hung up on advertising</title><link>https://devzone.nordicsemi.com/thread/30307?ContentTypeID=1</link><pubDate>Fri, 24 Jul 2015 04:57:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab0fe5c7-1030-4468-88ee-a74e45a7bcf0</guid><dc:creator>ahmad</dc:creator><description>&lt;p&gt;You don&amp;#39;t have the option of infinite advertising anymore. There is an interval for advertising and after that you receive a BLE_ADV_FAST or SLOW and advertising stops. In initializing the advertising, you can enable to have fast or slow or both of the advertisings. If you have both, after passing the fast advertising interval, the device switches to slow advertising and at the end of slow advertising stops advertising. I think the maximum interval for slow advertising should be around 4 hours and for the fast one, few minutes. If you want to advertise infinitely, you should start advertising again when you receive the BLE_ADV_FAST or SLOW events.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>