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

Working with dongle

Hi,

What changes do I need to make to the C/C++ library & ble_connectivity firmware so that the nrf52 dongle can support a BLE packet > 27 bytes?

  • Thanks for the info. I will work on this. So coming back to my original question, I modified the ble_connectivity firmware for packet size > 27

    I changed

    #define BLE_GATT_ATT_MTU_DEFAULT          32

    in ble_gatt.h

    &

    #define NRF_SDH_BLE_GAP_DATA_LENGTH 36

    in sdk_config.h

    I also modified the C/C++ library.

    I changed #define BLE_GATT_ATT_MTU_DEFAULT          32

    in ble_gatt.h

    But still I can see only 20 bytes which means it supports only 27 bytes packets.

  • Hi,

    bscdb said:
    But still I can see only 20 bytes which means it supports only 27 bytes packets.

    Can you elaborate? Where do you see this?

    Do you do a data length update procedure? Please refer to the migration document for the SoftDevic for details on this ("Data Length Update Procedure" section). This pseudo code snipped from the migration document demonstrates how to do it (the first part resided in the connectivity firmware in this case, but the latter resides on the PC side via the pc-ble-driver):

    const uint16_t client_rx_mtu = 247;
    const uint32_t long_att_conn_cfg_tag = 1;
    
    /* ATT_MTU must be configured first */
    ble_cfg_t cfg;
    memset(&cfg, 0, sizeof(ble_cfg_t));
    cfg.conn_cfg.conn_cfg_tag = long_att_conn_cfg_tag;
    cfg.conn_cfg.params.gatt_conn_cfg.att_mtu = client_rx_mtu;
    sd_ble_cfg_set(BLE_CONN_CFG_GATT, &cfg, ...);
    
    /* Enable the BLE Stack */
    sd_ble_enable(...);
    
    [...]
    
    uint16_t long_att_conn_handle;
    
    /* Establish connection */
    sd_ble_gap_adv_start(..., long_att_conn_cfg_tag);
    
    [...]
    
    /* Start Data Length Update Procedure, can be done without ATT_MTU exchange */
    ble_gap_data_length_params_t params = {
    .max_tx_octets = client_rx_mtu + 4,
    .max_rx_octets = client_rx_mtu + 4,
    .max_tx_time_us = BLE_GAP_DATA_LENGTH_AUTO,
    .max_rx_time_us = BLE_GAP_DATA_LENGTH_AUTO
    };
    sd_ble_gap_data_length_update(long_att_conn_handle, &params, NULL);
    
    [...]
    
    case BLE_GAP_EVT_DATA_LENGTH_UPDATE:
    {
        /* Data Length Update Procedure completed, see p_ble_evt->evt.gap_evt.params.data_length_update.
        effective_params for negotiated parameters. */
        break;
    }

  • Hi,

    I opened "..examples\connectivity\ble_connectivity\pca10059\ser_s140_usb_hci\ses ble_connectivity_s140_usb_hci_pca10059.emProject" with SEGGER Embedded Studio and built this project. Uploaded "..\examples\connectivity\ble_connectivity\pca10059\ser_s140_usb_hci\ses\Output\Release\Exe ble_connectivity_s140_usb_hci_pca10059.hex" and "..\components\softdevice\s140\hex s140_nrf52_6.1.1_softdevice.hex" by nRF Connect Programmer. 

    But the dongle didn't work, and nRF Connect Programmer displayed:

    My question is "How to compile and use connectivity for nRF52840 Dongle?"

    Best regards

  • Hi,

    If you want to build the connectivity firmware yourself, then you should know that the pc-ble-driver patches the connectivity example. Please see the documentation in the pc-ble-driver repo for details (Compiling connectivity HEX files).

Related