nRF52833 Coded PHY

Good day

I am currently developing a system using the nRF52833. A nRF peripheral device needs to be connected to both a mobile app and a nRF central device. The software on the peripheral currently is able to connect to both the mobile app and central, using 1MBs PHY. I need the peripheral device to be able to connect to the mobile app using 1MBs PHY and to the central device using Coded PHY.

I have been struggling with this for a while now and any help would be appreciated. I have read through the forums and any examples I was able to find, but I am still unable to resolve the issue.

Could you please provide me with a list of things to change/add on the Nordic side of the project, specifically for the nRF52833.

Kind regards

Details:
nRF52833 on a custom PCB
nRF5 SDK version 17.1.0
Soft devices s140-7.2.0 and s122-8.0.0
The software is adapted from the BLE UART examples in the SDK

  • Hi

    We don't have an official sample project in the nRF5 SDK for using Coded PHY, but here you have an unofficial modified version of the ble_app_uart project running with Coded PHY. The main changes are to the PHY used. Extended advertising being enabled, as well as the advertising flags are set to GENERAL_DISC. If your application also uses extended MTU for example, Coded PHY does not support larger data packets than 27 bytes.

    Please note that S2 is not supported by the nRF5 SDK, so you'll have to make do with S8.

    Long_range_15.2.zip

  • Thank you for the quick response.

    I have tried to copy the code from your project to a fresh example from the SDK, since I need to use the pca10100 example and your code is from pca10056. The central and peripheral won't connect to each other. 

    From what I've seen, your only changes to the code was 
    to advertising_init() on the central
    and to scan_init() on the peripheral
    Is this correct?

    Do you have any further advice?

    Thanks for the extra advice of setting 
    sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, 8);
    and
    sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT, 0, 8);
    on the devices, I'll use that when I've managed to get the two devices connected

  • Hi

    Indeed, only advertising/scan initialization should be necessary to add Coded PHY. Most importantly are the following inits (in advertising):

    init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    init.config.ble_adv_primary_phy       = BLE_GAP_PHY_CODED;
    init.config.ble_adv_secondary_phy     = BLE_GAP_PHY_CODED;
    init.config.ble_adv_extended_enabled  = true;
    And these for scan_init: 
    scan_params.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL;
    scan_params.scan_phys     = BLE_GAP_PHY_CODED;
    scan_params.extended      = true;
    Best regards,
    Simon
  • I still can't get the two devices to connect. I've attached my code, could you please have a look at it.

    I get the following output from RTT Viewer:

    Central
    00> <info> app_timer: RTC: initialized.
    00>
    00> <debug> ble_scan: Added filter on UUID 1
    00>
    00> <info> app: BLE UART central example started.
    00>
    00> <debug> ble_scan: Scanning
    00>

    Peripheral
    00> <info> app_timer: RTC: initialized.
    00>
    00> <info> app: Debug logging for UART over RTT started.
    00>


    Coded_PHY_Examle.zip

  • Hi

    Is there no more logging after the "Debug logging for UART over RTT started" line? Does the peripheral application start advertising at all? And can you check that the ble_advertising_start() function (wherever it is defined) does not change the advertising settings that you set in advertising_init()?

    Best regards,

    Simon

Related