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

A terminal that can not communicate.

I found a terminal that can not communicate with BLE.
I think that the sequence after MTU exchange is strange.
The program used is sample HRM.
The terminal used is "Xperia (TM) Z4 SO-03G".

Is there a solution?

The usage environment is as follows.

・SDK15
・Nrf 52
・Nrf 52832_xxaa
・S132_nrf52_6.0.0_softdevice.hex
・nRF5_SDK_15.0.0_a53641a \ examples \ ble_peripheral \ ble_app_hrs \ hex \ ble_app_hrs_pca10040_s132.hex

Postscript

It turned out that communication is possible with the following.

nRF5_SDK_15.0.0_a53641a\components\softdevice\common\nrf_sdh_ble.c
line157
ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = NRF_SDH_BLE_GATT_MAX_MTU_SIZE;

ble_cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = BLE_GATT_ATT_MTU_DEFAULT;


I had previously switched off the MTU exchange.
At that time, communication was not possible.

nRF5_SDK_15.0.0_a53641a\components\ble\nrf_ble_gatt\nrf_ble_gatt.c
Delete lines 150-173.

Here are the questions:

1. What is the difference between making MTU by default and turning it off?

2. If MTU is the default, will the communication speed be slower if the data size is large?

Parents Reply
  • From the sniffer log, the phone is transmitting several packet 2 times, without waiting for response.


    This phenomenon may occur with any mobile phone connected.
    It can also occur when using the sample without changing it.


    1) Does the issue disappear if you set NRF_SDH_BLE_GAP_DATA_LENGTH in sdk_config.h to 27 ?


    I was able to connect.
    What does this change mean?
    Is the parameter different from MTU?

    I will attach the log.
    ・HRM_DATA_LENGTH_27_iPhoneSE.pcapng
    ・HRM_DATA_LENGTH_27_xperia.pcapng

    2) Does the issue disappear if you set NRF_SDH_BLE_GATT_MAX_MTU_SIZE in sdk_config.h to 23 ?


    I was able to connect.
    If this change is made, the MTU of all devices will be 23.
    So it is not suitable for me.
    When the communication partner is Bluetooth 4.2 or later, I want to extend the MTU and communicate.

    I will attach the log.
    ・HRM_MAX_MTU_SIZE_23_iPhoneSE.pcapng
    ・HRM_MAX_MTU_SIZE_23_xperia.pcapng

    HRM_DATA_LENGTH_27_iPhoneSE.pcapng

    HRM_DATA_LENGTH_27_xperia.pcapng

    HRM_MAX_MTU_SIZE_23_iPhoneSE.pcapng

    HRM_MAX_MTU_SIZE_23_xperia.pcapng

Children
  • Hi,

    What does this change mean?
    Is the parameter different from MTU?

    Yes, NRF_SDH_BLE_GAP_DATA_LENGTH is different from ATT MTU. DLE / (NRF_SDH_BLE_GAP_DATA_LENGTH ) is the on-air packet size.

    I took a closer look at the HRM_xperia log, and I see that the xperia is not following the Bluetooth specification. In HRM_xperia.pcapng, the xperia sends a LL_LENGTH_RSP packet where Max RX time is set to 256 microseconds. This is not allowed according to the Bluetooth spec.

    From the spec:

    BLUETOOTH SPECIFICATION Version 4.2 [Vol 6, Part B] page 57 , chapter

    2.4.2.21 LL_LENGTH_REQ and LL_LENGTH_RSP

    The MaxRxTime field shall have a value in the range of 328 to 2120 microseconds".

    I therefore suggest setting NRF_SDH_BLE_GAP_DATA_LENGTH to 27 if you want to workaround this issue that the xperia has.

  • Thank you for your response.

    I have a question.

    Here is my recognition.
    Whether to execute Data Length Extension (DLE) is judged from the result of the following dialogue.
    ・ LL_VERSION_IND
    ・ LL_FEATURE_REQ and LL_FEATURE_RSP
    (Confirmation that the other party supports DLE)

    Why is softdevice running DLE without this interaction?

  • zkt-1400 said:
    Whether to execute Data Length Extension (DLE) is judged from the result of the following dialogue.

    Yes, the FeatureSet(LL_FEATURE_REQ/LL_FEATURE_RSP) can be used for that, from the Bluetooth spec we have the following:

    If the peer Link Layer has indicated either during a feature exchange procedure
    or by responding with an LL_UNKNOWN_RSP PDU that it does not support a
    procedure, then the Link Layer shall not use that procedure.

    But if the FeatureSet have not be been exchanged yet, it's still allowed to use the DLE procedure (LL_LENGTH_REQ/LL_LENGTH_RSP), and if the other peer does not support DLE, it should respond with LL_UNKNOWN_RSP PDU.

  • Thank you for your detailed answer.
    I think that I would like to use s132_nrf52_6.1.1_softdevice because I think it has been changed to not disconnect.

    Current
    s132_nrf52_6.0.0_softdevice + SDK15

    plans
    s132_nrf52_6.1.1_softdevice + SDK15

Related