Hi
We are using the nRF5340DK with NCS Version 2.6.1.
Our goal is to send 52 bytes every 20 ms. To achieve this, we have configured the parameters as follows: MTU is set to 66 bytes, Connection Interval is 7.5 ms, and Event Length is 2.5 ms.
We utilize the bt_gatt_write_without_response_cb()
function with a transmit complete callback.
We noticed that the time interval between placing data in the buffer using bt_gatt_write_without_response_cb() and receiving the transmit complete callback frequently exceeds 20 ms, even when the device is in close proximity. This should not occur, as we are using the CI 7.5ms, unless there is some internal processing causing the delay.
1. Given the sufficient bandwidth provided by the configured BLE parameters, why is the transmission taking longer than 20 ms?
2. Is this issue related to our use of the transmit complete callback function? The function definition states, "By using a callback, it also disables the internal flow control, which would otherwise prevent sending multiple commands without waiting for their transmissions to complete. Therefore, if this is necessary, the caller should avoid submitting more data until the callback is called."
If we use bt_gatt_write_without_response()
without the transmit complete callback function, the system enters a hang state when the stack buffer is full.
3. How can we monitor the stack buffer queue in real-time to prevent deadlock without using the transmit complete callback? Are there any example codes available?