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

Various notification delays

Hi All

I have a system with two PCA10040 boards both running with SD version s132_nrf52_6.1.0. The application is build with SDK version 15.2.

I have implemented a peripheral device on one board, and a central device on the other. I have designed a custom service for transporting data in both directions. Two characteristics for notifying data from the peripheral, and two characteristics for writing data in the opposite direction. Everything got the expected functionality.

However:

When data is notified from the peripheral the data are normally received within apx 60ms. And that is good. But in some occasions there is suddenly a delay for 750ms. I cannot investigate it closer, that there must be some kind of delay in the softdevice in either end.

I have tried to visualize it on an oscilloscope. The blue curve is the signal from a button on the peripheral, and the red is an LED on the central. The first idle period on the red curve is the time spent on discovering the service, and the last idle period on the red curve is the actual problem. By the way, the first change is indicated within the advertising data to minimize the first delay.

Sorry about the quality, the site reduces everything, even very small (20kb) images.

Does anyone have a clue, or a hint?

Parents
  • Hi,

    What is the connection parameters here? For instance is slave latency = 0?

    What is the LFCLK configuration here when you enable the softdevice?

    Also you calling sd_ble_gatts_hvx() as expected, is it returning any error code?

    Best regards,
    Kenneth

  • Hi,

    Thanks for the follow-up.

    Slave latency is 0 in both peripheral and central device.

    The LFCLK config is following:

    #define NRF_SDH_CLOCK_LF_SRC 1
    #define NRF_SDH_CLOCK_LF_RC_CTIV 0
    #define NRF_SDH_CLOCK_LF_ACCURACY 7
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0

    I believe that the first one sets the external crystal as source, and therefore the rest has no effect.

    The result from sd_ble_gatts_hvx is always NRF_SUCCESS. However I send too many notifications, I receive NRF_ERROR_RESOURCES. But the response time is not affect by this.

    Kasper

Reply
  • Hi,

    Thanks for the follow-up.

    Slave latency is 0 in both peripheral and central device.

    The LFCLK config is following:

    #define NRF_SDH_CLOCK_LF_SRC 1
    #define NRF_SDH_CLOCK_LF_RC_CTIV 0
    #define NRF_SDH_CLOCK_LF_ACCURACY 7
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0

    I believe that the first one sets the external crystal as source, and therefore the rest has no effect.

    The result from sd_ble_gatts_hvx is always NRF_SUCCESS. However I send too many notifications, I receive NRF_ERROR_RESOURCES. But the response time is not affect by this.

    Kasper

Children
Related