SDK_CONFIG file clarification NRF52

Hi All, 

I am using NRF5 SDK 17, I have been playing with several examples and noticed that when it comes set up, a peripheral or a priority or clock source there will always be two macro definitions for each one. with similar prefix: NRF and NRFX

for instance:

NRF_CLOCK_ENABLED 

and 

NRFX_CLOCK_ENABLED

What is the difference bettwen the two definitions ? 

Which one should I rely on when it comes to set up peripherals and/or priorities ? 

Thanks :) 

  • NRF and NRFX are two generations of peripheral libraries that coexist in a generally frustrating way. NRFX is the newer of the two but not universally recommended for direct use by Nordic seemingly at random depending on who happens to reply. The reasoning for this is usually that there is a layer that translates nrf_drv to nrfx so just use nrf_drv. Personally, I use nrfx wherever possible but I like to be difficult.

    When a sdk_config file contains both NRF and NRFX defines I usually configure both. Not doing so usually results in whatever peripheral not being enabled and having to configure both macros anyway. You can remove either the NRF or NRFX macros and only need to change one, and that is something I do occasionally.

    Having both macros tends to lead to a lot of confusion and frustration and is something a lot of us would like to see simplified but there does not seem to be a lot of drive to do so.

Related