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

Central role with high Bandwidth problem

Hi,

I am using a custom board with a nrf51422, SDK11, S130 v2.0.1 with central role.

I have made changes on the code to change from MID bandwidth to High. I added the following code to the ble_stack_init:

   /* Example for one medium-bandwidth RX and TX connection as a peripheral and
   high-bandwidth RX, medium-bandwidth TX connection as a central. */
   ble_conn_bw_counts_t conn_bw_counts = {
                                  .tx_counts = {.high_count = 1, .mid_count = 0, .low_count = 0},
                                  .rx_counts = {.high_count = 1, .mid_count = 0, .low_count = 0}
                                  };
   ble_enable_params_t enable_params = {0};
   enable_params.common_enable_params.p_conn_bw_counts = &conn_bw_counts;
   enable_params.gap_enable_params.central_conn_count = 1;
   enable_params.gap_enable_params.periph_conn_count = 0;


 //Check the ram settings against the used number of links
CHECK_RAM_START_ADDR(CENTRAL_LINK_COUNT,PERIPHERAL_LINK_COUNT);

// Enable BLE stack.
err_code = softdevice_enable(&enable_params);
APP_ERROR_CHECK(err_code);


// Register with the SoftDevice handler module for BLE events.
err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
APP_ERROR_CHECK(err_code);

And the following to on_ble_evt on the BLE_GAP_EVT_ADV_REPORT case:

ble_opt_t ble_opt;
/* Configure bandwidth and connect as a central */
ble_common_opt_conn_bw_t conn_bw = { .role = BLE_GAP_ROLE_CENTRAL, .conn_bw = {
                      .conn_bw_rx = BLE_CONN_BW_HIGH, .conn_bw_tx = BLE_CONN_BW_HIGH } };
ble_opt.common_opt.conn_bw = conn_bw;
sd_ble_opt_set(BLE_COMMON_OPT_CONN_BW, &ble_opt);
/* Connection established with the configured bandwidth */
						
err_code = sd_ble_gap_connect(&p_adv_report->peer_addr,
                                          &m_scan_params,
                                          &m_connection_param);

1st question - Is this enough for sending and receiving up to 6 packets per connection?

I was using the same code before to send audio both ways from a central to peripheral devices and had a good quality. Now I wanted to increase the audio quality and reduce the current consumption so wanted to send more packets in less connections, to do this I have changed the code as explained above but it seems I have introduced some problem because the audio on the central device is terrible, but the one the peripheral is good, so it seems that the correct packets and data are being sent correctly but something is missing.

2nd question - Do I need to change/add something else like the size of the RAM or does this changes are incompatible with some other modules as spi, twi or uart?

Hope that someone can help me, If you need some more explanation or more code just ask me. If I have any update or solution on this problem I just put here.

Related