You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2022/03/18 01:34:09 UTC

[GitHub] [mynewt-nimble] StarGate01 edited a comment on issue #1207: NRF52: Use with MCU_LFCLK_SOURCE: LFRC

StarGate01 edited a comment on issue #1207:
URL: https://github.com/apache/mynewt-nimble/issues/1207#issuecomment-1071883777


   Thanks for the link, I adjusted the calibration loop to this:
   
   ```c++
   void calibrate_loop(nrf_drv_clock_evt_type_t event) {
     // 10 * 0.25s = 2.5s calibration cycle
     if (event == NRF_DRV_CLOCK_EVT_CAL_DONE) {
       NRF_LOG_INFO("Calibration done, scheduling next one");
       nrf_drv_clock_calibration_start(10, calibrate_loop);
     }
   }
   ```
   
   I enabled debug output for Nimble and the NRF SDK. It seems that the initialization and calibration loop does its job, at least as far as the NRF SDK is concerned.
   
   ```
   <info> CLOCK: Function: nrfx_clock_init, error code: NRF_SUCCESS.
   <info> CLOCK: Module enabled.
   <info> clock: Function: nrf_drv_clock_init, error code: NRF_SUCCESS.
   <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   <info> app: Calibration done, scheduling next one
   ```
   
   The following log prints every 2.5s (Lines might be out of order due to threading or RTT buffer latency)
   ```
   <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   <info> app: Calibration done, scheduling next one
   <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   ```
   
   The GAP advertisment call is logged as follows:
   ```
   GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
   ```
   
   NRF connect on my phone does only sporadically receive these advertisements.
   
   Once a peer tries to connect, the following is logged:
   ```
   <info> app: Advertising event : BLE_GAP_EVENT_CONNECT
   <info> app: connection established; status=0 
   <info> app: [SPIMASTER] Wakeup
   <info> app: [TWIMASTER] Wakeup
   <info> app: [SpiNorFlash] ID on Wakeup: 21
   <info> app: [SpiNorFlash] Wakeup
   <info> app: Calibration done, scheduling next one
   <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   <info> app: [LCD] Wakeup
   GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
   <info> app: Advertising event : BLE_GAP_EVENT_DISCONNECT
   <info> app: disconnect; reason=574
   GATT procedure initiated: discover service by uuid; uuid=0x1805
   <info> app: [Discovery] Starting discovery
   <info> app: [Discovery] Discover next service
   <info> app: [CTS] Starting discovery
   ```
   According to https://mynewt.apache.org/latest/network/ble_hs/ble_hs_return_codes.html, a return code of 574 means "Connection Failed to be Established".
   
   Could the calibration cycle interfere with the Bluetooth functionality?
   
   InfiniTime uses FreeRTOS instead of mynewt, but still uses nimble as a library. Could that cause timing issues?
   
   For reference, I attached two more logs with timestamps. One with LFSYNT and one with LFRC. Using LFSYNT, NRF connect receives an advertisement reliably every ~60 ms, and everything else Bluetooth works as well.
   
   <details>
   <summary>LFSYNT</summary>
   
   ```
   [2022-03-17T23:03:13.800Z, +020441ms] <info> CLOCK: Function: nrfx_clock_init, error code: NRF_SUCCESS.
   [2022-03-17T23:03:13.800Z, +020441ms] <info> CLOCK: Module enabled.
   [2022-03-17T23:03:13.800Z, +020441ms] <info> clock: Function: nrf_drv_clock_init, error code: NRF_SUCCESS.
   [2022-03-17T23:03:13.800Z, +020441ms] <info> app: Logger task started!
   [2022-03-17T23:03:13.800Z, +020441ms] GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
   [2022-03-17T23:03:13.800Z, +020441ms] <info> app: systemtask task started!
   [2022-03-17T23:03:13.800Z, +020441ms] <info> app: Last reset reason : Soft reset
   [2022-03-17T23:03:13.800Z, +020441ms] <info> app: [SpiNorFlash] Manufacturer : 133, Memory type : 96, memory density : 22
   [2022-03-17T23:03:13.865Z, +020506ms] <info> app: DISABLE
   [2022-03-17T23:03:23.227Z, +029868ms] <info> app: ---------------------------------------
   [2022-03-17T23:03:23.227Z, +029868ms] Free heap : 840
   [2022-03-17T23:03:23.227Z, +029868ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:03:23.227Z, +029868ms] <info> app: Task [MAI] - 91
   [2022-03-17T23:03:23.227Z, +029868ms] <info> app: Task [dis] - 480
   [2022-03-17T23:03:23.227Z, +029868ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:03:23.227Z, +029868ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:03:23.227Z, +029868ms] <info> app: Task [Hea] - 427
   [2022-03-17T23:03:23.227Z, +029868ms] <info> app: Task [ll] - 472
   [2022-03-17T23:03:23.227Z, +029868ms] <info> app: Task [ble] - 431
   [2022-03-17T23:03:26.868Z, +033508ms] <info> app: DimTimerCallback
   [2022-03-17T23:03:26.868Z, +033508ms] <info> app: Dim timeout -> Dim screen
   [2022-03-17T23:03:28.834Z, +035474ms] <info> app: IdleTimerCallback
   [2022-03-17T23:03:28.834Z, +035474ms] <info> app: Idle timeout -> Going to sleep
   [2022-03-17T23:03:28.834Z, +035474ms] <info> app: [systemtask] Going to sleep
   [2022-03-17T23:03:28.834Z, +035474ms] <info> app: DISABLE
   [2022-03-17T23:03:29.420Z, +036061ms] <info> app: [LCD] Sleep
   [2022-03-17T23:03:29.420Z, +036061ms] <info> app: [SPIMASTER] sleep
   [2022-03-17T23:03:29.420Z, +036061ms] <info> app: [TWIMASTER] Sleep
   [2022-03-17T23:03:32.982Z, +039622ms] <info> app: ---------------------------------------
   [2022-03-17T23:03:32.982Z, +039622ms] Free heap : 840
   [2022-03-17T23:03:32.982Z, +039622ms] <info> app: Task [MAI] - 91
   [2022-03-17T23:03:32.982Z, +039622ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:03:32.982Z, +039622ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:03:32.982Z, +039622ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:03:32.982Z, +039622ms] <info> app: Task [dis] - 480
   [2022-03-17T23:03:32.982Z, +039622ms] <info> app: Task [ll] - 472
   [2022-03-17T23:03:32.982Z, +039622ms] <info> app: Task [ble] - 431
   [2022-03-17T23:03:32.982Z, +039622ms] <info> app: Task [Hea] - 427
   [2022-03-17T23:03:36.137Z, +042778ms] <info> app: Advertising event : BLE_GAP_EVENT_CONNECT
   [2022-03-17T23:03:36.137Z, +042778ms] <info> app: connection established; status=0 
   [2022-03-17T23:03:36.137Z, +042778ms] <info> app: [SPIMASTER] Wakeup
   [2022-03-17T23:03:36.137Z, +042778ms] <info> app: [TWIMASTER] Wakeup
   [2022-03-17T23:03:36.137Z, +042778ms] <info> app: [SpiNorFlash] ID on Wakeup: 21
   [2022-03-17T23:03:36.137Z, +042778ms] <info> app: [SpiNorFlash] Wakeup
   [2022-03-17T23:03:36.330Z, +042971ms] <info> app: [LCD] Wakeup
   [2022-03-17T23:03:36.703Z, +043343ms] GATT procedure initiated: discover service by uuid; uuid=0x1805
   [2022-03-17T23:03:36.723Z, +043364ms] <info> app: [Discovery] Starting discovery
   [2022-03-17T23:03:36.723Z, +043364ms] <info> app: [Discovery] Discover next service
   [2022-03-17T23:03:36.723Z, +043364ms] <info> app: [CTS] Starting discovery
   [2022-03-17T23:03:36.763Z, +043404ms] GATT procedure initiated: discover service by uuid; uuid=0x1811
   [2022-03-17T23:03:36.816Z, +043457ms] <info> app: Advertising event : BLE_GAP_EVENT_CONN_UPDATE
   [2022-03-17T23:03:36.816Z, +043457ms] <info> app: connection updated; status=0 
   [2022-03-17T23:03:36.816Z, +043457ms] <info> app: CTS not found
   [2022-03-17T23:03:36.816Z, +043457ms] <info> app: [Discovery] Discover next service
   [2022-03-17T23:03:36.816Z, +043457ms] <info> app: [ANS] Starting discovery
   [2022-03-17T23:03:36.816Z, +043457ms] <info> app: ANS not found
   [2022-03-17T23:03:36.816Z, +043457ms] <info> app: End of service discovery
   [2022-03-17T23:03:37.907Z, +044548ms] <info> app: Advertising event : BLE_GAP_EVENT_CONN_UPDATE
   [2022-03-17T23:03:37.907Z, +044548ms] <info> app: connection updated; status=0 
   [2022-03-17T23:03:42.826Z, +049467ms] <info> app: ---------------------------------------
   [2022-03-17T23:03:42.826Z, +049467ms] Free heap : 728
   [2022-03-17T23:03:42.826Z, +049467ms] <info> app: Task [MAI] - 91
   [2022-03-17T23:03:42.826Z, +049467ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:03:42.826Z, +049467ms] <info> app: Task [dis] - 480
   [2022-03-17T23:03:42.826Z, +049467ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:03:42.826Z, +049467ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:03:42.826Z, +049467ms] <info> app: Task [Hea] - 427
   [2022-03-17T23:03:42.826Z, +049467ms] <info> app: Task [ll] - 446
   [2022-03-17T23:03:42.826Z, +049467ms] <info> app: Task [ble] - 294
   [2022-03-17T23:03:49.122Z, +055763ms] <info> app: DimTimerCallback
   [2022-03-17T23:03:49.122Z, +055763ms] <info> app: Dim timeout -> Dim screen
   [2022-03-17T23:03:50.402Z, +057043ms] GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
   [2022-03-17T23:03:50.495Z, +057135ms] <info> app: Advertising event : BLE_GAP_EVENT_DISCONNECT
   [2022-03-17T23:03:50.495Z, +057135ms] <info> app: disconnect; reason=531
   [2022-03-17T23:03:51.180Z, +057820ms] <info> app: IdleTimerCallback
   [2022-03-17T23:03:51.180Z, +057820ms] <info> app: Idle timeout -> Going to sleep
   [2022-03-17T23:03:51.180Z, +057820ms] <info> app: [systemtask] Going to sleep
   [2022-03-17T23:03:51.180Z, +057820ms] <info> app: DISABLE
   [2022-03-17T23:03:51.764Z, +058405ms] <info> app: [LCD] Sleep
   [2022-03-17T23:03:51.764Z, +058405ms] <info> app: [SPIMASTER] sleep
   [2022-03-17T23:03:51.764Z, +058405ms] <info> app: [TWIMASTER] Sleep
   [2022-03-17T23:03:52.662Z, +059303ms] <info> app: ---------------------------------------
   [2022-03-17T23:03:52.662Z, +059303ms] Free heap : 728
   [2022-03-17T23:03:52.662Z, +059303ms] <info> app: Task [MAI] - 91
   [2022-03-17T23:03:52.662Z, +059303ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:03:52.662Z, +059303ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:03:52.662Z, +059303ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:03:52.662Z, +059303ms] <info> app: Task [Hea] - 427
   [2022-03-17T23:03:52.662Z, +059303ms] <info> app: Task [dis] - 480
   [2022-03-17T23:03:52.662Z, +059303ms] <info> app: Task [ll] - 446
   [2022-03-17T23:03:52.662Z, +059303ms] <info> app: Task [ble] - 294
   
   RTT connection on TCP port 19021 ended. Waiting for next connection...
   ```
   
   Disconnect reason 531 is "Remote User Terminated Connection", I disconnected manually on my phone.
   
   </details>
   
   <details>
   <summary>LFRC</summary>
   
   ```
   [2022-03-17T23:11:00.405Z, +018748ms] <info> CLOCK: Function: nrfx_clock_init, error code: NRF_SUCCESS.
   [2022-03-17T23:11:00.405Z, +018748ms] <info> CLOCK: Module enabled.
   [2022-03-17T23:11:00.405Z, +018748ms] <info> clock: Function: nrf_drv_clock_init, error code: NRF_SUCCESS.
   [2022-03-17T23:11:00.405Z, +018748ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:00.405Z, +018748ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:00.405Z, +018748ms] <info> app: Logger task started!
   [2022-03-17T23:11:00.405Z, +018748ms] GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
   [2022-03-17T23:11:00.426Z, +018770ms] <info> app: DISABLE
   [2022-03-17T23:11:01.214Z, +019558ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:01.214Z, +019558ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:01.214Z, +019558ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:03.674Z, +022017ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:03.674Z, +022017ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:03.674Z, +022017ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:06.232Z, +024576ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:06.232Z, +024576ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:06.232Z, +024576ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:08.694Z, +027038ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:08.694Z, +027038ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:08.694Z, +027038ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:09.776Z, +028119ms] <info> app: ---------------------------------------
   [2022-03-17T23:11:09.776Z, +028119ms] Free heap : 840
   [2022-03-17T23:11:09.787Z, +028131ms] <info> app: Task [MAI] - 95
   [2022-03-17T23:11:09.787Z, +028131ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:11:09.787Z, +028131ms] <info> app: Task [Hea] - 427
   [2022-03-17T23:11:09.787Z, +028131ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:11:09.787Z, +028131ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:11:09.787Z, +028131ms] <info> app: Task [dis] - 471
   [2022-03-17T23:11:09.787Z, +028131ms] <info> app: Task [ll] - 472
   [2022-03-17T23:11:09.787Z, +028131ms] <info> app: Task [ble] - 431
   [2022-03-17T23:11:11.255Z, +029599ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:11.255Z, +029599ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:11.255Z, +029599ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:13.421Z, +031765ms] <info> app: DimTimerCallback
   [2022-03-17T23:11:13.421Z, +031765ms] <info> app: Dim timeout -> Dim screen
   [2022-03-17T23:11:13.813Z, +032156ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:13.813Z, +032156ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:13.813Z, +032156ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:15.385Z, +033729ms] <info> app: IdleTimerCallback
   [2022-03-17T23:11:15.385Z, +033729ms] <info> app: Idle timeout -> Going to sleep
   [2022-03-17T23:11:15.385Z, +033729ms] <info> app: [systemtask] Going to sleep
   [2022-03-17T23:11:15.385Z, +033729ms] <info> app: DISABLE
   [2022-03-17T23:11:16.069Z, +034413ms] <info> app: [LCD] Sleep
   [2022-03-17T23:11:16.069Z, +034413ms] <info> app: [SPIMASTER] sleep
   [2022-03-17T23:11:16.069Z, +034413ms] <info> app: [TWIMASTER] Sleep
   [2022-03-17T23:11:16.266Z, +034609ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:16.266Z, +034609ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:16.266Z, +034609ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:18.832Z, +037176ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:18.832Z, +037176ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:18.832Z, +037176ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:19.627Z, +037971ms] <info> app: ---------------------------------------
   [2022-03-17T23:11:19.627Z, +037971ms] Free heap : 840
   [2022-03-17T23:11:19.627Z, +037971ms] <info> app: Task [MAI] - 95
   [2022-03-17T23:11:19.627Z, +037971ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:11:19.627Z, +037971ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:11:19.627Z, +037971ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:11:19.627Z, +037971ms] <info> app: Task [dis] - 471
   [2022-03-17T23:11:19.627Z, +037971ms] <info> app: Task [ll] - 472
   [2022-03-17T23:11:19.627Z, +037971ms] <info> app: Task [ble] - 431
   [2022-03-17T23:11:19.627Z, +037971ms] <info> app: Task [Hea] - 427
   [2022-03-17T23:11:21.299Z, +039643ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:21.299Z, +039643ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:21.299Z, +039643ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:23.866Z, +042209ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:23.866Z, +042209ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:23.866Z, +042209ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:26.327Z, +044670ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:26.327Z, +044670ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:26.327Z, +044670ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:28.898Z, +047241ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:28.898Z, +047241ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:28.898Z, +047241ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:29.395Z, +047739ms] <info> app: ---------------------------------------
   [2022-03-17T23:11:29.395Z, +047739ms] Free heap : 840
   [2022-03-17T23:11:29.395Z, +047739ms] <info> app: Task [MAI] - 95
   [2022-03-17T23:11:29.395Z, +047739ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:11:29.395Z, +047739ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:11:29.395Z, +047739ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:11:29.395Z, +047739ms] <info> app: Task [ble] - 431
   [2022-03-17T23:11:29.395Z, +047739ms] <info> app: Task [ll] - 472
   [2022-03-17T23:11:29.395Z, +047739ms] <info> app: Task [Hea] - 427
   [2022-03-17T23:11:29.395Z, +047739ms] <info> app: Task [dis] - 471
   [2022-03-17T23:11:31.370Z, +049714ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:31.370Z, +049714ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:31.370Z, +049714ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:33.937Z, +052280ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:33.937Z, +052280ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:33.937Z, +052280ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:36.405Z, +054749ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:36.405Z, +054749ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:36.405Z, +054749ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:38.976Z, +057319ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:38.976Z, +057319ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:38.976Z, +057319ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:39.173Z, +057516ms] <info> app: ---------------------------------------
   [2022-03-17T23:11:39.173Z, +057516ms] Free heap : 840
   [2022-03-17T23:11:39.173Z, +057516ms] <info> app: Task [MAI] - 95
   [2022-03-17T23:11:39.173Z, +057516ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:11:39.173Z, +057516ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:11:39.173Z, +057516ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:11:39.173Z, +057516ms] <info> app: Task [Hea] - 427
   [2022-03-17T23:11:39.173Z, +057516ms] <info> app: Task [ll] - 472
   [2022-03-17T23:11:39.173Z, +057516ms] <info> app: Task [dis] - 471
   [2022-03-17T23:11:39.173Z, +057516ms] <info> app: Task [ble] - 431
   [2022-03-17T23:11:41.438Z, +059782ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:41.438Z, +059782ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:41.438Z, +059782ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:43.999Z, +062342ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:43.999Z, +062342ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:43.999Z, +062342ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:46.471Z, +064815ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:46.471Z, +064815ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:46.471Z, +064815ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:48.937Z, +067281ms] <info> app: ---------------------------------------
   [2022-03-17T23:11:48.937Z, +067281ms] Free heap : 840
   [2022-03-17T23:11:48.947Z, +067291ms] <info> app: Task [MAI] - 95
   [2022-03-17T23:11:48.947Z, +067291ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:11:48.947Z, +067291ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:11:48.947Z, +067291ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:11:48.947Z, +067291ms] <info> app: Task [dis] - 471
   [2022-03-17T23:11:48.947Z, +067291ms] <info> app: Task [ll] - 472
   [2022-03-17T23:11:48.947Z, +067291ms] <info> app: Task [ble] - 431
   [2022-03-17T23:11:48.947Z, +067291ms] <info> app: Task [Hea] - 427
   [2022-03-17T23:11:49.034Z, +067377ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:49.034Z, +067377ms] <info> app: Advertising event : BLE_GAP_EVENT_CONNECT
   [2022-03-17T23:11:49.034Z, +067377ms] <info> app: connection established; status=0 
   [2022-03-17T23:11:49.034Z, +067377ms] <info> app: [SPIMASTER] Wakeup
   [2022-03-17T23:11:49.034Z, +067377ms] <info> app: [TWIMASTER] Wakeup
   [2022-03-17T23:11:49.034Z, +067377ms] <info> app: [SpiNorFlash] ID on Wakeup: 21
   [2022-03-17T23:11:49.034Z, +067377ms] <info> app: [SpiNorFlash] Wakeup
   [2022-03-17T23:11:49.034Z, +067377ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:49.034Z, +067377ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:49.228Z, +067572ms] <info> app: [LCD] Wakeup
   [2022-03-17T23:11:49.239Z, +067583ms] GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
   [2022-03-17T23:11:49.334Z, +067678ms] <info> app: Advertising event : BLE_GAP_EVENT_DISCONNECT
   [2022-03-17T23:11:49.334Z, +067678ms] <info> app: disconnect; reason=574
   [2022-03-17T23:11:49.548Z, +067891ms] GATT procedure initiated: discover service by uuid; uuid=0x1805
   [2022-03-17T23:11:49.630Z, +067974ms] <info> app: [Discovery] Starting discovery
   [2022-03-17T23:11:49.630Z, +067974ms] <info> app: [Discovery] Discover next service
   [2022-03-17T23:11:49.630Z, +067974ms] <info> app: [CTS] Starting discovery
   [2022-03-17T23:11:51.501Z, +069844ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:51.501Z, +069844ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:51.501Z, +069844ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:54.060Z, +072403ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:54.060Z, +072403ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:54.060Z, +072403ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:56.521Z, +074865ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:56.521Z, +074865ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:56.521Z, +074865ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:58.801Z, +077145ms] <info> app: ---------------------------------------
   [2022-03-17T23:11:58.801Z, +077145ms] Free heap : 728
   [2022-03-17T23:11:58.801Z, +077145ms] <info> app: Task [MAI] - 95
   [2022-03-17T23:11:58.801Z, +077145ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:11:58.801Z, +077145ms] <info> app: Task [Hea] - 427
   [2022-03-17T23:11:58.801Z, +077145ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:11:58.801Z, +077145ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:11:58.801Z, +077145ms] <info> app: Task [dis] - 471
   [2022-03-17T23:11:58.801Z, +077145ms] <info> app: Task [ll] - 448
   [2022-03-17T23:11:58.801Z, +077145ms] <info> app: Task [ble] - 301
   [2022-03-17T23:11:59.082Z, +077426ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:11:59.082Z, +077426ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:11:59.082Z, +077426ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:01.549Z, +079893ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:01.640Z, +079984ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:01.640Z, +079984ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:02.032Z, +080375ms] <info> app: DimTimerCallback
   [2022-03-17T23:12:02.032Z, +080375ms] <info> app: Dim timeout -> Dim screen
   [2022-03-17T23:12:04.006Z, +082350ms] <info> app: IdleTimerCallback
   [2022-03-17T23:12:04.006Z, +082350ms] <info> app: Idle timeout -> Going to sleep
   [2022-03-17T23:12:04.006Z, +082350ms] <info> app: [systemtask] Going to sleep
   [2022-03-17T23:12:04.006Z, +082350ms] <info> app: DISABLE
   [2022-03-17T23:12:04.104Z, +082448ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:04.104Z, +082448ms] <info> app: Advertising event : BLE_GAP_EVENT_CONNECT
   [2022-03-17T23:12:04.104Z, +082448ms] <info> app: connection established; status=0 
   [2022-03-17T23:12:04.104Z, +082448ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:04.104Z, +082448ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:04.333Z, +082676ms] GAP procedure initiated: advertise; disc_mode=2[2022-03-17T23:12:04.343Z, +082687ms]  adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
   [2022-03-17T23:12:04.405Z, +082748ms] <info> app: Advertising event : BLE_GAP_EVENT_DISCONNECT
   [2022-03-17T23:12:04.405Z, +082748ms] <info> app: disconnect; reason=574
   [2022-03-17T23:12:04.548Z, +082892ms] GATT procedure initiated: discover service by uuid; uuid=0x1805
   [2022-03-17T23:12:04.601Z, +082944ms] <info> app: [Discovery] Starting discovery
   [2022-03-17T23:12:04.601Z, +082944ms] <info> app: [Discovery] Discover next service
   [2022-03-17T23:12:04.601Z, +082944ms] <info> app: [CTS] Starting discovery
   [2022-03-17T23:12:04.601Z, +082944ms] <info> app: [LCD] Sleep
   [2022-03-17T23:12:04.601Z, +082944ms] <info> app: [SPIMASTER] sleep
   [2022-03-17T23:12:04.601Z, +082944ms] <info> app: [TWIMASTER] Sleep
   [2022-03-17T23:12:06.659Z, +085002ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:06.659Z, +085002ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:06.659Z, +085002ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:08.538Z, +086881ms] <info> app: ---------------------------------------
   [2022-03-17T23:12:08.538Z, +086881ms] Free heap : 728
   [2022-03-17T23:12:08.538Z, +086881ms] <info> app: Task [MAI] - 95
   [2022-03-17T23:12:08.538Z, +086881ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:12:08.538Z, +086881ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:12:08.538Z, +086881ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:12:08.538Z, +086881ms] <info> app: Task [dis] - 471
   [2022-03-17T23:12:08.538Z, +086881ms] <info> app: Task [ll] - 448
   [2022-03-17T23:12:08.538Z, +086881ms] <info> app: Task [Hea] - 421
   [2022-03-17T23:12:08.538Z, +086881ms] <info> app: Task [ble] - 301
   [2022-03-17T23:12:09.123Z, +087467ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:09.123Z, +087467ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:09.123Z, +087467ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:11.691Z, +090035ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:11.691Z, +090035ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:11.691Z, +090035ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:14.154Z, +092498ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:14.154Z, +092498ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:14.154Z, +092498ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:16.726Z, +095070ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:16.726Z, +095070ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:16.726Z, +095070ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:18.397Z, +096740ms] <info> app: ---------------------------------------
   [2022-03-17T23:12:18.397Z, +096740ms] Free heap : 728
   [2022-03-17T23:12:18.397Z, +096740ms] <info> app: Task [MAI] - 95
   [2022-03-17T23:12:18.397Z, +096740ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:12:18.397Z, +096740ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:12:18.397Z, +096740ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:12:18.397Z, +096740ms] <info> app: Task [Hea] - 421
   [2022-03-17T23:12:18.397Z, +096740ms] <info> app: Task [ll] - 448
   [2022-03-17T23:12:18.397Z, +096740ms] <info> app: Task [ble] - 301
   [2022-03-17T23:12:18.397Z, +096740ms] <info> app: Task [dis] - 471
   [2022-03-17T23:12:19.189Z, +097532ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:19.189Z, +097532ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:19.189Z, +097532ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:21.751Z, +100095ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:21.751Z, +100095ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:21.751Z, +100095ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:24.218Z, +102562ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:24.218Z, +102562ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:24.218Z, +102562ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:26.780Z, +105123ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:26.780Z, +105123ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:26.780Z, +105123ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:28.168Z, +106511ms] <info> app: ---------------------------------------
   [2022-03-17T23:12:28.168Z, +106511ms] Free heap : 728
   [2022-03-17T23:12:28.168Z, +106511ms] <info> app: Task [MAI] - 95
   [2022-03-17T23:12:28.168Z, +106511ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:12:28.168Z, +106511ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:12:28.168Z, +106511ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:12:28.168Z, +106511ms] <info> app: Task [ble] - 301
   [2022-03-17T23:12:28.168Z, +106511ms] <info> app: Task [ll] - 448
   [2022-03-17T23:12:28.168Z, +106511ms] <info> app: Task [dis] - 471
   [2022-03-17T23:12:28.168Z, +106511ms] <info> app: Task [Hea] - 421
   [2022-03-17T23:12:29.242Z, +107586ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:29.242Z, +107586ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:29.242Z, +107586ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:31.801Z, +110145ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:31.801Z, +110145ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:31.801Z, +110145ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:34.265Z, +112608ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:34.265Z, +112608ms] <info> app: Advertising event : BLE_GAP_EVENT_CONNECT
   [2022-03-17T23:12:34.265Z, +112608ms] <info> app: connection established; status=0 
   [2022-03-17T23:12:34.276Z, +112620ms] <info> app: [SPIMASTER] Wakeup
   [2022-03-17T23:12:34.276Z, +112620ms] <info> app: [TWIMASTER] Wakeup
   [2022-03-17T23:12:34.276Z, +112620ms] <info> app: [SpiNorFlash] ID on Wakeup: 21
   [2022-03-17T23:12:34.276Z, +112620ms] <info> app: [SpiNorFlash] Wakeup
   [2022-03-17T23:12:34.276Z, +112620ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:34.276Z, +112620ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:34.466Z, +112809ms] <info> app: [LCD] Wakeup
   [2022-03-17T23:12:34.558Z, +112902ms] GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=1 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
   [2022-03-17T23:12:34.558Z, +112902ms] <info> app: Advertising event : BLE_GAP_EVENT_DISCONNECT
   [2022-03-17T23:12:34.558Z, +112902ms] <info> app: disconnect; reason=574
   [2022-03-17T23:12:34.854Z, +113198ms] GATT procedure initiated: discover service by uuid; uuid=0x1805
   [2022-03-17T23:12:34.864Z, +113208ms] <info> app: [Discovery] Starting discovery
   [2022-03-17T23:12:34.864Z, +113208ms] <info> app: [Discovery] Discover next service
   [2022-03-17T23:12:34.864Z, +113208ms] <info> app: [CTS] Starting discovery
   [2022-03-17T23:12:36.823Z, +115167ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:36.834Z, +115177ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:36.834Z, +115177ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:38.010Z, +116354ms] <info> app: ---------------------------------------
   [2022-03-17T23:12:38.010Z, +116354ms] Free heap : 728
   [2022-03-17T23:12:38.010Z, +116354ms] <info> app: Task [dis] - 471
   [2022-03-17T23:12:38.010Z, +116354ms] <info> app: Task [IDL] - 59
   [2022-03-17T23:12:38.010Z, +116354ms] <info> app: Task [MAI] - 95
   [2022-03-17T23:12:38.010Z, +116354ms] <info> app: Task [Hea] - 421
   [2022-03-17T23:12:38.010Z, +116354ms] <info> app: Task [Tmr] - 245
   [2022-03-17T23:12:38.010Z, +116354ms] <info> app: Task [LOG] - 104
   [2022-03-17T23:12:38.010Z, +116354ms] <info> app: Task [ll] - 448
   [2022-03-17T23:12:38.010Z, +116354ms] <info> app: Task [ble] - 301
   [2022-03-17T23:12:39.379Z, +117722ms] <warning> CLOCK: Function: nrfx_clock_calibration_start, error code: NRF_SUCCESS.
   [2022-03-17T23:12:39.379Z, +117722ms] <info> app: Calibration done, scheduling next one
   [2022-03-17T23:12:39.379Z, +117722ms] <warning> clock: Function: nrf_drv_clock_calibration_start, error code: NRF_SUCCESS.
   
   RTT connection on TCP port 19021 ended. Waiting for next connection...
   ```
   
   I tried to connect three times. It took a while until I received the first advertisement.
   
   </details>
   
   Using a debugger, I found that `ble_ll_com.c:ble_ll_conn_event_start_cb` gets called very late, instead of pretty much instantly (like when using HFSYNT) when a phone tries to conenct. The disconnection event `ble_ll_conn_event_end` is fired directly after.
   
   Since this code differs from the upstream nimble, (according to the InfiniTime commit log, the version bundled with InfiniTime 1.3.0  is nimble 1.3 master, commit 82153e744833821e20e9a8b0d61c38b2b0dbcfe1), I tried to update the included nimble to the most recent master - however, I was not able to successfully compile that combination yet.
   
   Thank you for your continued help.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mynewt.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org