NCS on-demand LFCLK calibration

We have a custom board based on the nRF52805 that does not have a LFXO, instead relying on the RC. We are using NCS 2.6.1.

We see current spikes every 4 and 8 seconds that raise the average System ON sleep current from about 2 uA to about 3.5 uA. These spikes disappear with CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC_CALIBRATION=n, so I believe this is related to RC calibration using the HFXO? 

BLE is typically disabled and only enabled on demand by an external signal, so we would like to disable this calibration most of the time, and only enable on demand. Is this possible?

Parents
  • Hi Graham

    What you are seeing here is the LF clock calibration, yes. It seems the calibration is running continuously, regardless of any activity in the SoftDevice controller (SDC), as the clock calibration is handled by the MPSL module and not the SDC. 

    There is no official way to change this behavior unfortunately, but the code controlling the calibration is available in the MPSL source files, and you could change this yourself if you want to. 

    Essentially all you have to do is to comment out this line, to avoid the calibration task being triggered repeatedly. 

    Then you need to call the mpsl_calibration_timer_handle() function manually, which allows you to call it whenever you want. Just make sure that you call it often enough when a Bluetooth connection is active. 

    Best regards
    Torbjørn 

Reply
  • Hi Graham

    What you are seeing here is the LF clock calibration, yes. It seems the calibration is running continuously, regardless of any activity in the SoftDevice controller (SDC), as the clock calibration is handled by the MPSL module and not the SDC. 

    There is no official way to change this behavior unfortunately, but the code controlling the calibration is available in the MPSL source files, and you could change this yourself if you want to. 

    Essentially all you have to do is to comment out this line, to avoid the calibration task being triggered repeatedly. 

    Then you need to call the mpsl_calibration_timer_handle() function manually, which allows you to call it whenever you want. Just make sure that you call it often enough when a Bluetooth connection is active. 

    Best regards
    Torbjørn 

Children
Related