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

How to correctly configure LF clock source in SDK 15

Hello,

I Have a custom PCB with Fanstel BT832 module soldered. Because that module does not have a 32 KHz quartz I need to set use the internal RC source instead. The problem is that I have 3 different places to set it and I don't know which one I should use.

My sdk_config.h (copied from the hrs example) has those three:

CLOCK_CONFIG_LF_SRC

NRFX_CLOCK_CONFIG_LF_SRC

NRF_SDH_CLOCK_LF_SRC

Which one of them I need to change?

And are there other settings i need to configure to make the internal RC work?

Parents
  • Hi,

    I understand the confusion. In essence:

    • If your use a SoftDevice and always keeps it enabled (for example a BLE or ANT project), you only need to think about the NRF_SDH_CLOCK_LF_SRC and set that according to your HW. This is because the SoftDevice handles all low-level the LFCLK configuration.
    • If your use the clock driver legacy API, then you need to set CLOCK_CONFIG_LF_SRC. (The value of NRFX_CLOCK_CONFIG_LF_SRC will be set to the same value by apply_old_config.h.)
    • If you use the nrfx clock driver API, you should set NRFX_CLOCK_CONFIG_LF_SRC. In that case you should also delete any CLOCK_CONFIG_* defines in your projects sdk_config.h so that they do not replace the corresponding NRFX_CLOCK_CONFIG_* defines.
Reply
  • Hi,

    I understand the confusion. In essence:

    • If your use a SoftDevice and always keeps it enabled (for example a BLE or ANT project), you only need to think about the NRF_SDH_CLOCK_LF_SRC and set that according to your HW. This is because the SoftDevice handles all low-level the LFCLK configuration.
    • If your use the clock driver legacy API, then you need to set CLOCK_CONFIG_LF_SRC. (The value of NRFX_CLOCK_CONFIG_LF_SRC will be set to the same value by apply_old_config.h.)
    • If you use the nrfx clock driver API, you should set NRFX_CLOCK_CONFIG_LF_SRC. In that case you should also delete any CLOCK_CONFIG_* defines in your projects sdk_config.h so that they do not replace the corresponding NRFX_CLOCK_CONFIG_* defines.
Children
Related