This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Maximum performance on nrf51822 ?

Hello,

I work on nrf51822 with S130. I use nus service with uart_c and it's very slow (500 ms to send "abc" test string).

I am not energy limited on this application. How can i speed up ?

I have a 16 MHz quartz on my board and a 32 KHz but i use the default one (not sure the one used).

I tried to set connection times to minimum but i'm not sure if they are really used.

  • A colleque tested with a concurrent module (BGM111) and it's faster so limitation is not due to Bluetooth but to softdevice. Please does someone have an idea ? I don't want to port my project on another module if possible.

  • Connection is long too (ready after 6 to 8 seconds). Is that a normal connection time ?

  • Hi Fabien

    When the device is in a connection, the throughput has much to do with the connection interval. There is much information on the connection interval and how that is updated dynamically on this thread.

    When advertising, the device will connect quicker if the advertising interval is short. The time it takes to connect also depends on how frequently the central device scans. If the central device scans continuously, connection establishment will be faster. You can read more about his in the current consumption guide, section "Tuning advertising parameters"

    Update 11.9.2015 To further realize how to improve throughput, these threads could be helpful: (1) (2) (3)

  • I found something,

    my connection parameters look ignored

    that's my values

    #define MIN_CONNECTION_INTERVAL    BLE_GAP_CP_MIN_CONN_INTVL_MIN
    #define MAX_CONNECTION_INTERVAL    (100 * BLE_GAP_CP_MIN_CONN_INTVL_MIN)
    #define SLAVE_LATENCY              0                                 
    #define SUPERVISION_TIMEOUT        MSEC_TO_UNITS(4000, UNIT_10_MS)   
    

    that's my read back min_conn_interval = 600, max_conn_interval = 600, slave_latency = 0, conn_sup_timeout = 400

    but i use the example way to give theses values:

    static const ble_gap_conn_params_t m_connection_param =
    {
        (uint16_t)MIN_CONNECTION_INTERVAL,   // Minimum connection
        (uint16_t)MAX_CONNECTION_INTERVAL,   // Maximum connection
        SLAVE_LATENCY,                       // Slave latency
        (uint16_t)SUPERVISION_TIMEOUT        // Supervision time-out
    };
    

    ...

    uint32_t err_code = sd_ble_gap_connect(&peer_addr, &m_scan_param, &m_connection_param);
    

    and

    memset(&gap_conn_params, 0, sizeof(gap_conn_params));
    
    gap_conn_params.min_conn_interval = MIN_CONNECTION_INTERVAL;
    gap_conn_params.max_conn_interval = MAX_CONNECTION_INTERVAL;
    gap_conn_params.slave_latency     = SLAVE_LATENCY;
    gap_conn_params.conn_sup_timeout  = SUPERVISION_TIMEOUT;
    
    err_code = sd_ble_gap_ppcp_set(&gap_conn_params);
    

    and i have no error returned

    on BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST i receive theses values ??? min_conn_interval 65535, max_conn_interval 65535, slave_latency 0, conn_sup_timeout 65535 that provoque an error code 7 with sd_ble_gap_conn_param_update

    solved, it was an order of initialisation problem.

  • Hi Fabien

    I do not realize if you are in a peripheral role or central role. Are you perhaps using two nRF51822 devices, both with S130, one in peripheral role and one in central role? The sd_ble_gap_connect is only supported by central. The sd_ble_gap_ppcp_set is only supported by peripheral. Can you please clarify.

Related