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

app_ble_uart Data Loss - APP UART COMMUNICATION ERROR

Hello All,

I have 2 evaluation boards nrf52840 EVB "PCA10056".

I would like to run on them the "ble_app_uart"  in "nRF5_SDK_15.3.0_59ac345" as following:

  • A custom board send via uart a buffer of "N" characters ending with "\n" to the peripheral on the pin P0.26 every "S" ms.
  • The Board "peripheral" send this packet via bluetooth to the "central board" (where I uploaded the "ble_app_uart_c" code)
  • The "central board" print via uart the packet received.

At the beginning, if for example I increased the distance between the 2 Evaluation boards or moved them quickly, a disconnection occurred because the "peripheral" went to "APP_UART_COMMUNICATION_ERROR" (I believe that an interrupt of the softdevice with higher priority of the UART is triggered and the byte on the UART is not read) but, despite the disconnection, the custom board continued to send data over the Uart to the peripheral,  which could no longer get out of this error.

So checking on the forum and thanks to some tickets like this: 

https://devzone.nordicsemi.com/f/nordic-q-a/23796/app-uart-communication-error/93601#93601 

I was able to manage this error commenting out " APP_ERROR_HANDLER" in  case APP_UART_COMMUNICATION_ERROR, but ignoring the communication error on UART I have some loss of data.

This data loss drags my throughput down dramatically, because if my buffer instead of having N characters has less, it can't be sent to the central device over Bluetooth.

I could decrease "S", but I have experimentally noticed that decreasing "S" the frequency of the error increases and therefore under a certain value of "S" I don't get more improvements.

In another ticket I've read about LIBUARTE: 

https://devzone.nordicsemi.com/f/nordic-q-a/41012/uart---losing-data-when-writing-to-nrf52840-with-pyserial-over-jlink-com-port

but to be honest I did not get how can I change the ble_app_uart using this library (if it is a solution).

Anyone can help me?

Thanks

Parents Reply
  • Hi  ,

    The boards are EV boards that maybe can have some problem, but this situation happened for many other users how you can see from other tickets. And in some cases they solved with LIBUARTE.

    Another thing is that what I move is the "central board", but the problem is on the peripheral. I do not know how they can be related. For example custom board and peripheral are on the table and during the communication I move fast the central (in order to simulate a run) or I touch the antenna . What happen is that on "peripheral side" I have bytes loss.

Children
No Data
Related