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

NUS connection problems with TimeSync example ported to SDK16.0.0

Hi,

I ported the TimeSync example devzone.nordicsemi.com/.../wireless-timer-synchronization-among-nrf5-devices to the current SDK 16.0.0 and S140_nrf52_7.0.1_softdevice. But now the NUS client has difficulty to connect to the NUS server. The connection request is mostly aborted with reason 0x3E and only after dozens of retries the connection gets established:

<info> app: Connecting to target 7E80BA93D6E9
<info> app: Disconnected. conn_handle: 0x0, reason: 0x3E
<info> app: Connecting to target 7E80BA93D6E9
<info> app: Disconnected. conn_handle: 0x0, reason: 0x3E
...
<info> app: Connecting to target 7E80BA93D6E9
<info> app: Disconnected. conn_handle: 0x0, reason: 0x3E
<info> app: Connecting to target 7E80BA93D6E9
<info> app: Ble NUS max data length set to 244
<info> app: Discovery complete.
<info> app: Connected to device with Nordic UART Service.

When I disable the TimeSync timeslot protocol then the NUS has no problem connecting. With the original TimeSync example based on SDK 14.2.0 and with S140_nrf52840_5.0.0-2.alpha_softdevice I  had no such problems.

Has there somthing changed regarding the timeslot API between S140_nrf52840_5.0.0-2.alpha_softdevice and S140_nrf52_7.0.1_softdevice?

Thanks,
Benno

Parents Reply
  • Hi,

    On the PCA10056 somewhere randomly BSP_EVENT_KEY_x events are generated which turn on and off the sync beacon transmission. On the PCA10040 there are no such BSP_EVENT_KEY_x events!

    The sample was originally written for PCA10040, and there pin P0.24 is available and used for the measurement.

    Snippet(sync_timer_button_init/sync_timer_init):

        // Debug pin: Toggle P0.24 from sync timer to allow pin measurement
        nrf_gpiote_task_configure(3, 24, NRF_GPIOTE_POLARITY_TOGGLE, NRF_GPIOTE_INITIAL_VALUE_LOW);
        nrf_gpiote_task_enable(3);

    But on PCA10056, P0.24 is also used for button 3. So try using pin 27 for the pin measurement instead.

    Has there somthing changed regarding the timeslot API between S140_nrf52840_5.0.0-2.alpha_softdevice and S140_nrf52_7.0.1_softdevice?

    Could be, could also be some timing related changes in advertising/scan module in the SDK, or interrupt priority levels that has changed. 

    Try to increase the advertising interval, try changing APP_ADV_INTERVAL from 64 to 150.

Children
Related