-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bluetooth: GATT lockup on split packets #25561
Comments
@JordanYates can you update the description with the exact sample you are using as a central? Actually:
This is a fairly new option. I assume then you are not using a standard sample. Can you share either the code of your app or a minimal example to reproduce this? |
Was only added so that I could increase the data length to avoid the discovery problem.
More specifically, the largest L2CAP packet sent by the slave during discovery is 44 bytes. |
I have reproduced this issue between two Zephyr devices. https://github.com/JordanYates/zephyr/tree/gatt_blocking/samples/bluetooth/blocking_discovery |
Please set CONFIG_BT_ACL_RX_COUNT=10 if you set CONFIG_BT_HCI_ACL_FLOW_CONTROL=y (and thinking aloud, hope that peer does not fragment 255 bytes in 1 byte PDUs, then we will need 255 buffers). This should allow for recombination. But, why do you need CONFIG_BT_HCI_ACL_FLOW_CONTROL=y in a host+controller combined builds? |
CONFIG_BT_L2CAP_RX_MTU and CONFIG_BT_L2CAP_TX_MTU both depend on CONFIG_BT_HCI_ACL_FLOW_CONTROL. |
Presumably at some point the Bluetooth controller is trying to get a buffer and failing. |
Beautiful, problem is resolved by increasing CONFIG_BT_CTLR_RX_BUFFERS. |
You should not use
Increasing |
Alright, that makes sense. I based the original configuration on the NCS GATT throughput example, which uses Nordics proprietary controller. Is there some other reference that I am missing? |
As this is no more a bug, I request you to close this issue and open a new enhancement request to have sample/documentation around use of larger packets. |
Describe the bug
ATT data from a slave device that is split across multiple PHY packets appears to lockup something in the Zephyr master.
The issue occurs on the first packet that is split. In the current case, the Nth Handle Value Indication packet is sent by the Slave device, and the Zephyr master never responds with a value confirmation.
This issue is 100% repeatable on the same packet each time a connection is made (7th indication currently).
A similar issue appears when I attempt discovery before increasing the connection data length through bt_conn_le_data_len_update.
Two 128bit characteristics are present in a service, the Read By Type response is split across two packets. In this case the Bluetooth stack emits an ATT Timeout error.
Again, this issue is consistent on every connection.
In both cases, the connection is not dropped, neither side crashes.
The slave device is based upon the nRF5 S140 v6.1.1 running FreeRTOS.
Phone applications and other devices running the FreeRTOS stack can observe notifications indefinitely from the device, suggesting that the problem is not on that side.
In the zip file are two .pcapng files demonstrating both issues.
BlockingGattPcapng.zip
Expected behavior
Behavior should not be impacted by LL packets being split.
Discovery should complete, Indications should continue indefinitely.
Impact
What impact does this issue have on your progress (e.g., annoyance, showstopper)
Screenshots or console output
Console output for the discovery case:
Environment (please complete the following information):
This behavior was originally observed on Zephyr 2.2, and was not resolved after updating.
The text was updated successfully, but these errors were encountered: