This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Nrf52840 central / peripheral on different phy

Hi Folks,

I am currently working on a BLE configuration composed of two NRF52840 chips. One is configured as central and the other as peripheral and use coded phy (long range).

I want the central to be able to manage simultaneously another connection with mobile device.

Does the central can be configured to support a multilink configuration with the following properties :

- connection to 1 peripheral using coded phy

- connection to another peripheral using 1MBPS phy

If yes, could you please give code sample illustrating this configuration?

Thank you for your answers.

The best

  • Hi Sebastopolix,

    Start with the SDK17\examples\ble_central\ble_app_multilink_central example and edit the following as below

    // <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. 
    #ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 0
    #endif
    
    // <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. 
    #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 2
    #endif
    
    // <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count. 
    // <i> Maximum number of total concurrent connections using the default configuration.
    
    #ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 2

    You then need to timeslice the scanner (using a timer) and configure it half time for scanning 1M PHY and the other scanning or the advertising extension packets to be able to connect with code phy (or scan normal adv packets and change the PHY to coded after establishing a 1M PHY connection)

    I do not think that there is a direct example just to match your use case, but you can look into the sdk example to see how you do a search in the SDK for events BLE_GAP_EVT_PHY_UPDATE and BLE_GAP_EVT_PHY_UPDATE_REQUEST to gain more understanding of the state machine. 

    This example in Nordic github playground might also be of some help to you

  • Hi Susheel,

    And thank you for your quick answer.

    One more thing about scanner timeslicing : do you mean to implement this kind of sequence? stop scan at 1MBPS -> start coded Phy scan during a certain amount of time -> stop coded phy scan and change phy (via PHY_UPDATE mechanism)  to set up to 1MBPS -> start 1MBPS during another amount of time and so on.

    Or is it a specific scanner configuration (via sdk) to manage this hybrid mode with a timer?

    Are you sure that the timeslicing method allows working simultaneously on both Phy in order to catch all events?

    Thank you again.

    Seb

  • Hi

    I'm sorry for the late reply, but Susheel is out of office for the time being, and we're only now getting to his backlog.

    Regarding the timeslicing, yes you will need to split the time between the two PHYs, as the nRF52840 only has one radio, and will only be able to communicate on one PHY at a time. You will have to use a timer to let the device alternate PHYs so that it can scan/maintain the connections on both peripheral devices.

    There is no specific scanning configuration that does this already, so you'll have to implement this yourself I'm afraid.

    Best regards,

    Simon

Related