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

Missing BLE_L2CAP_EVT_CH_RX Event

Hello,
I have a BLE peripheral, that should receive larger amounts of data using a l2cap channel. The central (a MacBook) creates the L2CAP channel, the channel is purely used to send data from central to the peripheral. Reproducible after the peripheral received 16 BLE_L2CAP_EVT_CH_RX and after the peripheral issued 16 sd_ble_l2cap_ch_rx(), the peripheral does not receive an BLE_L2CAP_EVT_CH_RX event for the next received L2CAP SDU.

When I debug the peripheral, I see that the not acknowledged data is already completely in the receive buffer and if I trace the BLE connection, I see that the data is correctly transferred to the peripheral (see attached pcap file). Within the event handler, the peripheral stores the very first byte of the received SDU (with an BLE_L2CAP_EVT_CH_RX event). In the debugger, I see that with the last BLE_L2CAP_EVT_CH_RX event, the first byte of the last but one transferred SDU was stored. From this observations, I conclude, that there is an BLE_L2CAP_EVT_CH_RX event missing (somehow).

To make sure, that the CPU is really handling every event immediately, I changed the main loop of the peripheral to call sd_ble_evt_get() and the event handler in a tight loop without any waiting. But this doesn’t changed the behavior. Is there any mean to see if the Softdevice dropped any event? Is there something obvious I can check or anything stupid I could have done wrong to implement such a behavior? Any ideas, any pointers?

Edit: When I use two buffers to receive data, this issue vanish.

kind regards,

Torsten

The Softdevice used, is S132 version 6.1.1 and version 7.0.1 on an nrf52832

missing_event.pcap

Related