This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CONNECT with extended advertising

Dear Nordic DevZone,

Greetings!
I have been trying to get working with the example ble_app_buttonless_dfu
I tried configuring for extended advertising with help from this link in SDK 15.3.0 on nRF52832 DK
devzone.nordicsemi.com/.../181595

I am using two different ways to observe the nRF52832. They are: a) "nRF Connect v3.3.0 desktop" on my windows computer, open Bluetooth Low Energy and b) Samsung S10e smart phone (having Bluetooth v5.0) with "nRF Connect APP".

My aim is to quickly get the properties of nRF52832 that it is extended advertising and CONNECT so that DFU service can be triggered from the Application (and get the bootloader to perform the DFU).

I noticed the following issues, please help:

  1. In addition to the above link, in this function: advertising_config_get(), I also needed to set
    p_config->ble_adv_extended_enabled = true;
    only then I am able see the correct properties on my smart phone that it is extended advertising. See attached pictures taken from my phone.
    1. Is this the correct way to configure nRF52832?
    2. Meanwhile, the "nRF Connect v3.30 on my desktop" does not show my nRF52832 at all. Is this already fixed in the upcoming release?
  2. Now I press CONNECT from the smart phone "nRF Connect APP" but the connection never goes through. Am I missing some special settings to get CONNECT working with extended advertising on nRF52832?

Please help.

Thanks,
Tilak

Below picture when the ble_adv_extended_enabled = true

ble_adv_extended_enabled = true

