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

nRF UART v2.0 app: Disconnects particular data rate

Hi all,

I am using ble_app_uart application to send data to a Bluetooth device. I am sending the data to the Tx Rx Pins of nrF51822 module via an external controller. My baud rate is set to 31250 and I am sending 3 bytes of data to the nrf51822 from the external controller at a particular delay interval.

The device connects to the nRF UART app on phone and I am getting the data without any losses when the delay between the 3 bytes of data from the external controller side is 3 milliseconds or above. When the delay lower the nRF UART app is disconnecting from the central device.

I think most likely issue is that the incoming UART data rate is higher than the outgoing BLE packet rate. Can somebody confirm this? If possible, let me know how to verify this problem with exact numbers for the data rate? Also how do I prevent the device from getting disconnected if there is continuous incoming data in the buffer?

I edited the ble_app_uart to have the following Bluetooth parameters

#define APP_ADV_INTERVAL                64                                       		/**< The advertising interval (in units of 0.625 ms. This value corresponds to 40 ms). */ 
#define APP_ADV_TIMEOUT_IN_SECONDS      180                                       /**< The advertising timeout (in units of seconds). */

#define APP_TIMER_PRESCALER             0                                           /**< Value of the RTC1 PRESCALER register. */
#define APP_TIMER_OP_QUEUE_SIZE         4                                           /**< Size of timer operation queues. */

#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(7.5, UNIT_1_25_MS) //MSEC_TO_UNITS(20, UNIT_1_25_MS)             /**< Minimum acceptable connection interval (20 ms), Connection interval uses 1.25 ms units. */ //(Can be between 7.5ms to 4s)
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(12, UNIT_1_25_MS)	//MSEC_TO_UNITS(75, UNIT_1_25_MS)             /**< Maximum acceptable connection interval (75 ms), Connection interval uses 1.25 ms units. */
#define SLAVE_LATENCY                   0                                           /**< Slave latency. */
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(3000, UNIT_10_MS)  //MSEC_TO_UNITS(4000, UNIT_10_MS)             /**< Connection supervisory timeout (4 seconds), Supervision Timeout uses 10 ms units. */
#define FIRST_CONN_PARAMS_UPDATE_DELAY  APP_TIMER_TICKS(5000, APP_TIMER_PRESCALER)  /**< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_xparam_update is called (5 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(30000, APP_TIMER_PRESCALER) /**< Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */
#define MAX_CONN_PARAMS_UPDATE_COUNT    3                                           /**< Number of attempts before giving up the connection parameter negotiation. */

#define START_STRING                    "Start...\n"                                /**< The string that will be sent over the UART when the application starts. */

#define DEAD_BEEF                       0xDEADBEEF                                  /**< Value used as error code on stack dump, can be used to identify stack location on stack unwind. */

#define UART_TX_BUF_SIZE                256                                         /**< UART TX buffer size. */
#define UART_RX_BUF_SIZE                256                                         /**< UART RX buffer size. */

Thanks!!

Related