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

nRF51822 BLE UART latency

Peripheral receives 4 bytes from central in order to set color of 5 LEDs (1 byte command type + 3 bytes RGB data). There's an iOS app with color picker where user can select a color. User may change color constantly by dragging his finger on the color picker. This results in sending bursts of bytes commands for peripheral. Thought, the rate is never higher than 60 4-byte packets per second (4bytes * 60 = 240 bytes/sec or 2Kbit/s which is less than BLE maximum throughput).

I can notice a 100-700ms lag on changing LED color when choosing single color in the app. The lag builds up when I generate packet bursts and I can clearly see how it affects changing LED color with growing delay. This tells me that packets are not dispatched as fast as they are being received and thus, are buffered somewhere on the peer side.

I looked into low- and high-frequency clocks and SOFTDEVICE_HANDLER_INIT thinking that maybe BLE event handler is called too slowly, but it doesn't seem to be the case.

Any ideas on where to look at?

nRF51822, SoftDevice 110, SDK 8.1.0

Related