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

Default PHY

Hi

What is the default PHY when using NRF52832, SDK 14.2 and SD S132 v5.0?

When does a device's PHY get reset to this default value? Is it upon disconnect or is it as a part of each connection? Or is it the responsibility of the application to handle the PHY?

I have created a peripheral with above combination. If this peripheral connects to a BLE 5.0 enabled central, I get a PHY update request for 2M PHY. The peripheral selects AUTO and hence the PHY gets set to 2M PHY. If the peripheral disconnects from this central and connects to a new one which is not BLE PHY enabled, what should happen? Not all centrals trigger PHY update procedure. To handle this cleanly, should I call the SD API to set the PHY to 1M after every disconnection or does the softdevice handle this internally?

Thanks

Amruta

  • Hi,

    The default PHY is the same as the PHY you use to advertise with. In other words, the central will send the connection request with the same PHY used for the connectable advertisement packet. If the central support 2M PHY, it may choose to request a PHY change after the connection has been established, which will be accepted if you reply with AUTO.

    If the peripheral disconnects from this central and connects to a new one which is not BLE PHY enabled, what should happen?

     Then nothing will happen. The bitrate will remain at 1M. 

  • If we are not setting the PHY in our code anywhere apart from the PHY update request, which PHY would be used to advertise (the default PHY) by a device using SDK 14.2, S132 v5? 

  • Thanks.

    Please help me understand following situation. I have italicized my doubts below.

    1. A device comes up with default 1M PHY

    2. It gets a connected to a central that asks for a 2M PHY update

    3. The device handles the PHY_UPDATE request and calls sd_ble_gap_phy_update with BLE_GAP_PHY_AUTO. I assume that here the connection would be negotiated to 2M if the device is a 52832 running SDK 14.2, S132 v5.

    Please confirm if this assumption is right.

    4. The device now disconnects from the central. No sd_ble_gap* API is called by the application running on device explicitly.

    At this point, does the SoftDevice fall back to 1M PHY internally?

    5. A different central now connects to the device, but this central is a BLE 4.2 one, which can not possibly support 2M PHY. I assume it would neither even trigger a PHY update, nor does my device trigger it explicitly. 

    Which code here would take care of falling back to 1M PHY? 

    In all the above discussion, I have assumed that my application that runs on the device does not call "sd_ble_gap_phy_update" except in the handling of PHY_UPDATE. 

    Should I be calling it explicitly to handle the above scenarios I have mentioned.

  • 1. Unless you change the PHY in your advertising init function. The SDK examples use 1M by default. 

    2. Correct, PHY update may be negotiated after connection. 

    3.  Yes, if the central requests 2M PHY and the peripheral replies with AUTO, see PHY update message sequence charts (link).

    4. Not if the link was terminated by the central.

    5. This connection will always have a 1M bitrate. You can request a phy update from the peripheral if you want to use 2M when possible, see the message sequence charts that I linked to above. 

Related