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

Throughput with nRF UART example

Hi,

I have set up the UART example with PCA10000 and PCA10001. Everything works fine but one strange thing is the time to send 100kB of data. See my times below:

38 seconds 57 seconds 57 seconds 58 seconds

Then I made a reset of the PCA10001, connected again and start sending more data.

39 seconds 57 seconds 57 seconds

A new reset...

38 seconds 57 seconds . . .

So my question is if someone have noticed the same thing, or if someone have a clue why it get faster to transfer data the first time after a reset? I have not changed anything in the code for the example.

BR marru

Parents
  • I wasn't quite sure what test you did, but when doing the same test you do, I actually get the same behavior. The reason is that ble_app_uart sends a connection parameter update request, which causes the connection interval to be changed after the first transfer. If you look at the log file that is located in c:\ProgramData\Nordic Semiconductor\MasterEmulator, you can see that there will be a connection parameter update:

    
    338605;11:32:35.7957 [ReadPacketQueueThread] HCI event: BTLE_EVENT_LE_CONNECTION_COMPLETE, Status: BTLE_STATUS_CODE_SUCCESS, ConnectionHandle: 0x0000, Role: BTLE_CONNECTION_ROLE_MASTER, AddressType: BTLE_ADDR_TYPE_RANDOM, PeerAddress: 0xCD390EF0D28A, ConnectionInterval: 11,25ms, Latency: 0, Timeout: 3000ms, ClockAccuracy: BTLE_CLOCK_ACCURACY_250_PPM
    /* First data transfer */
    /* ... */
    395711;11:33:16.6767 [ReadPacketQueueThread] Received packet: L2capConnectionParameterUpdateRequest, 12-02-08-00-10-00-3C-00-00-00-90-01, IntervalMin: 20ms, IntervalMax: 75ms, SlaveLatency: 0, Timeout: 4000ms
    /* Second data transfer ... */
    /* ... */
    
    

    As you can see from this question, the connection interval have significant effect on throughput.

    When I adjust the ble_app_uart application to accept any connection interval from 7.5 ms, such update request is no longer sent, and the performance is consistent. This can be done by changing the MIN_CONN_INTERVAL define on top of main.c. The time between connection and sending of the update request can be adjusted by changing FIRST_CONN_PARAMS_UPDATE_DELAY.

    Note that sending a request for a lower connection interval than what's used by default, 7.5 ms instead of 11 ms, would give higher throughput, but the MEFW is limited to only one packet per connection event, so you won't see very impressive numbers still.

Reply
  • I wasn't quite sure what test you did, but when doing the same test you do, I actually get the same behavior. The reason is that ble_app_uart sends a connection parameter update request, which causes the connection interval to be changed after the first transfer. If you look at the log file that is located in c:\ProgramData\Nordic Semiconductor\MasterEmulator, you can see that there will be a connection parameter update:

    
    338605;11:32:35.7957 [ReadPacketQueueThread] HCI event: BTLE_EVENT_LE_CONNECTION_COMPLETE, Status: BTLE_STATUS_CODE_SUCCESS, ConnectionHandle: 0x0000, Role: BTLE_CONNECTION_ROLE_MASTER, AddressType: BTLE_ADDR_TYPE_RANDOM, PeerAddress: 0xCD390EF0D28A, ConnectionInterval: 11,25ms, Latency: 0, Timeout: 3000ms, ClockAccuracy: BTLE_CLOCK_ACCURACY_250_PPM
    /* First data transfer */
    /* ... */
    395711;11:33:16.6767 [ReadPacketQueueThread] Received packet: L2capConnectionParameterUpdateRequest, 12-02-08-00-10-00-3C-00-00-00-90-01, IntervalMin: 20ms, IntervalMax: 75ms, SlaveLatency: 0, Timeout: 4000ms
    /* Second data transfer ... */
    /* ... */
    
    

    As you can see from this question, the connection interval have significant effect on throughput.

    When I adjust the ble_app_uart application to accept any connection interval from 7.5 ms, such update request is no longer sent, and the performance is consistent. This can be done by changing the MIN_CONN_INTERVAL define on top of main.c. The time between connection and sending of the update request can be adjusted by changing FIRST_CONN_PARAMS_UPDATE_DELAY.

    Note that sending a request for a lower connection interval than what's used by default, 7.5 ms instead of 11 ms, would give higher throughput, but the MEFW is limited to only one packet per connection event, so you won't see very impressive numbers still.

Children
No Data
Related