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

S140 & SDK14, bluetooth5 test with nRF52840

Hello,

I succeeded to port s110 & sdk9 to s140 & sdk14 which was a problem before.

What we need to do now is to compare the performance of BLE devices with s110 & sdk9 (nrf51822) and bluetooth 5 devices with s140 & sdk14 (nrf52840).

In order to test bluetooth5, we modified a part by referring to "ATT_MTU Throughput Example"

Here are some of the modified sources:

--main.c

#define bBluetooth5
#ifdef bBluetooth5
#define L2CAP_HDR_LEN   4   //!< Length of a L2CAP header, in bytes.
static ble_gap_phys_t  phys =
{
	.tx_phys             = BLE_GAP_PHY_2MBPS | BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_CODED,
	.rx_phys             = BLE_GAP_PHY_2MBPS | BLE_GAP_PHY_1MBPS | BLE_GAP_PHY_CODED
};
#define CONN_INTERVAL_DEFAULT           (uint16_t)(MSEC_TO_UNITS(7.5, UNIT_1_25_MS))    /**< Default connection interval used at connection establishment by central side. */
#endif

void data_len_ext_set(bool status)
{
    uint8_t data_length = status ? (247 + L2CAP_HDR_LEN) : (23 + L2CAP_HDR_LEN);
    (void) nrf_ble_gatt_data_length_set(&m_gatt, BLE_CONN_HANDLE_INVALID, data_length);
}

static void conn_evt_len_ext_set(bool status)
{
    ret_code_t err_code;
    ble_opt_t  opt;

    memset(&opt, 0x00, sizeof(opt));
    opt.common_opt.conn_evt_ext.enable = status ? 1 : 0;

    err_code = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &opt);
    APP_ERROR_CHECK(err_code);
}

void preferred_phy_set(ble_gap_phys_t * p_phy)
{
#if defined(S140)
    ble_opt_t opts;
    memset(&opts, 0x00, sizeof(ble_opt_t));
    memcpy(&opts.gap_opt.preferred_phys, p_phy, sizeof(ble_gap_phys_t));
    ret_code_t err_code = sd_ble_opt_set(BLE_GAP_OPT_PREFERRED_PHYS_SET, &opts);
    APP_ERROR_CHECK(err_code);
#endif
}

int main(void)
{
    bool erase_bonds;
	uint32_t cnt;

    // Initialize.
    uart_init();


    log_init();
    timers_init();
    buttons_leds_init(&erase_bonds);

    ble_stack_init();
    gatt_init();

#ifdef bBluetooth5
	data_len_ext_set(true);
	conn_evt_len_ext_set(true);
	preferred_phy_set(&phys);
#endif

I modified it as above.

To sum up what I want to do,

  1. I will find a device that supports bluetooth5. For example, the Galaxy S8.
  2. After finding the device, I would like to compare the performance with the existing device and the device with bluetooth5.

How do you approach performance comparisons?

Do you configure the amount of packets and check the time it takes to send them? Or is the device more responsive? How do I compare these things?

  • Hi,

    You should see significantly higher performance and throughout between a nRF52832 and a BLE 5 enabled phone like Samsung Galaxy S8, compared to the using a nRF51-series chip.

    Comparing the nRF51x and the nRF52832, the nRF52832 have support for increased ATT MTU size, Data length extension(DLE), Connection event length extension and 2Mbit PHY mode. The nRF51 series dont have any of this. For the terms used here, I recommend taking a look at this blog post..

    You have maybe seen our youtube video called, "Bluetooth 5 high throughput mode (2Mbps) demo with nRF52 Series". The source code for the demo is available on Github if you want to have a look at it here; , and the Android code is also available here. How the throughput is measured on the Android side should be shown around here in the code.

Related