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

  • This is not expected, and I suspect there could be some problem with your code that causes this. Can you please supply your complete project, so that we can test it here, either as an attachment here or in a regular support case?

  • Hi,

    I have not changed anything in the code...

    Used firmware: ble_app_uart, located: Keil\ARM\Device\Nordic\nRF51822\Board\pca10001\s110\experimental\ble_app_uart

    The precompiled nRFUart.exe is used. Located: ..\Nordic Semiconductor\Master Emulator\2.1.7.8226\Example code\nRFUart\Precompiled

    Files attached.

    ble_app_uart.zip

  • 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.

  • Hi,

    thank you for your answer! It solved my problem.

    BUT!!!

    You wrote that the MEFW is limited to one packet per connection event. So if I had understood, the theoretical min time to transfer 100 kB of data is:

    ( 1 packet x 20 B ) / 0.0075 = 2667 B/s

    100 kB / 2667 B/s = 37,5 s

    But when I send 100 kB after I made the change you recommended it takes 32 s (now the same value every time :))

  • There could possibly be instances in which two packets are transmitted, but on average, you shouldn't see more than one packet per interval. When I test it here, I see numbers pretty close to the expected 37 s. You can use our sniffer to see what actually happens on-air, if you have an additional USB dongle: https://www.nordicsemi.com/eng/content/download/39099/660783/file/ble-sniffer_win_0.9.5.zip

    However, I would strongly recommend you to make sure to do all performance tests with a device that is actually the one that will be used for your end application, since MEFW isn't really meant to be a production quality solution.

Related