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

Changing PHY to CODED results in 1M

Hi,

we are developing an application using the nrf42840, Softdevice S140 7.0.1 and nRF5 SDK v16.0.0. We develop the code both on central and peripheral side. So we have 2 nrf42840 speaking which each other. We would try to set the PHY to coded under certain circumstances. We do this using  sd_ble_gap_phy_update on central side during an active connection.

    static ble_gap_phys_t phys = {
        .tx_phys = BLE_GAP_PHY_CODED,
        .rx_phys = BLE_GAP_PHY_CODED,
    };
    APP_ERROR_CHECK(sd_ble_gap_phy_update(m_devices[0].conHandle, &phys));

On peripheral side, we just acknowledge every setting we get:

        case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        {
            NRF_LOG_INFO("PHY update request");
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_AUTO,
                .tx_phys = BLE_GAP_PHY_AUTO,
            };
            sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle, &phys);
        } break;

Afterwards we receive the BLE_GAP_EVT_PHY_UPDATE on central side. However, even though phy_update.status indicates a success (0x00) the parameters indicate a change to 1M. p_ble_evt->evt.gap_evt.params.phy_update.tx_phy and p_ble_evt->evt.gap_evt.params.phy_update.rx_phy both have the Value  BLE_GAP_PHY_1MBPS (0x01). I would expect them to be BLE_GAP_PHY_CODED (0x04). Do you have any idea what I did wrong?

We tried this also with setting to 2M. In this case the phy parameters delivered by BLE_GAP_EVT_PHY_UPDATE  have the expected values of BLE_GAP_PHY_2MBPS (0x02).

Best regards

Björn

Related