nrf52833 BLE Packet Loss Rate High

Hi,

    I use nrf52833 Development board PCA10100 to do loss test as peripheral and speed is 1Mbps, tx power is MAX. It's loss rate is very high, when nrf52833 sends a packet every millisecond to Upper computer. What are the possible reasons for this problem?And the upper computer proved to be fine.

Sincerely!

  • Hi Vidar,

    This is my mini keil5 project, which the steps of testing as follow:

    step 1. compile the project and download to board.

    step 2. connect with debug application on mobile phone in 15s.

    step 3.After the board is powered on or reset for 15s, timer2 will send 20 packets(1 packet per 10 ms) to the application after power on by characteristic2.

    You can observe the statistics of the application, where the first four bytes of the message are the frame number. In addition, the device name is Nordic_UART.

    Thanks,

    Soloman.

    nrf52833dk.rar

  • Hi,

    I found there is no packet lost, when the packet is shorter than 100 bytes. But the MTU is set to 251 successfully, and exchanged mtu with the centeral is successful.

    Thansk,

    Soloman

  • Hi Soloman,

    Thanks for sharing the code. The if statement in the code snippet below will never evaluate to true.

        err_code = sd_ble_gatts_hvx(ulConnHandle, &hvx_params);
        if ((err_code == NRF_SUCCESS) && (hvx_len != usLen))
        {
            NRF_LOG_DEBUG("Failed sending notification. Error 0x%x. ", err_code);
        }

    So you will not get any error message if the sd_ble_gatts_hvx() function, for instance, returns with NRF_ERROR_RESOURCES.

    Please try this instead:

        err_code = sd_ble_gatts_hvx(ulConnHandle, &hvx_params);
        if (err_code != NRF_SUCCESS)
        {
            NRF_LOG_DEBUG("Failed sending notification. Error 0x%x. ", err_code);
        }

    Best regards,

    Vidar

  • Hi Vidar,

    I'm very awkward for this mistake. I do test again and the return value is NRF_ERROR_TIMEOUT. Why does packet sending time out when the interval is 10ms, but when the interval is larger, such as 50ms, it does not time out?

    Thanks,

    Soloman

  • Hi Soloman,

    It's an easy mistake to make. However, the NRF_ERROR_TIMEOUT (13) error is an uncommon for the HVX call. It indicates that there has been a GATT procedure timeout in the current connection. This should also trigger either the BLE_GATTC_EVT_TIMEOUT or BLE_GATTS_EVT_TIMEOUT event. Can you please check which of these two events were triggered? Also, do you see the same errors with different central devices?

    Best regards,

    Vidar

Related