Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Peripheral Heart Rate Monitor with Coded PHY on nRF5_SDK_17.1.0

Hi,

Do you have an example of the \ble_peripheral\ble_app_hrs with Coded PHY for the nRF5_SDK_17.1.0? I have tried to use the BLE_GAP_PHY_CODED definition in different places of the ble_peripheral\ble_app_hrs, but the LED1 does not flash. What other modifications should be made in the code?

Thanks,

Joel

  • Hi Joel, 

    Could you let me know how you want your device to work with Coded PHY ? Do you want it to advertise in CODED PHY or simply want to switch to CODED PHY when in connection ? 
    If you want to support CODED PHY in connection you would need to initiate the request to update PHY from either one of the peers. sd_ble_gap_phy_update() need to be called. 

    If you want to advertise with CODED PHY you need to do extended advertising and set the ble_adv_primary_phy/ble_adv_secondary_phy to CODED PHY. 
    I would suggest to have a look at this blog: devzone.nordicsemi.com/.../testing-long-range-coded-phy-with-nordic-solution-it-simply-works-922075585

  • Hii,

    I want to advertise with CODED_PHY. What I have done before:

    In the advertising_init() function I do the next:

       init.config.ble_adv_primary_phy   = BLE_GAP_PHY_CODED;

       init.config.ble_adv_secondary_phy = BLE_GAP_PHY_CODED;

    In the ble_advertising_init() function I set CODED PHY (fefore it was 1MBPS):

        //p_advertising->adv_params.primary_phy     = BLE_GAP_PHY_1MBPS;
        p_advertising->adv_params.primary_phy     = BLE_GAP_PHY_CODED;

    In the ble_advertising_start() function I have change the else status to CODED_PHY (before it was to 1MBPS):

        if (phy_is_valid(&p_advertising->adv_modes_config.ble_adv_primary_phy))
        {
            p_advertising->adv_params.primary_phy = p_advertising->adv_modes_config.ble_adv_primary_phy;
        }
        else
        {
            //p_advertising->adv_params.primary_phy = BLE_GAP_PHY_1MBPS;
            p_advertising->adv_params.primary_phy = BLE_GAP_PHY_CODED;     
        }

    As something new I have included in the advertising_init() function the next:

        init.config.ble_adv_extended_enabled = true; 

    However, the result is the same: once rebuild the ble_app_hrs examples (with the mentioned modifications), downloaded to the nRF52840-DK and resetted the board, the LED1 doesn't flash. Is like having the board death. Scanning using the nRFConnect app the board doen not appear.

  • Hi Joel, 
    When something doesn't work as expected you would need to debug and find more information on what happened inside the code. 

    Please check if you can find any logging. Then step into the code and check which function doesn't work. 

    My coworker Vidar also made an example of doing coded PHY: https://devzone.nordicsemi.com/f/nordic-q-a/58276/advertisement-with-le-coded-phy

  • Hi Hung,

    I know the usual method. I was trying to evaluate the robustness of Nordic solutions to see if they could fulfill the specs of a project.  The ble_app_hrs was ideal, and I thought an example that could work well on Coded PHY would be enough to adapt it. From the link you gently shared, I see it will be necessary to go quite deeper to customize the code of the ble_app_hrs example.

    Thank you.

    Joel

  • Hi Joel, 

    I'm sorry that I haven't got time to look at your code to check if there is anything wrong. We are in holidays period in Norway. But I suspect that it's just a small invalid parameter that cause the issue. I would suggest to check the error code when you call the advertising function. Please refer to the example to see if there is anything different. 

Related