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

  • There is no more logging after "Debug logging for UART over RTT started". When debugging the code, I'm able to step through everything without any errors.


    If I comment out (lines 629 - 631 in my code):
    // 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;
    The code works fine again, immediately connects.

    00> <info> app_timer: RTC: initialized.
    00>
    00> <info> app: Debug logging for UART over RTT started.
    00>
    00> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.
    00>
    00> <debug> nrf_ble_gatt: Updating data length to 251 on connection 0x0.
    00>
    00> <info> app: Connected
    00>
    00> <debug> nrf_ble_gatt: Peer on connection 0x0 requested an ATT MTU of 247 bytes.
    00>
    00> <debug> nrf_ble_gatt: Updating ATT MTU to 247 bytes (desired: 247) on connection 0x0.
    00>
    00> <debug> nrf_ble_gatt: ATT MTU updated to 247 bytes on connection


    I don't think the advertising_start function is changing anything
    static void advertising_start(void)
    {
    uint32_t err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    }




  • Can you show me what your ble_advertising_start function does though? Please also make sure that the NRF_BLE_SCAN_BUFFER is equal to BLE_GAP_SCAN_BUFFER_EXTENDED_MIN (255)?

    Best regards,

    Simon

  • The NRF_BLE_SCAN_BUFFER is set to 255


    ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST); returns error code 0

    Stepping through the ble_advertising_start function:
    line 547: p_advertising->initialized == true
    552: p_advertising->adv_mode_current is set to 0x03

    The if statement on line 556 is false

    572: p_advertising->adv_mode_current is set to 0x03

    The if statement on line 574 is false, else on line 584 is used
    p_advertising->whitelist_reply_expected is set to 0x00

    595: if statement is valid, p_advertising->adv_params.primary_phy is set to 0x04
    604: if statement is valid, p_advertising->adv_params.secondary_phy is set to 0x04

    616: p_advertising->adv_params.filter_policy is set to 0x00

    switch statement on line 619 value is BLE_ADV_MODE_FAST

    645: if(p_advertising->adv_mode_current != BLE_ADV_MODE_IDLE) is true
    649: if(ret != NRF_SUCCESS) is false
    655: if(ret != NRF_SUCCESS) is false
    661: if (p_advertising->evt_handler != NULL) is true

  • Hi

     I'm sorry, but I don't see what's missing here. This should run on Coded PHY from what I can see. Can you try doing a Diff between the nRF52833 main file and the Coded PHY main file I uploaded?

    Best regards,

    Simon

Related