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

BLE App UART

Hi,

We are using Nrf51 with SDK nRF5_SDK_12.3.0_d7731ad

We based a UART bridge on the BLE_APP_UART example

The UART connectivity is Rx/ x only (RX_PIN_NUMBER 0;  TX_PIN_NUMBER 2) - no CTS or RTS

Bound rate 57600

We need to send 20 bytes (binary) every 10 m [sec ]

We check the device with the Nrf_connect App (Android)

What happened is that the after 2 or 3 sec of communication the device is disconnected from the App, if we slow down the data rate ( 20 bytes every 100 m [sec]) it works continuously.

We also checked it with NRF51 DK - same issue 

Please advise how we can configure the code so it will work in the requirement rate? 

BR,

Shimon Hayun 

  • Hi, 

    The disconnect is likely caused by a reset it your application. Please compile your app with the "DEBUG" flag added to your list of pre-processor definitions, then add a breakpoint in app_error.c::app_error_save_and_stop() to read out the err code, line number, and file name to confirm where the error occurred.

    I guess it stems from the call to ble_nus_string_send().  It will return BLE_ERROR_NO_TX_PACKETS if the notification buffer becomes full ( can hold 1-7 packets depending on Softdevice bandwidth configuration). In other words, you will probably have to handle this error in your app. Either pause UART reception while the notification buffer is full, or create a RAM buffer to enable queuing of more notifications packets. However, the latter approach will only work if you are receiving a finite amount of data.

    Best regards,

    Vidar      

Related