Advertising in CODED PHY using primary channels only

Hello,

For a proprietary application that doesn't require full Bluetooth compatibility, I am trying to setup an advertisement on the primary channels, using coded PHY 125 kbps. I am using nRF52840 and softdevice SD140 from SDK Version_nRF5_SDK_17.1.0_ddde560.

My code is based on ble_app_beacon example from SDK. Using the parameters below in the advertising_init function the my code is running fine, but using default PHY at 1Mbps which is not what I need.

m_adv_params.properties.type = BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED;
m_adv_params.p_peer_addr     = NULL;    // Undirected advertisement.
m_adv_params.filter_policy   = BLE_GAP_ADV_FP_ANY;
m_adv_params.interval        = NON_CONNECTABLE_ADV_INTERVAL;
m_adv_params.duration        = 0;       // Never time out.

I could only make it work using coded PHY by adding these lines:

m_adv_params.properties.type = BLE_GAP_ADV_TYPE_EXTENDED_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED; 
m_adv_params.primary_phy     = BLE_GAP_PHY_CODED; //BLE_GAP_PHY_1MBPS / BLE_GAP_PHY_CODED / BLE_GAP_PHY_AUTO
m_adv_params.secondary_phy   = BLE_GAP_PHY_CODED;

but now the advertisement is using the full featured "extended advertisement" and I don't want this. I need to minimize the battery drain.

If I drop the first line, the code crashes. According to google bard, the SDK V17 doesn't allow this implementation

According to g. bard:

As of this writing (January 2024), CODED PHY advertising with simple advertising is not supported in any publicly released version of SoftDevice. Nordic Semiconductor is currently working on a new version of SoftDevice that will include this feature, but there is no ETA for its release.

Once the new SoftDevice becomes available, you will need to upgrade your Segger SDK and firmware to the latest version to use CODED PHY advertising with simple advertising.

Is this statement true? is there a way to force legacy advertisement (not extended) on primary channels only?

Thanks in advance for any hint.

  • Hi Yves, 


    I think the GBard which is based on Gemini AI may have some miss information and may need some upgrade.

    We have no plan to support the feature as it's not allowed by the spec. 


    Here is the response from my ChatGPT 4 to the question of "Does Nordic softdevice support advertising in CODED PHY using classic advertising?"

    If you're referring to using CODED PHY with the classic advertising scheme (i.e., the original BLE advertising method), this might be constrained by the BLE specification and the capabilities of the SoftDevice. It's more common to use CODED PHY with extended advertising due to the enhancements in Bluetooth 5.0 and later versions.

    For the most accurate and current information, I recommend consulting the latest Nordic Semiconductor documentation for the specific SoftDevice version you are interested in, or contacting their technical support. Nordic regularly updates their SoftDevice with new features and capabilities, so they would provide the most reliable information on what is currently supported.

    I did a follow up question about how it's constrained in the Bluetooth spec and got these info: 

    Primary Advertisement Channels and PHYs: In Bluetooth 5.0, advertising on the primary channels (channels 37, 38, and 39) can be done using different advertising packets (PDUs). However, for the legacy advertisement PDUs, they can only be sent on the original LE 1M PHY. The only primary advertisement PDU that can be sent on a PHY other than the 1M PHY is the ADV_EXT_IND, which is an extended advertisement indicator. This means that for classic advertising, which uses the primary advertisement channels, the use of Coded PHY is limited to extended advertisements only.

    I think it's a proper answer. It's not allowed by the Bluetooth spec to do classic advertising in CODED PHY as you can find at page 2690 (v5.4) here: 


    ADV_IND can only be used in LE 1M not LE CODED. 
    Note that ADV_EXT_IND can be sent in both LE1M and LE CODED , but the ADV_EXT_IND doesn't include any data, it only the indication that there will be follow up packets in the data channel (extended advertising). 

  • Hi Hung,

    Thanks a lot for your answer. Indeed it confirms what I was about to conclude and feared: It's not possible to focus on CODED PHY only for simple advertising.

    I don't need a real compatibility with BLE for the application I am developing. I only need to transmit very few bytes. Indeed what I need is a repetitive broadcast transmission (similar to an advertisement) using as few energy as possible, but I'd like to profit from the extended range offered by the 125 kbps CODED PHY. So I don't need all the bells and whistles of a full BLE stack. Extended advertisement looks like a waste of power for my simple case.

    Now I wonder if there is any "bare metal" possibility to use the nRF52840 (or later to be ported on nRF52811) , i.e without the limitations of the SD140 or Zephyr. Any idea, pointer, literature or example how to use Nordic's nRF52 radio chips with a lower level API?

  • Hi Yves, 
    I assume you have control over both sides of the connection. You may want to consider using proprietary instead of BLE in that case. For example you can use the radio test example with with 125kbps LE modulation (Ble_LR125Kbit mode) .You will need to enable USE_MORE_RADIO_MODES.

    If you want to stick with BLE advertising, and want to do it in bare metal, I think it's possible. A few years back I did some test to run BLE mesh (which use BLE ADV in bare metal) in CODED PHY. You can take a look here: 

    RE: change phy in mesh 
    They are very old code. You may want to extract the code from the exact SDK used in the ticket. 

  • Hi Hung,

    thanks a lot for all the explanations. It is now clear to me. I could run the examples radio_test, radio/transmitter and radio/receiver. They provide valuable information. For me you can close this ticket.

Related