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

Requesting to update ATT MTU Size multiple times on connection

Hi Team,

We are using the NRF52840 for our development purpose in BLE peripheral Mode. While connecting to the Central Device we observed the behavior, It is negotiating the MTU Size multiple times on connection request.  Please find the connection log in below screen shot.

Could you please help us to find the root cause for this behavior and  please suggest the any solution on this behavior.

              <debug> nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.
             <info> app: ble_on_connected ****** ->
            <debug> nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).
            <debug> nrf_ble_gatt: Peer on connection 0x0 requested a data length of 27 bytes.
            <debug> nrf_ble_gatt: Updating data length to 27 on connection 0x0.
            <debug> nrf_ble_gatt: Data length updated to 27 on connection 0x0.
           <debug> nrf_ble_gatt: max_rx_octets: 27
           <debug> nrf_ble_gatt: max_tx_octets: 27
           <debug> nrf_ble_gatt: max_rx_time: 328
           <debug> nrf_ble_gatt: max_tx_time: 2120


           <debug> app: PHY update request.
          <debug> nrf_ble_gatt: Peer on connection 0x0 requested an ATT MTU of 241 bytes.
         <debug> nrf_ble_gatt: Updating ATT MTU to 241 bytes (desired: 247) on connection 0x0.
         <debug> nrf_ble_gatt: Peer on connection 0x0 requested a data length of 245 bytes.
          <debug> nrf_ble_gatt: Updating data length to 27 on connection 0x0.
         <debug> nrf_ble_gatt: Data length updated to 27 on connection 0x0.
         <debug> nrf_ble_gatt: max_rx_octets: 27
        <debug> nrf_ble_gatt: max_tx_octets: 27
        <debug> nrf_ble_gatt: max_rx_time: 2120
        <debug> nrf_ble_gatt: max_tx_time: 2120

Regards,

Srinivas.V

Parents
  • Hi Srinivasa,

    If the current mtu size in a connection is less than the att_mtu_desired (taken from sdk_config.h settign NRF_SDH_BLE_GATT_MAX_MTU_SIZE)

    you set for your link, there  will a exchange of mtu request soon after the connection. This request is something that goes from your device to the peer if your desired mtu size is larger than the initial connection mtu size.

    The second request is something that comes from the peer, and your device is just responding to it. You cannot control when and how the peer will request it all you can do is to reply as fast as you can with the desired mtu requirements of your app.

    Are you seeing more MTU exchanges than these two?

Reply
  • Hi Srinivasa,

    If the current mtu size in a connection is less than the att_mtu_desired (taken from sdk_config.h settign NRF_SDH_BLE_GATT_MAX_MTU_SIZE)

    you set for your link, there  will a exchange of mtu request soon after the connection. This request is something that goes from your device to the peer if your desired mtu size is larger than the initial connection mtu size.

    The second request is something that comes from the peer, and your device is just responding to it. You cannot control when and how the peer will request it all you can do is to reply as fast as you can with the desired mtu requirements of your app.

    Are you seeing more MTU exchanges than these two?

Children
  • Hi Susheel,

    Thanks for your reply.

    we have configured the #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247 to 247 only.

    1.How to know the initial connection MTU size, and how to check desired MTU size is larger than initial MTU Size.

    2. But in some devices (Mobiles) we are getting only one request only, but in some peers(Android Phones) we are getting two times the request.

    3. Is there any thing we need to check in Nordic Side apart from above Macro.

    Regards,

    Srinivas.V

  • Srinivas V said:
    .How to know the initial connection MTU size, and how to check desired MTU size is larger than initial MTU Size.

    By default at the connection initially the MTU size is 23 unless there has been and exchange of MTU request/response from one side.
    nrf_gatt module does this request for you immediately after the connection is made. The central might choose to change this at the later stage for many number or reasons and the request from central is outside the control of peripheral.

     

    Srinivas V said:
    2. But in some devices (Mobiles) we are getting only one request only, but in some peers(Android Phones) we are getting two times the request.

     Yes, different centrals and different mobile vendors (different IOS) behave differently as to when and if they want to request an update the MTU size to their preference.

     

    Srinivas V said:
    3. Is there any thing we need to check in Nordic Side apart from above Macro.

    No, if you are using bigger MTU size and if the peer prefers smaller size after some time then it can request a change in MTU size. 

Related