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

NCS losing data on UART reception when BLE scanning and advertising

Hello everyone,

is it normal behaviour to lose data on UART reception when BLE scanning and advertising both are active?

So far I didn't lose serial data if I just run scanning OR advertising. I tested the UART with 8192 blocks of 10 Bytes of data with a delay between the blocks of ~30ms.

Is there a way to tweak the configuration to not lose data and still run scanning and advertising?

Thanks in advance!

NCS V1.5.1 configuration:

UART Rx:
Buffer size = 125
Timeout = 1ms
Baudrate = 115200 (Updated)

Advertising:
Interval = 211,25 - 318,75

Scanning:
Interval = 60ms
Window = 30ms

Parents
  • Hi

    It shouldn't be strictly necessary to use HW flow control, but there are some advantages to it, such as that you don't overrun buffers and also likely get lower current consumption. When not using the HW flow control you will however have to handle the buffers yourself.

    You can also try to decrease the baud rate to see if you still lose data at lower baud rates or not.

    Best regards,

    Simon

Reply
  • Hi

    It shouldn't be strictly necessary to use HW flow control, but there are some advantages to it, such as that you don't overrun buffers and also likely get lower current consumption. When not using the HW flow control you will however have to handle the buffers yourself.

    You can also try to decrease the baud rate to see if you still lose data at lower baud rates or not.

    Best regards,

    Simon

Children
  • Hi Simon,

    first of all thank you for your replys. I was able to solve my problem by reducing the UART buffer size to 32 bytes. With that change I can still use the 115200 baudrate and don't need HW flow control.

    It seems to me that the constant allocating and freeing of the 125 byte buffer causes a strange delay that ultimately leads to a packet loss at some point.

    Best regards,
    David

Related