Below picture when the flag ble_adv_extended_enabled = false

 

  • Hi Tilak, 

    In addition to the above link, in this function: advertising_config_get(), I also needed to set
    p_config->ble_adv_extended_enabled = true;
    only then I am able see the correct properties on my smart phone that it is extended advertising. See attached pictures taken from my phone.

    1. Is this the correct way to configure nRF52832?

     Yes, that should be enough. You can also use the ble_app_rscs example as a reference as this uses AE. 

    Meanwhile, the "nRF Connect v3.30 on my desktop" does not show my nRF52832 at all. Is this already fixed in the upcoming release?

     nRF Connect for Desktop does not support advertising extensions as it is currently using v4.x.x SoftDevice. Advertising Extentions is only supported in v6.0.0 and above.

     

    Now I press CONNECT from the smart phone "nRF Connect APP" but the connection never goes through. Am I missing some special settings to get CONNECT working with extended advertising on nRF52832?

     Can you post the log from the nRF Connect app as well as the log output from the nRF side?

    Best regards

    Bjørn

  • Hej Bjørn,
    Attached are the logs from the nRF Connect from my phone and also from the nRF52832 running the buttonless DFU with the APP configured in extended advertising (connectable, nonscannable, undirected). Unfortunately, I only get the logs from RTT viewer from the bootloader and nothing from the APP. I am not sure why :(
    Also attached is my example source files where I had changed to make it work for BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED.
    Requests:
    1. It would be great if you can provide an example where CONNECT works in BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED. Your example will help us to achieve our final goal of having a nRF52840 trigger a CONNECT to my nRF52832 application having dfu service which will then invoke bootloader DFU. Note that when the DFU service is not invoked via connect, I want to perform beacon advertising from my nRF52832 application with 10 second interval.
    2. It would be great if nRF Connect tool works on my desktop with extended advertising, as it will help our development activity. Instead of using my smart phone. On this note, is there anything from Nordic on this front that I could install/build?
    Kindly guide me.
    Cheers,
    Tilak
  • Tilak said:

    Attached are the logs from the nRF Connect from my phone and also from the nRF52832 running the buttonless DFU with the APP configured in extended advertising (connectable, nonscannable, undirected). Unfortunately, I only get the logs from RTT viewer from the bootloader and nothing from the APP. I am not sure why :(
    Also attached is my example source files where I had changed to make it work for BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED.
    Requests:
    1. It would be great if you can provide an example where CONNECT works in BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED. Your example will help us to achieve our final goal of having a nRF52840 trigger a CONNECT to my nRF52832 application having dfu service which will then invoke bootloader DFU. Note that when the DFU service is not invoked via connect, I want to perform beacon advertising from my nRF52832 application with 10 second interval.

    You need to generate a bootloader settings hex and flash it to the nRF52840 so that the bootloader knows that there is a valid application present. Otherwise, the nRF52840 will stay in bootloader mode.

    C:\Nordic_Semiconductor\nRF_Tools\nrfutil_v5.2.0>nrfutil settings generate --family NRF52840 --application ble_app_buttonless_dfu_pca10040_s132.hex --application-version 1 --bootloader-version 1 --bl-settings-version 2 settings.hex
    
    Note: Generating a DFU settings page with backup page included.
    This is only required for bootloaders from nRF5 SDK 15.1 and newer.
    If you want to skip backup page generation, use --no-backup option.
    
    Generated Bootloader DFU settings .hex file and stored it in: settings.hex
    
    Bootloader DFU Settings:
    * File:                     settings.hex
    * Family:                   NRF52840
    * Start Address:            0x000FF000
    * CRC:                      0x5A2E8DFE
    * Settings Version:         0x00000002 (2)
    * App Version:              0x00000001 (1)
    * Bootloader Version:       0x00000001 (1)
    * Bank Layout:              0x00000000
    * Current Bank:             0x00000000
    * Application Size:         0x0000C9B8 (51640 bytes)
    * Application CRC:          0x585FEA46
    * Bank0 Bank Code:          0x00000001
    * Softdevice Size:          0x00000000 (0 bytes)
    * Boot Validation CRC:      0xF087562E
    * SD Boot Validation Type:  0x00000000 (0)
    * App Boot Validation Type: 0x00000001 (1)
    
    
    C:\Nordic_Semiconductor\nRF_Tools\nrfutil_v5.2.0>
    
    
    C:\Nordic_Semiconductor\nRF_Tools\nrfutil_v5.2.0>nrfjprog --program settings.hex --sectorerase -r
    Parsing hex file.
    Erasing page at address 0x7E000.
    Erasing page at address 0x7F000.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Applying system reset.
    Run.
    
    C:\Nordic_Semiconductor\nRF_Tools\nrfutil_v5.2.0>

    Tilak said:
    It would be great if nRF Connect tool works on my desktop with extended advertising, as it will help our development activity. Instead of using my smart phone. On this note, is there anything from Nordic on this front that I could install/build?

     We are planing on updating nRF Connect for Desktop to support the v6.x SoftDevices, but I am afraid that I cannot give you any date for when this will be available. So for the time being you will have to use nRF Connect for iOS/Android. 

     

     

  • Hej Björn,
    I looks like my question was misunderstood, so I try again to explain my existing problem:
    I have nRF52832 running the (APP+SD+BL). The APP is the example ble_app_buttonless_dfu_pca10040_s132. I have followed all the procedure with nrfUtil and zip file generation and get the bootloader settings files and the whole deal with DFU.
    Scenario when it works:
    The example ble_app_buttonless_dfu_pca10040_s132 works well where I can perform the DFU update. The DFU update is triggered from my phone using the "nRF Connect APP". From my phone, I can see "Nordic_Buttonless" and pressing CONNECT as shown in the above screenshots. Then, on triggering DFU procedure, the bootloader is launched as it is triggered by the application. Then, I can even upload the APPlication Zip file. So, the setup is good. Note that the nRF52832 has a default configuration of BLE_GAP_ADV_TYPE_CONNECTABLE_SCANNABLE_UNDIRECTED in the ble_app_buttonless_dfu_pca10040_s132.
    Scenario when it does NOT work:
    The source files (attached earlier) is a modified example of ble_app_buttonless_dfu_pca10040_s132 to make it work with BLE_GAP_ADV_TYPE_EXTENDED_CONNECTABLE_NONSCANNABLE_UNDIRECTED. Under this scenario, my phone can see "Nordic_Buttonless" but on pressing CONNECT, I get the GATT ERROR (133), as attached in my previous logs.
    Questions:
    1. Please help with the above scenario where it is not working.
    2. Please try this failing scenario at your end to see this problem.
    3. Looking closely, with help from my colleague, at the Advertising types defined in Bluetooth Core Specification v5.0, Vol 6, Part B, Section 4.4.2.7 Connectable Undirected Event Type in particular. On page 2625, "An initiator may send a connect request using the AUX_CONNECT_REQ PDU on the same secondary advertising channel as the AUX_ADV_IND PDU to request the Link Layer to enter the Connection State......If the advertiser receives an AUX_CONNECT_REQ PDU that contains its device address from an initiator allowed by the advertising filter policy it shall reply with an AUX_CONNECT_RSP PDU on the same secondary advertising channel index."

      nRF52832 -> ADV_EXT_IND PDU
      Phone -> AUX_CONNECT_REQ
      nRF52832 -> AUX_CONNECT_RSP

      It looks like we fail here and the nRF52832 application does not get any notification or callback or we have a bad configuration. It looks like the Nordic SoftDevice 6.1.1 is not able to perform this procedure. As I understand, the SoftDevice is certified. In this regard, it is worthwhile to know if there is any test-report if the softDevice is passing this scenario/test ?
    Kindly let me know if more clarification is needed. Your response will help us to guide our next steps in our project if we should take this route or give up due to the limitation of the softDevice?
    Looking forward to your response.
    Thanks,
    Tilak
  • Hej Bjørn,

    Any update on this? Meanwhile, just thought of letting you know about the board details that I have been using:

    PCA10040
    1.2.4
    2018.23
    682330311

    We are looking forward to your example code for the failure scenario above.

    Cheers,
    Tilak

Related